A cheat list for vimperator, a vim plugin for firefox / thunderbird.
Basics commands in Vim
Sometimes, it's good to go back to the basics.
In command mode, typing
:help usr_02.txt (or simplier something like
:h usr_<TAB>02<TAB><ENTER>), you learn the letters for navigating a file:
- these letters are
HJKL- glad it works on an international keyboard.
- letters on the borders (
HL) are for horizontal movements- obviously
- letters on the inside are for vertical movements -
Kfor up; a nice feature is that these keys are now quite widely used in the community, take for example in the gmail interface when switching to the next message.
I was still using the arrows keys, but taking this habit makes thinks easier, especially when switching often keyboards.
Simalarly, to scroll the text - you can use:
<CTRL-U>to scroll a half-page up
<CTRL-D>to scroll a half-page down
:h ctrl-u page will give you more info (or
Note that to follow a link (think "searching a tag"), you can press * (or # to go backwards).
Using folds in Vim
Folds are useful when having long files to have a good perspective on its structure. Especially useful in LaTeX mode.
To install, I recommend using the
python-mode described in http://unlogic.co.uk/2013/02/08/vim-as-a-python-ide/
The magical shortcut all begin with
:hep fold to learn more about them.
These are the most common shortcuts in my personal order of preference.
zoopens a fold at the cursor.
zccloses a fold at the cursor.
zMcloses all open folds.
zOopens all folds at the cursor.
[zmove to start of open fold.
]zmove to end of open fold.
zjmoves the cursor to the next fold.
zkmoves the cursor to the previous fold.
zf#jcreates a fold from the cursor down # lines.
zf/stringcreates a fold from the cursor to string .
zmincreases the foldlevel by one.
zrdecreases the foldlevel by one.
zRdecreases the foldlevel to zero -- all folds will be open.
zddeletes the fold at the cursor.
zEdeletes all folds.