💾 Archived View for tilde.club › ~filip › tech › cheatsheet › vim.gmi captured on 2022-07-16 at 13:45:52. Gemini links have been rewritten to link to archived content
-=-=-=-=-=-=-
Vim built-in help: `:help`.
Below is a small subsection of avaliable commands and options.
h - left j - down k - up l - right
w/W - forward to the beginning of word/WORD b/B - backward to the beginning of word/WORD e/E - forward to the end of word/WORD ge/gE - backward to the end of word/WORD
) - jump forward to sentence ( - jump backward to sentence
{ - jump backward to the start of the paragraph (i.e. blank line) } - jump forward to the start of the paragraph (i.e. blank line)
0 - go to the start of the current line ^ - go to the first non-blank character of the current line g_ - go to the last non-blank character of the current line $ - go to the end of the current line
H – go to the first line of current screen M – go to the middle line of current screen L – go to the last line of current screen <C-f> – jump forward one full screen <C-d> – jump forward half screen <C-u> – jump back half screen <C-b> – jump backward one full screen
gg - jump to the first line G - jump to the last line % - jump to matching parentheses, brace, or bracket '' - jump to the line where the cursor was before the last jump
f - jump to character t - jump to behind character F - jump backward to character T - jump backward to in front of character ; - jump forward through results , - jump backward through results
c - change d - delete y - yank ~ - swap case (only if 'tildeop' is set) g~ - swap case gu - make lowercase gU - make uppercase ! - filter through an external program = - filter through 'equalprg' or C-indenting if empty gq - text formatting gw - text formatting with no cursor movement g? - ROT13 encoding > - shift right < - shift left zf - define a fold g@ - call function set with the 'operatorfunc' option
aw - a word (with white spaces) aW - a WORD (with white spaces) as - a sentence (with white space) ap - a paragraph (with white space) at - a tag block (with white space) a" - double quoted string a' - single quoted string a` - sting in backticks ab = a( = a) - from ( to ) aB = a{ = a} - from { to matching } a<, a> - from < to matching > a[, a] - from [ to matching ] iw - inner word iW - inner WORD is - inner sentence ip - inner paragraph it - inner tag block i" - double quoted string without quotes i' - single quoted string without quotes i` - sting in backticks without backticks ib = i( = i) - inner block from ( to matching ) iB = i{ = a} - inner block from { to matching } i<, i> - inner block from < to matching > i[, a] - inner block from [ to matching ]
/ - search forward ? - search backward
zf{motion} - create a fold za - toggle fold open/close zo - open fold zO - open folds recursively zc - close fold zC - close folds recursively
<C-w> r - rotate splits in the same row <C-w> J - extend the split horizontally to window edges <C-w> H - extend the split vertically to window edges
gg - go to the first line G - go to the last line gi - last insert gv - last visual selection gf - open the path string the cursor is currently on
Shift+j - append the next line to the end of the current line <C-^> - jump to the last file Crtl+o - jump backward in history <C-i> = jump forward in history
:set spell - turn on spell checking :set nospell - turn off spell checking ]s - jump to the next misspelled word [s - jump to the previous misspelled word z= - bring up the suggested replacements zg - add the word under the cursor to the dictionary zw - undo and remove the word from the dictionary
<C-x> <C-l> - whole lines <C-x> <C-n> - keywords in the current file <C-x> <C-k> - keywords in 'dictionary' <C-x> <C-t> - keywords in 'thesaurus', thesaurus-style <C-x> <C-i> - keywords in the current and included files <C-x> <C-]> - tags <C-x> <C-f> - file names <C-x> <C-d> - definitions or macros <C-x> <C-v> - vim command-line <C-x> <C-u> - user defined completion <C-x> <C-o> - omni completion <C-x> s - spelling suggestions <C-n> - next keyword in 'complete' <C-p> - previous keyword in 'complete' <C-y> - accept the suggestion <C-e> - cancel autocomplete
<C-c> - return to NORMAL mode <C-o> - run a NORMAL mode command while in INSERT fold D - delete to end of line C - delete to the end of line and enter INSERT mode x - delete character s - delete character and enter INSERT mode