Show Menu
Cheatography

VIM Cheat Sheet by

Mode

Control
esc
Insert
i
Append
a
Visual
v

View

show line numbers
:set nu
hide line numbers
:set nonu
show status
ctrl + g

Moving

start of file
gg
end of file
G
jump to next word
w
jump to line 12
:12
start of line
^
end of line
$
 

Edit

delete
x
copy line
yy
delete line
dd
new line
o
paste
p
copy selection ( frrom visual mode)
y
indent right
>
indent left
<

General

undo
u
redo
ctrl + r

Search & Replace

search
/pattern
forward occurence
n
backward occurence
N
find & replace
:%s/old/new/g
find & replace (need confirm)
:%s/old/new/gc
 

Exit

no write & quit
:q!
write & quit
:wq
save as file.txt
:w file.txt
open file2.txt (from file1.txt)
:e file1.txt

Shell

executing ls
:!ls -alt
pasting output ls
:r !ls -alt
count word
:!wc -c %
run python to current file
:!python %
open shell
:shell
set shell
:set shell=­/bi­n/bash

.vimrc

set clipboard=unnamedplus
use system's clipboard
set expandtab
convert tab to space
set shiftw­idth=4
shift = 4 spaces
set tabstop=4
tab = 4 spaces
set hlsearch
highlight search
set ignorecase
search ignore case
set smartcase
search sensitively
 

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

          AS PSYCHOLOGY , BASICS Cheat Sheet

          More Cheat Sheets by Tomcat