tcomment_vim
tcomment_vim copied to clipboard
Question about `gcgn`
One of the new features in vim is gn
I was wondering if there is a way to force tcomment to use a line comment on the next motion. Maybe this is possible to setup via a new mapping gC
What are your thoughts?
I was wondering if there is a way to force tcomment to use a line comment on the next motion. Maybe this is possible to setup via a new mapping |gC|
What about vgngc?
// cursor starts here _
val a:String = "one two three"
val b:Int = 3
val c:String = "four five"
val d:String = "six"
let's say I want to comment all of the String definitions except val d and that I have already searched for "String" so to jump to the next string I can just gcgn but the problem is that gn puts you in visual mode and selects the text. So in this case it takes it gives me val a:/* String */ = "one two three" I could just do ngcc but the advantage of . command.
I guess I'm counting keystrokes too much since ngccn n. n. is a score of 9 and gCgn$ .$ .$ I had to put the $ in so that it would take me past the current search. If the $ was part of the gC command it would worth it because it would bring the score down to 6 and just . repeat the comment line on search :D
Since this seems to be a special case, I'd hesitate to include a new map in tcomment -- IMHO there already are too many maps defined by tcomment.
I don't quite understand why you use gn and not n as in ngccn.
There are some plugins around like repeat (please see issue #114 or
#115) that can be used to make this work with ..