by maxnik · 13y ago · 0 comments
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.
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>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.