Notes from this youtube video by Henry Misc.
- exit:
ZZandZQ - select braces and parens:
vibselect inside parens,viBselect inside braces. Alsovafor around, which includes the delimiters.- These are easier to type than
vi(andvi{, which both require the shift key and a key distant from the home position. Square brackets don't require shift, sovi[is fine for that, so they don't need their version of this. - A more complete list:
i<i'i"i[i(=ibi{=iB, anda...for around.
- These are easier to type than
- wrap in e.g.
<li>...</li>:- One method is
:s: viz:s@.*@<li>&</li> - Select with
C-vand then insert withI. alsoAfor append.
- One method is
- toggle case:
~for char;g~worg~ib - format file:
gg=G(=formats selection) - jumping with %:
%jumps between e.g. braces or parens or brackets - storing session:
:mksession filename.vimgives a.vimscript that, when sourced, reloads the session - open URL in browser:
gxwhich on Linux basically passes what's under the cursor toxdg-open - mark and jump:
mato mark and then'ato jump back to where the mark was set.mb,mcso you have a mark for each letter. - jump to line:
:40, but there is a quicker way:40G. - join lines:
J, orgJ. The former joins with a space, the latter joins without a space.