vim
insert
:help
repeat
.
repeat last command
n
repeat / or ? forward (search)
N
repeat / or ? backward(search)
&
:s
repeat last substitute
motion.text
nav
delete
d
select
Vi{
select in bracket
m(char)
mark to char
'(char)
go to char
'.
go to last edit
'"
go to last cursor pos
z(folding)
textobject
ciw
change in word
caw
change in word greedy
ci{ [ci}]
change in bracket
ctM
change 'till 'M'
==
fix indentation
search
cursor
screens
windows
ctrl+w
w
tumble through windows
v
split vertically
s
split horizontally
tabs
gt
next
gT
prev
#gt
tab number
completion
ctrl + p (or ctrl + n)
pathing
%
install
Mac
terminal
brew install macvim --override-system-vim
:
ls
list all files in buffer
ctrl + ^
switch active buffer
:buffer n
switch to buffer by number
:bn
buffer next
:bp
buffer prev
regexp
:%s/oldstuff/newstuff/gci
simple global find and replace(confirm/caseinsensitive[i]casesensitive[I])
!
gr[ep] -rin -A 2 "pattern" .
search for text pattern(plus 2 lines) in all files at current pwd
ack "pattern" *
search for text in current directory
binary
:set binary
:set display=uhex
:%!xxd
-r
(revert?)
Tab/
=(char)
(Tabularize)align to char
(char)\zs
align to char(after char)
:Git
:Gstatus
-
stage file
:Gcommit
push origin master
macro
begin rec
....
stop
q
@q
access macro