-
:!{commands}
: run unix commands -
zf%
: fold current code block -
zc
: close fold -
zo
: open fold -
cit
: change inside the tag -
cs"'
: change surrounding double quotes to single quotes -
ds"
: remove surrounding delimiters -
ysiw]
: wrap[]
around the current word -
yss)
: wrap()
around the sentence -
m{a-zA-Z}
: mark the current cursor location with the designated letter -
`
{mark}
: moves the cursor back to where a mark was set -
%
: jump between parentheses -
zg
: learn spelling -
zw
: mark as misspelled -
z=
: fix spelling -
ctrl-w, r
: rotates window -
ctrl-w, x
: swap window with the next one -
:source $MYVIMRC
: load the new configuration into Vim session. If thevimrc
file is the active buffer, then it can be shortened to:source %
.
To replace all foo
with bar
within the current buffer
:%s/foo/bar/g
To search in the working directory:
:Ack foo
Or, search in the specified path:
:Ack foo /path/to/dir
Now, the quickfix window shows up with every result found. Delete the undesired result by typing dd
.
To replace every result still present in the quickfix window:
:Acks /foo/bar/