2 ms·
Extending Vim really is a pain if you're trying to stay within Vim. Your best bet is to rely on piping output to other shell utilities to get the desired behavi
by mustpax 18y ago
Extending Vim really is a pain if you're trying to stay within Vim. Your best bet is to rely on piping output to other shell utilities to get the desired behavior. :r!cmd reads output of given command into current file. After selecting a set of lines with "V" you can pipe them through a shell command like so:
:'<,'>!cmd
I've also found that you can accomplish a lot with a hastily recorded Vim macro. To start recording keystrokes into buffer "a":
qa
When you're done, hit "q" again and you're macro is saved. "@a" to execute macro.
Vim commands string together pretty easily, and I've done some serious refactoring on good ol' C and ASM with this method back in the day.
These days I'm writing Java in Eclipse, which just doesn't have the same feeling to it.