Show Menu
Cheatography

vim mappings Cheat Sheet by

Vim mappings for https://github.com/frazrepo/vimrc

General

<le­ade­r>
space
<le­ade­r>w
Save buffer
<le­ade­r><­lea­der>
noh
<le­ade­r>cd
cd to buffer dir
jk
ESC
:W
Write as sudo (linux)
{to-m}
Text Object or Motion

Windows

<C-­h>
Navigate left
<C-­l>
Navigate right

Buffers

<le­ade­r>bn
New buffer
<le­ade­r>bd
Close current buffer
<le­ade­r>ba
Close all buffers
<ba­cks­pac­e>
Go to alternate buffer
<le­ade­r>x
Scratch txt buffer
<le­ade­r>s
Scratch sql buffer
<le­ade­r>d
Scratch markdown buffer
<le­ade­r>bs
Scratch buffer
<le­ade­r>h
Previous buffer
<le­ade­r>l
Next buffer

Tabs

<le­ade­r>tn
New tab
<le­ade­r>te
New Tab (current buffer dir)
<le­ade­r>to
TabOnly
<le­ade­r>tc
Close Tab
<le­ade­r><­bs>
Go to alternate Tab

Miscel­laneous

F3
Neoformat
F4
Undotr­eeT­oggle
F8
Toggle QuickFix Window
F9
Toggle CtrlSF Window
F10
Rotate ColorS­chemes
F11
Toogle TagBar
F12
Tag navigation
<M-­0>
Set font bigger
<M-­9>
Set font smaller

Commands

:Rainb­owT­oggle
Toggle rainbow colors
:Visua­lBlock
Enter visual mode (xterm)
:ListL­eaders
List all leader mappings
Remove­Tra­ili­ngS­paces
Remove spaces
:{Rang­e}S­ort­ByWidth
Sort lines by witdh
:h fztips
Custom tips
:h fzvimtips
Aonther tips collection
 

Editing - Normal mode

"p
Like vi"p
'p
Like vi'p
(p
Like vi(p
<le­ade­r>p
Paste from 0 register
g=
Equalize entire buffer
gQ
Format entire buffer
<le­ade­r>m
Remove bad formatting ^M

Editing - Visual Mode

*
Search Visual Selection
#
Reverse Search Visual Selection
<le­ade­r>r
Search and Replace Selection
<le­ade­r>fr
Find Replace Visually

Searching

/
/\v magic search
?
?\v magic search
<le­ade­r>*
Search current word with Ctrlsf
<le­ade­r>/
Search in files with Ctrlsf
<le­ade­r>f
Search buffer using Ilist
ym
Yank search matches
YM
Yank reverse search matches
dm
Delete search matches
DM
Delete reverse search matches
c*
Change current word and . for next
 

Emmet Plugin

,,
Generate html block (2 commas)

vim-lion

gl{to-m}=
Right align with =
gL{to-m}
left align with =

vim-ab­olish

Subvert
Search Command
cr{case}
Coercion, change case

vim-ex­change

cx{to-m}
Works in pair
cxx
Exchange line
X
Visual mode

vim-op­era­tor­-re­place

{"re­g}g­r{to-m}
Replace

vim-sa­ndwitch (surround)

cs"', css
Change surround " to '
cstt
Change tag surrou­nding
ys{to-­m}"
Add surround "
ds", dss
Delete surround "
S"
Visual mode surround
yss"
Surround line

Transpose

Tranpose
simple
Tranpo­seCSV
csv
Tranpo­seWords
word

vim-so­rt-­motion

gs{to-m}
Sort

vim-gu­tentags

<C-­$> or F12
Tag navigation

Custom text objects

q
Quote (ciq)
c, C
Column (vic, viC, vac, vaC)
i
Indent (cii)
l
Line (cil)
e
Entitre (cie)
Targets
cin(, ci=, ci+, ci_, ...

vim-un­imp­aired

( and )
map keys
(*
Previous * =t, b,...
)*
Next * = t,b,..
(e or )e
Exhange lines
(space
Insert blank line
yo*
Toggle options * = n,r,w,x, ...

Miscel­laneous

<C-­p>
Fuzzy Files
<le­ade­r>,
Fuzy Buffers
<le­ade­r>u
Fuzzy MRU
<le­ade­r>t
Fuzzy Tags
<le­ade­r>;
Fuzy Lines
<le­ade­r>co
Fuzzy Commands
Arrow keys
Move visual selection
 

Comments

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

          VI Editor Cheat Sheet
          Vim NERDTree Cheat Sheet
          Helix Keyboard Shortcuts

          More Cheat Sheets by fraz

          Vim Muscle Memory Cheat Sheet