Cheatography
https://cheatography.com
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 |
< |
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=/bin/bash |
.vimrc
set clipboard=unnamedplus |
use system's clipboard |
set expandtab |
convert tab to space |
set shiftwidth=4 |
shift = 4 spaces |
set tabstop=4 |
tab = 4 spaces |
set hlsearch |
highlight search |
set ignorecase |
search ignore case |
set smartcase |
search sensitively |
|
Created By
Metadata
Comments
No comments yet. Add yours below!
Add a Comment
Related Cheat Sheets
More Cheat Sheets by Tomcat