Vim Tutor
Vim Tutor
By Anders Damsgaard Christensen, [email protected]. x Delete char. under cursor :set [no]number Enable/disable line numbering
This document is a summary of basic VIM commands, presented in dw Delete word
the VIM tutorial, vimtutor, version 1.7. d#w Delete # words 9 Help
d$ Delete to the end of line
1 Exiting VIM & file-/ system control dd Delete line (paste with p) :help [cmd] Display general help, or
display help on cmd
:w Write file CTRL-W CTRL-W Switch between windows
:w filename Save file as filename 5 Change command
:q Exit ce Delete from cursor until end of word, goto 10 LaTeX-suite
:wq or :x Save and exit insert mode
:q! Exit, discard changes c$ Delete from cursor until end of line, goto \ll Run LATEX-compiler
:!cmd Execute external command cmd in insert mode \lv Open document viewer
external shell :TTemplate Choose template
:r filename Insert contents of file named EFI Insert PS figure (i mode)
6 Undo CTRLj Next placeholder (i mode)
filename at cursor
u Undo single action F5 Insert environment
2 Modes U Undo all changes on a line F7 Insert command
CTRLr Redo F Font mode (e.g. Emph: FEM)
i Insert before the cursor S Section insertion (e.g. Section: SSE,
a Insert after the cursor 7 Search Subsec: SSS)
A Append at the end of line /string Search forward for string, browse
r Replace char. under cursor through matches forward with n,
R Replace mode backwards with N
v Visual selection (y: copy, p: paste) /string\c Search forward for string, ignore
CTRLg Display file status case
?string Search backwards for a string
3 Cursor movement % Find matching paranthesis
((...), [...] or {...})
0 Beginning of line :s/old/new Substitute next match of old
$ End of line string with new string
gg Beginning of file :#,#s/old/new Substitute all matches in line
G End of file range ## of old string with
:# Go to line no. # new string
e Go to end of next word :s/old/new/g Substitute all matches of old
b Go to beginning of previous word string with new string
o Open a line below the cursor, goto insert mode :s/old/new/gc Substitute next match of old
O Open a line above the cursor, goto insert mode string with new string, but ask
at each occurrence.