Best of Vim Tips
rayninfo.co.uk
rayninfo.co.uk
[1]: http://python.net/~goodger/projects/pycon/2007/idiomatic/han...
Most of the web resources I've learnt from have been verbose and gradually introduced new ideas (i.e. the advanced bash scripting guide, or any of Steve's rants).
I've been hooked on OP for it's terseness and challenging obscurity; which I guess suits the subject matter.
If you are an experienced Vim user, this might be a handy cheat sheet. If you're new to Vim, go look somewhere else.
Vimcasts: http://vimcasts.org/ (And keep your eye out for Drew's forthcoming book: Practical Vim.)
Vim University: http://vimuniversity.com/
Coming Home To Vim: http://stevelosh.com/blog/2010/09/coming-home-to-vim/
Efficient Editing With Vim: http://robertames.com/files/vim-editing.html
Why, oh WHY, do those #?@! nutheads use vi?: http://www.viemu.com/a-why-vi-vim.html
Your problem with Vim is that you don't grok vi: http://stackoverflow.com/a/1220118/26702
Vim anti-patterns: http://blog.sanctum.geek.nz/tag/anti-patterns/
This is also useful:
http://www.viemu.com/a_vi_vim_graphical_cheat_sheet_tutorial...
And when you're done with those, come to #vim on freenode. You can learn a hell of a lot about vim by just idling there. Of course, you'll learn even faster by asking questions.
Anyone want to take it up?
/\<\d\d\d\d\> : Search for exactly 4 digit numbers
/\D\d\d\d\d\D : Search for exactly 4 digit numbers
/\<\d\{4}\> : same thing
The middle one is not the same as the other two since \D has to match something unlike the zero-width assertions of \< and \> for beginning and end of word.http://www.viemu.com/a_vi_vim_graphical_cheat_sheet_tutorial...
* Bold fonts everywhere without enough vertical space: bold is for important stuff, not for copy text and the lack of vertical spacing makes the whole thing hard to parse.
* Keychars centered vertically instead of placed on a common baseline.
* Meanings of keys centered horizontally: considered very hard to read since forever.
* No explanation for `WORD`: is it for uppercase words? (yes, I know the answer)
* Instead of being logically grouped, the commands and motions are tied to the spatial location of their key: the logic and grammar behind most of Vim is hidden in profit of an opaque, maximalist and almost unreadable mess.
* Focus is put on raw memory instead of intelligence and acquiring instant exhaustive knowledge instead of learning naturally.
* QWERTY is only one of many keyboard layout standards: a lot of the keys represented here are located elsewhere in french AZERTY or other layouts. This has one important consequence: the physical location of the keys bound to each command/motion is not linked at all to the name of the command or its mnemonic or to anything relevant. Because `A` can be anywhere, learning the physical location of "Append at eol" on this specific keyboard layout or on any other makes no sense at all.
But we obviously don't all learn the same way.
I don't mean to single you out. It's just that I find it really frustrating when people state their views as objective fact (and I'm often guilty of this too as I can be very opinionated, but I try to avoid it when I notice), so the above is just my request for us to isolate actual objective fact from opinion and to discuss our opinions using constructive language instead of destructive language. "I don't actually like that because of reasons x, y, and z" does a lot more to foster an exchange of ideas and possibly change someone's view than "Your idea is horrible. Here's why... ."
As for the actual cheat sheet, I don't know much about typesetting, but I think the author put the meanings of the keys to the right of the key symbols to make room for the section below the keyboard. Since I use a QWERTY layout, I have no need to scan the key symbols, so this horizontal arrangement of key symbols and then meanings doesn't hinder my ability to visually scan the image for content. I can imagine you're right that this cheat sheet is of less use to non-QWERTY users, but that isn't applicable to me.
What's great about this cheat sheet is its division of commands that can be combined with motions and text objects (it calls these commands "operators") and those that don't, also indicating which ones change the mode from normal to insert and which ones don't. It doesn't have an explanation for "WORD" because this isn't a tutorial. This is a cheat sheet. It's great for people who've already taken a tutorial on Vim and are working on developing the muscle memory needed to use Vim proficiently. One quick glance and you now know it was `w' and `W' that went forward a word, and either you remember how each defined word or you look it up in Vim's help. But you know what to look up now. You don't have to leaf through hundreds of lines of text in a tutorial. You look at this cheat sheet for 10 seconds and you realize your tutorial never taught you f and t. You look them up and you're now 10% more efficient with Vim.
This cheat sheet shines in its use as a reference (as a "cheat sheet") for refreshing your memory on things that you learned just slightly too long ago to recall easily, and it's also great for filling in the gaps and making sure you learned most of the important Vim keybindings. The cheat sheet doesn't go into text objects, but the same author addresses them here <http://www.viemu.com/a-why-vi-vim.html>.
Just like this sed one liners: http://www.eng.cam.ac.uk/help/tpl/unix/sed.html
d/fred/ :delete until fred
y/fred/ :yank until fred
c/fred/e : change untill fred
I actually prefer this over ctf, dtf as it scales better