Show Menu

VIM IDE Cheat Sheet by

vim IDE key mapping
ide     vim

Beginner Block

start insert
escape to normal mode
in normal mode, write to current file
in normal mode, quit the editor
Desc­ription in BOLD means overwrite default config­ura­tion
[ https:­//g­ith­ub.c­om­/Pi­pin­g/d­otfiles ] has my config­ura­tion

Notation: <l­e­a­de­­r>mm means ,mm
<C­-a> means Ctrl + A , <S­-x> means Shift + x
a/b means press keyboard either a or b

Motions: command that moves the cursor

search and move to next typed character
similar to f/F. but stop before character
start/end of current line
next start/end of word, W/E for word with punctu­nation
previous start of word B for word with punctu­ation
go to line {count}, default first line
go to line {count}, default last line
previo­us/next start of the line
cursor go to TOP/MI­DDL­E/B­OTTOM of the screen
(single quote twice) previous location in jumplist
previous marked position using m{a-z}, E.g. ma `a
To the position where the last change was made.
move to closing pair [], {}, ()
a number type before motions, repeat {count} motion
:help motion
check more on documents inside vim
Vim Concept: Motions - command that moves the cursor, depends on current cursor position. Above list is not complete! It can be used with OPERATOR to effici­ently editing text in Textual User Interf­ace

Operator - editing the text effici­ently

reverse case
filter with external program, E.g. format doc
make lower/­upper case
indent left/right
filter with predefined equalprg
fold the text
Two way to combine operator and select­ions:
1. <op­era­tor­><m­oti­on> or <op­era­tor­><t­ext­-ob­jec­t-m­oti­on> etc.
2. <se­lection from visual mode><­ope­rat­or>

Press one operator twice operate on current line as the select­ion
E.g. yy copy the current line, dd cut/delete the current line

Paste && Registers

paste using unnamed register " literally, after cursor
paste before cursor
paste 0 register's content in normal mode
double quote, insert text as if typed
the one before current copy/cut text
eval expression after = and paste
the last search pattern
equivalent to p in normal mode
:h i_ctrl-r
more registers
VIM Concept: Registers, used to store copy/cut text, the register can have single character names, {0-9a­-z"%­#*+­:.-=}.

p/P is used in normal mode, other Ctrl-­R{r­egi­ster} are used in insert mode and command line mode. (I reversed p/P since I feel p before cursor is more natural for modern IDE)

Page Movement

move buffer down/up and keep cursor position
bring current line and cursor to center
move current line and cursor to bottom screen
move current line and cursor to top screen
similar to J/K above, but cursor moves

Visual Mode Commands

switch between two ends of selection (anchor)
switch to visual block mode
switch to visual line mode
switch to visual mode
alignment, using plugin easy-­align

Windows (Split, Size Adjust­ment, Placement)

equal size display all panels
horizontal split
vertical split
put pane to absolute left, take full height
put pane to absolute right, take full height
put pane to absolute bottom, take full width
put pane to absolute top, take full width
:set splitright
for vertical split, place new pane right
move to relative left/d­own­/up­/right pane



Useful Utility Commands (Normal Mode)

dot command, repeat last change
Join the line below to current line,­ov­erw­rite, <­lea­der­>j
add {count} to number under cusor
subtract {count} to number under cusor
repeat last cmdline command, <le­ade­r>:
calculator <C-­R>=­128/2, insert mode
dot command . does not repeat command line commands, only changes that is defined by vim. E.g. invoked by operator c and followup inserted text.

CSCOPE MAPPING (My Config­ura­tion)

:cs add <path to cscope.ou­t> <path to worksa­pce>
search the C symbol under cursor
search global defintion
search funtions called by this function
search who called this function
search this string
search this egrep pattern
search for files include the filename under cursor
search for files include the current file

Insert Mode (My config­ura­tion)

Jump to the beginning of the line
Jump to the end of the line
Backwa­rd-­Delete Word
Forwar­d-D­elete Word
backward move cursor one word
forward move cursor one word
delete/cut current line
paste/yank to current line
delete the rest line after cursor

Normal Commands (My Config­ura­tion)

equivalent to %, go to pairs
format and intent the file E.g. clang-­format
go to end of line
open file browser panel
open ctags symbol list panel
Disable highlights when you press
use fzf to fuzzy search recuently used files
close current window
save the file
open the undotree
Distra­cti­on-Free Display

Command Mode :

{range}, equal to 1,$ (the entire file)
:! <ex­ternal cmd>
range of text is being pipe to cmd to be replaced
:%! xxd
edit binary file
:%! xxd -r
save the file into binary form

fuzzy-­sea­rch­-panel (My config­ura­tion)

select all
deselect all
select­-de­select current line
open file in new tab
split horizo­ntaly
split vertically

Special and Very Useful Windows -- Quickfix

open/close Quickfix
go to next fix
go to previous fix
Quickfix typically used after :make command and cscope, the quickfix window contains the parsed result from :make that contains where compli­cation error happen, and put cursor to exactly the file/l­ine­/column so user can just fix it!
I open quick fix with my shortcut and prefix a :botright copen to open it at the bottom of window

Commentary ( External Plugin Default)

commen­t/u­nco­mment current line
comment next 10 lines
comment block
comment the paragrah
comment selection (visual mode)

Code Folding



go to next tab
go to previous tab,­<le­ade­r>tt
new tab, <­lea­der­>t
close current tab, <­lea­der­>tc

Download the VIM IDE Cheat Sheet

3 Pages

PDF (recommended)

Alternative Downloads

Share This Cheat Sheet!



No comments yet. Add yours below!

Add a Comment

Your Comment

Please enter your name.

    Please enter your email address

      Please enter your Comment.

          Related Cheat Sheets

          Sublime Text 2 Windows Keyboard Shortcuts
          Vim NERDTree Cheat Sheet