10 ms·
I usually use "repeat last change" (. key in normal mode by default) command in vim without a macro for the tasks like that. http://vim.wikia.com/wiki/Repeat_la
by maxnik 14y ago
I usually use "repeat last change" (. key in normal mode by default) command in vim without a macro for the tasks like that. http://vim.wikia.com/wiki/Repeat_last_change http://vim.wikia.com/wiki/Repeat_last_change
To do the task you mentioned in vim I would move the cursor to the first letter of the word Section in the first line. Then I'd insert "Class_" and go back to normal mode. After that I'd move the cursor to the first letter in the word Model in the second line. And then I'd press the dot key and do the same with the other lines in supposedly longer list.
- hilko 14y agoI do that with Sublime Text 2 using the vim plugin (vintage). I would've never switched from vim if not for this plugin. Now I have (most) of the best of both worlds.
- rahoulb 14y agoI have to say vintage did my head in. I guess to me, vim requires a different mindset to a "modern" editor, and vintage mixed the two. Now I seem to spend a few months with vim as my primary editor, get tired of it, switch to ST2 for a few months and then switch back.
- irahul 14y ago> And then I'd press the dot key and do the same with the other lines in supposedly longer list. I am posting this again(posted above about running a macro on a range), but I guess lot of people don't know about this.You need not manually press . on every line. You can run . operator on a range. Do a visual select and then :'<,'>normal .<CR> The range('<,'>) is inserted automatically when : is pressed from visual mode. So it boils down to visual mode, select, :normal . <CR> You can have any ranges you want. :15,49normal .<CR> I have a shortcut for visual range defined in my vimrc vnoremap . :normal . <CR>