atom-vim-mode-plus icon indicating copy to clipboard operation
atom-vim-mode-plus copied to clipboard

Joining line doesn't remove comment characters

Open trusktr opened this issue 6 years ago • 2 comments

It'd be sweet if joining a line (J) would conveniently remove comment characters.

For example, currently if I have

// this is
// a comment

and I press J then I get

// this is // a comment

but it would be nice if it took out the comment chars so it resulted in

// this is a comment

trusktr avatar Nov 15 '18 19:11 trusktr

Automatically removing leading comments can be unwanted behavior in a different situation.

How about trying g q(vim-mode-plus:reflow).

To join two lines when your cursor is at a char.

// a
// b

You can use whichever of the following.

  • g q j: Operator then target(motion = j) flow.
  • V j g q: Select two lines visually then apply operator g q.

t9md avatar Nov 16 '18 00:11 t9md

Thanks for those options, but it won't work if the lines are longer than the right margin. There's cases when I simply just want J and gq doesn't work. For now I workaround with JdE.

Vim has the expected behavior. This would be nice in Atom, but I understand if it isn't high priority, and I can live with it.

Over all thanks for this plugin!! It's the best there is (of all emulators in all editors that I've tried). Plus scripting new commands and maps in JavaScript is much better than viml!

trusktr avatar Nov 16 '18 04:11 trusktr