Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

quick reference guide :help quickref

quickref Contents

tagsubjecttagsubject
Q_ctlist of help filesQ_reRepeating commands
Q_lrmotion: Left-rightQ_kmKey mapping
Q_udmotion: Up-downQ_abAbbreviations
Q_tmmotion: Text objectQ_opOptions
Q_pamotion: Pattern searchesQ_urUndo/Redo commands
Q_mamotion: MarksQ_etExternal commands
Q_vmmotion: VariousQ_qfQuickfix commands
Q_tamotion: Using tagsQ_vcVarious commands
Q_scScrollingQ_ceEx: Command-line editing
Q_ininsert: Inserting textQ_raEx: Ranges
Q_aiinsert: KeysQ_exEx: Special characters
Q_ssinsert: Special keysQ_stStarting Vim
Q_diinsert: DigraphsQ_edEditing a file
Q_siinsert: Special insertsQ_flUsing the argument list
Q_dechange: Deleting textQ_wqWriting and quitting
Q_cmchange: Copying and movingQ_acAutomatic commands
Q_chchange: Changing textQ_wiMulti-window commands
Q_cochange: ComplexQ_buBuffer list commands
Q_viVisual modeQ_sySyntax highlighting
Q_toText objectsQ_guGUI commands
Q_foFolding


N is used to indicate an optional count that can be given before the command.



Q_lr Left-right motions

Left-right motions
hNhleft (also: CTRL-H, <BS>, or <Left> key)
lNlright (also: <Space> or <Right> key)
00to first character in the line (also: <Home> key)
^^to first non-blank character in the line
$N$to the last character in the line (N-1 lines lower) (also: <End> key)
g0g0to first character in screen line (differs from “0” when lines wrap)
g^g^to first non-blank character in screen line (differs from “^” when lines wrap)
g$Ng$to last character in screen line (differs from “$” when lines wrap)
gmgmto middle of the screen line
gMgMto middle of the line
barN|to column N (default: 1)
fNf{char}to the Nth occurrence of {char} to the right
FNF{char}to the Nth occurrence of {char} to the left
tNt{char}till before the Nth occurrence of {char} to the right
TNT{char}till before the Nth occurrence of {char} to the left
;N;repeat the last “f”, “F”, “t”, or “T” N times
,N,repeat the last “f”, “F”, “t”, or “T” N times in opposite direction


Q_sc Scrolling

Scrolling
CTRL-ENCTRL-Ewindow N lines downwards (default: 1)
CTRL-DNCTRL-Dwindow N lines Downwards (default: 1/2 window)
CTRL-FNCTRL-Fwindow N pages Forwards (downwards)
CTRL-YNCTRL-Ywindow N lines upwards (default: 1)
CTRL-UNCTRL-Uwindow N lines Upwards (default: 1/2 window)
CTRL-BNCTRL-Bwindow N pages Backwards (upwards)
z<CR>z<CR> or ztredraw, current line at top of window
z.z. or zzredraw, current line at center of window
z-z- or zbredraw, current line at bottom of window
These only work when ‘wrap’ is off:
zhNzhscroll screen N characters to the right
zlNzlscroll screen N characters to the left
zHNzHscroll screen half a screenwidth to the right
zLNzLscroll screen half a screenwidth to the left


Q_wi Multi-window commands

Multi-window commands
CTRL-W_sCTRL-W s or :splitsplit window into two parts
:split_f:split {file}split window and edit {file} in one of them
:vsplit:vsplit {file}same, but split vertically
:vertical:vertical {cmd}make {cmd} split vertically
:sfind:sf[ind] {file}split window, find {file} in ‘path’ and edit it
:terminal:terminal {cmd}open a terminal window
CTRL-W_]CTRL-W ]split window and jump to tag under cursor
CTRL-W_fCTRL-W fsplit window and edit file name under the cursor
CTRL-W_^CTRL-W ^split window and edit alternate file
CTRL-W_nCTRL-W n or :newcreate new empty window
CTRL-W_qCTRL-W q or :q[uit]quit editing and close window
CTRL-W_cCTRL-W c or :clo[se]make buffer hidden and close window
CTRL-W_oCTRL-W o or :on[ly]make current window only one on the screen
CTRL-W_jCTRL-W jmove cursor to window below
CTRL-W_kCTRL-W kmove cursor to window above
CTRL-W_CTRL-WCTRL-W CTRL-Wmove cursor to window below (wrap)
CTRL-W_WCTRL-W Wmove cursor to window above (wrap)
CTRL-W_tCTRL-W tmove cursor to top window
CTRL-W_bCTRL-W bmove cursor to bottom window
CTRL-W_pCTRL-W pmove cursor to previous active window
CTRL-W_rCTRL-W rrotate windows downwards
CTRL-W_RCTRL-W Rrotate windows upwards
CTRL-W_xCTRL-W xexchange current window with next one
CTRL-W_=CTRL-W =make all windows equal height & width
CTRL-W_-CTRL-W -decrease current window height
CTRL-W_+CTRL-W +increase current window height
CTRL-W__CTRL-W _set current window height (default: very high)
CTRL-W_<CTRL-W <decrease current window width
CTRL-W_>CTRL-W >increase current window width
CTRL-W_barCTRL-W |set current window width (default: widest possible)