You wouldn't do the following?
:% s/_/_Class_/
Explained: On each line replace the first '_' with '_Class_'Yeah, that's totally what you'd do, in either editor. But my broader point is that there are situations where the immediate feedback and interactivity of using multiple cursors is valuable.
How is immediate feedback and interactivity going to help if the changes span more than one page? If you are going to extrapolate(looks fine on this page, must be fine elsewhere), you can very well extrapolate from a smaller sample size(run :s/some_crap/some_other_crap/gc, check one or two occurrences, then do 'a' for all).
Re:My Top Sublime Text 2 Plugins
by imatworkyo on Thursday January 17, 2013 @09:32AM
(#5072797)
One can always stop typing and simply scroll down and check.
Re:My Top Sublime Text 2 Plugins
by johncoltrane on Thursday January 17, 2013 @05:19AM
(#5071892)
I've tried to like it and believe that instant feedback is actually useful but no. I couldn't.
Emacs IEdit mode has done this for years
Yeah, I'd record that as a macro and replay it line by line I think.
Rather than replaying it line by line, you can play it over a range. If you do this in your vimrc:
vnoremap @q :normal @q<CR>
You can record the macro in q register, select the visual range, and then do @q to run it over the range. The advantage of doing it thus is you don't have to run the macro manually on every line, and you can undo all change with one u.Also, normal takes ranges(and not just visual ranges). If you want to run the macro recorded in q over lines 15,49, you can do:
:15,49normal @q<CR>
I use the same trick for repeating commands over a range too. vnoremap . normal .<CR>
As usual, it doesn't have to be visual range. But I mostly use visual ranges, and so I have defined shortcuts for visual ranges.
Re:My Top Sublime Text 2 Plugins
by LiveTheDream on Wednesday January 16, 2013 @11:16PM
(#5070902)
Macros are the way I solve this as well. A little practice, and you won't even notice the difference. Just hit `Esc j` before ending the macro recording and moving down a line is no longer a problem :)
The perhaps the closest thing I can think of for your example would be this (starting in normal mode with the cursor at the beginning of your list):
("Move forward to the next '_', enter insert mode, insert '_Class', leave insert mode, move down one line to the first non-blank character, repeat the forward motion, repeat the insertion, repeat forward motion, repeat insertion." Vim does have word motions, but it includes underscores as parts of words.)Edit - formatting and a clarification that it's the closest I can think of (I'm doubtful it's the closest you can get).