This repository was archived by the owner on Oct 7, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
vim
Anonymous edited this page Apr 22, 2016
·
9 revisions
write as sudo: `:w !sudo tee %`
Normal Mode
-----------
cw deletes to the end of current word and switch to insert mode
? Command-line mode for backward search
C is c$
s is cl
S is ^C
I is ^i
s deletes character under cursor and enter into insert mode.
; repeats last search f performs
, reverse direction of f search
n repeats pattern search
N reverses pattern search
:s/target/replacement
& repeat command
u reverse command
* executes a search for the word under the cursor
daw deletes a word, goes backwards
dap deletes a paragraph
g~ swap case
gu make lower case
gU make upper case
> shift right
< shift left
= auto indent
! Filter lines through an external program
Combine operators
gUaw upper case whole word
gUap upper case whole paragraph
Invoking operator twice acts on current line
gUU upper case current line
dd deletes current line
K looks up word under cursor in man page
J join lines
Insert mode
-----------
Ctrl-h delete back one character
Ctrl-w delete back one word
Ctrl-u delete back to start of line
Ctrl-[ switch to normal mode, like esc
Ctrl-o switch to insert normal mode
Ctrl-o zz from insert mode, trigger insert normal mode,
scroll current line to the middle of screen, and return to insert mode.
Useful Plugins
--------------
Commentary.vim plugin
textobj-entire plugin