Vim Cheat Sheets
in ETC on Cheat, Sheets
Global
:h[elp] keyword : open help for keyword :sav file : save file as :clo : close current panel :ter : open a termianl window K : open man page for word under the cursor
Cursor Movement
h : move left j : move down k : move up l : move right
H : move to top of screen M : move to middle of screen L : move to bottom of screen
w : jump forwards to the start of a word
e : jumpe backwards to the start of a word b : jump backwards to the start of a word % : move to matching character
0 : jump to the start of a line $ : jump to the end of a line
gg : go to the first line of the documnet G : go to the last line of the document
Editing
u : undo Ctrol + r : redo . : repleat last command
Cut and Paste
yy : copy a line 2yy : copy 2 lines y$ : copy to end of line
p : paste the clipboard after cursor P : paste before the cursor
dd: delete a line 2dd : delete 2 lines x : delete character
Visual Mode
v : start visual mode, mark lins, then do a command o : move to other end of marked area Ctl + z : start visual block mode
Visual Commands
> : shift text right < : shift text left Y : copy marked text d : delete marked text ~ : switch case u : change marked text to lowercase U : change marked text to uppercase
Search and Replace
/pattern : search for pattern ?pattern : search backword for pattern :%s/old/new/g : replace all old with new through the file :%s/old/new/gc : replace with confirmation
More Featuers to Review
- Working with multiple liens
- Diff
- Marks (optional)
