Vim Recipes
vim.runpaint.org
vim.runpaint.org
I don't mean to say you can't learn anything from this document, just that you could do a lot better with ':help tutorial' and maybe a googled cheatsheet. The tutorial really only takes half an hour, just like it promises.
I've found A Byte of VIM to be quite useful, though: http://www.swaroopch.com/notes/Vim
:w is mentioned as a footnote because :up is more sensible in the general case, as it preserves file timestamps and saves needless disk access, the latter being particularly useful when dealing with larger buffers or working over a slow link. If somebody wants a quick answer to the question, they can just look at the Solution. If they want to understand how saving works, and its how it relates to existing mental models they have of text editors, the Discussion elaborates.
This is in contrast to the "cheatsheet" approach, which does exactly what you suggest. It gives a single cryptic command, then moves on to the next example. This may be sufficient for you and I, but newer users would prefer a more cohesive explanation.
Oh, and the "Needless Comment Form" was added after multiple readers requested it. Apparently people find it easier than cloning the Git repository and submitting a patch. ;-)
:<area>!<command>
will export the <area> to <comand> and then replace <area> with the output of the <command>. So you can do:
:%!sort # Sort the entire file.
:.!awk '{ print $1 }' # Replace the current line with the first word/column.
So much power with this really simple set of commands. You can also highlight the an area using visual mode, and then just type ':!<command>' and it will autofill in the area for you.
>Select the text you want to convert, hit :, then enter the regex:
s/\<\(\w\)\(\w*\)\>/\u\1\L\2/g.
And, even this is not completely correct. The expression will not work if you select part of a line. Your best bet would be to remap the following: nnoremap <A-c> :s/\<\(\w\)\(\w*\)\>/\u\1\L\2/g<CR>
vnoremap <A-c> :s/\%V\(\w\)\(\w*\)\%V/\u\1\L\2/g<CR>
To get key bindings that you like (I've defaulted to the EMacs capitalize-word binding).http://rayninfo.co.uk/vimtips.html
I've found it quite an efficient editor with MacVim+Ruby and Jamis Buck's FuzzyFinder TextMate.
I was happy to see a nice visual explanation of undo branches. Something that I've known exists but never learned to use well.
No mention of inoremap, nnoremap, etc.
If you want to learn Vim well, do the following:
1. Ask "stupid" questions on #vim on freenode. Learn to use :help
2. Use :help
3. Ask the vim-use group any questions not obviously answered by :help
5. Never, ever use gvim. Forget about the mouse.
Evim--now there's a crime.
It's more than likely that I haven't achieved this balance in places, and if so I welcome help to clarify them.
Lastly, as I wrote on the index page of the site, this is still a draft. I published it so I could get feedback. :-)