- ciw and diw are pretty cool. you don't have to hop back to the word boundary, you can just delete or change the word. You get yiw too, etc etc.
#
and*
over a word will highlight all occurrences of that word and move backward and forward- t/T and f/F are for hop, basically, and t stops before, f stops on, the character.
C-r
is redo- Don't forget
o
andO
, which open a line above (below) - A gets you to the end of the line and into insert mode
- Remember to use your old friends
^
and$
and their additional buddy0
- the
%
character in normal mode lets you hop to a bracket's pair [m
and]m
take you to top and bottom of method.g;
andg,
jump to previous/next change (on change list)- The quickfix list is
:cl
and:cc
:cn
etc. Also there is the local list ll, which is like a buffer local quickfix list. CTRL-o
andCTRL-i
to walk the jump list (a list of where you've been in the buffer)gi
takes you to your last insert;gv
the last visual mode selection;gn
the last search match;gI
insert text at beginning of line- in Visual mode,
ip
andap
(alsoIp
andAp
) take yuou to the paragraph boundaries; you can also config function and class (it's textobj treesitter plugin) - Ranges also matter. Rangers can be:
- Line numbers
- The current line,
.
- The last line of the current buffer,
$
- The entire file,
%
- The last selection,
*
- Here are some cool registers:
- The unnamed register "
- The read-only registers
.
,%
,:
, las:e ~t insert, current filename, most recent command - Alternate buffer register
#
- Black hole register
_
- Last search pattern register
/
- you already know about
=
,system()
, etc. and+
and*
:&&
and:~
repeat the last sbustitute and redo the substitute with the last search (whew)&
in normal mode repeats last sub without its range and flags.g&
uses last search instead- Marks. Don't forget marks. Special marks:
'<
'>
\
[- Double-backslash move to position before the latest jump
- Move the position to where closed file last time
- ``^`
- Fuck. Digraphs with
CTRL+K
are a thing
Ctrl-a
Ctrl-@
spit last insert (latter form ejects from insert mode after)
Ctrl-o
in insert mode gives you oneshot of normal mode (nm 'o'neshot)
Ctrl-d
in insert mode changes line indentation, cruically you can be anywhere on th line
Ctrl-t
increases indentation
Ctrl-u
(delete everything 'u'ntil cursor)
Ctrl-w
(delete word under cursor)
Ctrl-h
(same as mashing that backspace)
Ctrl-r Ctrl-r
(double tap) is a verbatim mode useful for managing macros. A single Ctrl-R <reg>
doesn't do it
Ctrl-r Ctrl-p
does paste mode oneshot
gi
gI
gn