6. Operators
c change
d delete
y yank to register
gu make lowercase
gU make uppercase
d delete a symbol
D delete a line
* search by the word you're on
7. Left-Rigth motions
w next word including punctuation
W next word no punctuation
b beginning of word including punctuation
B beginning of word no punctuation
e end of word including punctuation
E end of word no punctuation
$ or g_ last char on line
h to the left on one symbol
l to the right on one symbol
^ or 0 - to the line start
f find
F previous find
t till
T previous till
; repeat latest f,t
, repeat latest f,t in opposite order
8. Up-Down motions
j,k - one line moving
gg - first line
G - last line
H - top of screen
M - middle of screen
L - bottom of screen
zz - current line to middle
zt - current line to top
zb - current line to bottom
zl - scroll to right
zh - scroll to left
ctrl + u or ctrl +d - scroll half page up and down
ctrl +b or ctrl + f - scroll page up and down
9. diw delete inner word
daw delete a word
diW delete inner WORD
daW delete a WORD
dd delete one line
dis delete inner sentence
das delete a sentence
dib delete inner '(' ')' block
dab delete a '(' ')' block
dip delete inner paragraph
dap delete a paragraph
diB delete inner '{' '}' block
daB delete a '{' '}' block
Text-Object operations
10. zi switch folding on or off
zv expand folds to reveal cursor
zj move down to top of next fold
zk move up to bottom of previous fold
zo open current fold
zO recursively open current fold
zc close current fold
zC recursively close current fold
za toggle current fold
zA recursively open/close current fold
zm reduce `foldlevel` by one
zM close all folds
zr increase `foldlevel` by one
zR open all folds
Folding
11. << or >> moves one line in normal mode
5(>>,<<) moves 5 line in normal mode
>> or << moves selected lines in visual mode
gv(<,>) reselects last visual selections and move
Identing
12. ctrl + n - autocomplete all over
ctrl + p - autocomplete from pervious matches in this file
It could be sophisticated using CTAG...
Autocompletion
13. ctrl + r in insert mode to start using registers
" the default register
% the current file name
# the alternate file name
* the clipboard contents (X11: primary selection)
+ the clipboard contents
/ the last search pattern
: the last command-line
. the last inserted text
- the last small (less than a line) delete
Registers
14. :ls show the buffer list
:bn open the next buffer in the current window
:bp open the previous buffer in the current window
:b1 select buffer #1
Buffers
15. ctrl + ww switch windows in cycle
ctrl + w(l,h,j,k) switch to window right/left/down/up
ctrl + w5(-,+) makes window on 5 strings more|less
in horizontal split
ctrl + w5(>,<) makes window on 5 strings more|less
in vertical split
ctrl + wr change layout of windows
ctrl + w + (L,H) change layouts in horizontal
ctrl-w+| maximize current window
ctrl-w= make all equal size
:hide close current window
:only keep only this window open
set winwidth=80 set defaults minwidth for active window
Windows
16. :tabnew - open file/dir in a new tab
:tabf - search for file in open dir and open in a tab
gt -next, gT -previous - navigating through tabs
ctrl + wT - window to tab
Tabs
17. :e. at current working directory
:sp. in split at current working directory
:vs. in vertical split at current working directory
:E at directory of current file
:Se in split at directory of current file
:Vex in vertical split at directory of current file
File browsing in netrw: step 1
18. - up one directory
d Make a directory
D Attempt to remove the file/dir
gh Quick hide/unhide of dot-files
i Cycle between thin, long, wide, and tree listings
ctrl+l refresh the directory listing
o open file/dir under the cursor in a new split
R Rename the designed file/dir
t open file/dir under the cursor in a new tab
v open file/dir under the cursor in a new vsplit
% Open a new file in netrw's current directory
File browsing in netrw: step 2