Re:Eclipse to Textmate: An IDEological Change
by Tichy on Friday June 20, 2008 @03:58AM
(#222549)
Any good introductions to vim? I did the odd editing with vim with a cheat sheet side by side, but I never heard about the "cool features" before reading Hacker News.
[ Parent
| on HN ]
Re:Eclipse to Textmate: An IDEological Change
by BrandonM on Friday June 20, 2008 @11:16AM
(#222797)
I used http://jmcpherson.org/editing.html as well as a cheat sheet. There's also http://vim.org/tips/ which seems to come up a lot whenever I'm searching for specific functionality. Other than that, simply immerse yourself in vim and deal with the pain for no more than a week before you'll find that you're already becoming more efficient.
Some less-commonly-used-but-awesome features:
C-X C-F in insert mode: complete file names
C-X C-L in insert mode: complete entire lines of code
C-N, C-P in insert mode: complete word forward, previous
v (V) in edit mode: entire visual mode (visual line)
gq in visual mode: rewrap selection
>> in edit/visual mode: indent current line/selection
gg=G in edit mode: reformat indentation of entire file
@@ in edit mode: repeat last keyboard macro
There's a lot I've left out (obviously), but that's a little teaser. One paradigm I use a lot is when I need to change a variable name... this is very easy. While on the variable itself, press * to search forward for it. Then type cw to erase the word and type in the replacement, followed by ESCAPE (of course). From then on, you can use n to find the next occurrence and then type . to change the name, because . repeats the last command.Oh, and one last thing. Remap ESCAPE to CAPS LOCK, or get used to using C-[. Both are more convenient than reaching for the top corner; CAPS LOCK is superior in my experience, but it will kill you when you're on a non-mapped system.
Re:Eclipse to Textmate: An IDEological Change
by BrandonM on Friday June 20, 2008 @04:19PM
(#223174)
One more good link: http://www.viemu.com/a-why-vi-vim.html
Re:Eclipse to Textmate: An IDEological Change
by jamongkad on Friday June 20, 2008 @05:26AM
(#222600)
Hell yeah it's got cool features. Programmable macros for instance. You never have to repeat yourself every again. You could mark certain points in your code and come back to it later. Not too mention it's installed in almost every Linux Distro out there. For good documentation http://vim.wikia.com/wiki/Main_Page