u
/U
for visual modegu
/gU
for normal mode~
switches capitalization,g~
does the same on a motion.
"=
is the expression register, it eats vimscript expressions
mx
sets a mark at cursor, per buffermX
sets a mark at cursor, globally'x
(resp.'X
) jumps to thex
/X
mark
o
moves to the "other end" of the selection (for rectangular blocks, it's the opposite corner)
gq
formats the selected lines, usingtextwidth
q/
opens an interactive search history:<C-f>
opens an interactive command-line history; also throughq:
, but we reserved that for the fzf version of cli history.
- Spelling:
zg
good,zw
bad;zug
andzuw
undo. zt
,zb
,zz
to move view maintaining cursor;- Folds, tl;dr:
za
to toggle fold(zA
recursively),zc
to close it(zC
recursively),zO
to open folds recursively(zo
),zd
to delete a fold(zD
recursively),zf
to create folds with movements,zE
to eliminate folds entirely;z[j-k]
are for navigating around folds. - To save folds on exit:
:mkview
earlier
commandge
andgE
aree
andE
but going backwardsgv
goes to the last selectiongq
is the basic comand to format lines:scriptnames
lists the loaded scripts (i.e. plugins):verbose COMMAND is useful to debug stuff
set list
shows unprintable characters
- Using
foldmethod=marker
, one can write{{{1
in a comment to open a fold (no need to close it, but you can with}}}1
)
:au!
ctrl-x_ctrl-O
starts omni completion (amazing)
- install
ctags
!ctags -R .
(i.e. prependcommand! MakeTags
and map it)
- ^] jump to tag under cursor
- g^] for ambiguous tags
- ^t jumps back up the tag stack
- ^x^n for JUST this file
- ^x^f for filenames
- ^x^] for TAGS
- ^n for anything
- See
:help modelines
. (things likevim:set et sw=4 ts=4 tw=180:
)
1,$s/\t/ /g