Vim base keybindings

I inspired by ThePirmeagen video 1 to create this note, this cover small subset of Neovim keybindings.

1. Movement/editing/writing Hotkeys:

h word-motions:

h: move left ← (shot arrow left) j: move down ↓ (shot arrow down) k: move up ↑ (shot arrow up) l: move right β†’ (shot arrow right)

All jumps support motions: d[ia], c[ia], y[ia], v[ia]!

): jump by sentence forward, next bed πŸ›οΈ (top/in) (: jump by sentence backward, previous bed πŸ›οΈ (top/in)

}: jump by paragraphs (downward), next house level roof 𓉩 {: jump by paragraphs (upward), previous house level roof 𓉩

]]: jump by section (downward), next house roof 🏘️ [[: jump by section (upward), previous house roof 🏘️

w/W: jump by start of words, next snake head 🐍 b/B: jump backward by words, previous snake head 🐍

e/E: jump to end of words, next peacock tail 🦚 ge/gE: jump backward to end of words (reverse e), previous peacock tail 🦚

=motion: filter (equalprog) / indent text, filter text 🧹

gi: jump to last insert position, last time writing place πŸ“š

gv: re-select last visual selection πŸ–οΈ

gw: format lines to text width, format lines to text width (cursor stay) πŸ“ gq: format lines to text width, format lines to text width (cursor reset) πŸ“

0: start of line, start of the track with reserve πŸ›£οΈ

^: first non-blank character of line, start of the track πŸ›£οΈ

_: first non-blank character of line, in motions linewise, whole line

$: end of line, finish line 🏁

G: End (prefix with number), basement ⬇

i: start insert mode at cursor, put a stamp before βœ”οΈ

a: append after the cursor, put a stamp after βœ”οΈ I: insert at the beginning of the line, put a stamp on left document side (after padding) [| ] A: append at the end of the line, put a stamp on right document side (after padding) [ ]|

o: open (append) blank line below current line, add a new empty line below current line πŸ“ O: open blank line above current line, add a new line above current line πŸ“

e a: append at end of word, add char after peacock tail 🦚

r: replace a single character (does not use insert mode), toggle a single character πŸ”„

J: join line below to the current one, remove bed legs πŸ›οΈ

cc: change (replace) an entire line, replace bed mattress πŸ›οΈ

cw: change (replace) to the end of word, cut peacock until tail 🦚

c$: change (replace) to the end of line, cut until finish line 🏁

ss*: delete character at cursor and substitute text, originally used s, remove stamp and put a new one βœ”οΈ

S: delete line at cursor (except leading whitespace) and substitute text (same as cc), cut whole line and place a new one πŸ“

yy: yank (copy) a line 2yy: yank 2 lines

yw: yank word, yank until peacock tail 🦚

y$: yank to end of line, yank until finish line 🏁

p: put (paste) the clipboard after cursor, put a stamp after βœ”οΈ

p: put (paste) before cursor, put a stamp before βœ”οΈ

dd: delete (cut) a line, all charactres including new line

dw: delete (cut) the current word, delete until peacock tail 🦚

x: delete (cut) current character, remove a stamp βœ”οΈ

:w: write (save) the file, but don’t exit, πŸ’Ύ

:wq: write (save) and quit, πŸ’Ύ and πŸšͺ

:q: quit (fails if anything has changed), quit, but check all stuff πŸšͺ

:q!: quit and throw away changes, quit and throw away all stuff πŸšͺ

~: case toggle (also useful gU...), grow a beard πŸ§”

2. File/window hotkeys:

%: find matching bracket (or other items, you can also combine va%), find matching bracket 🧲

f: search forward for character, search ? forward πŸ”

F: search backward for character, search ? backward πŸ”Ž

t: search forward for space before character, search _? forward πŸ”

T: search backward for space after character (reverse of t), search ?_ backward πŸ”Ž

/pattern: search for pattern, search forward (left-right each line) πŸ”

?pattern: search backward for pattern, search backward (right-left each line) πŸ”Ž

n: repeat search in same direction, search again πŸ”

N: repeat search in opposite direction, search again πŸ”Ž

:e filename: Edit a file in a new buffer, create a new file πŸ“

:bnext (or :bn): go to next buffer, next page β†’ πŸ“„

:bprev (of :bp): go to previous buffer, previous page ← πŸ“„

:bd: delete a buffer (close a file), cut a page βœ‚οΈ πŸ“„

:sp filename: Open a file in a new buffer and split window, cut a page in half βœ‚οΈ πŸ“„

:Ex: Open file explorer, open file explorer πŸ“‚

ctrl+wv: Split windows vertically, cut a page in half vertically βœ‚οΈ πŸ“„

ctrl+ws: Split windows, cut a page in half βœ‚οΈ πŸ“„

ctrl+ww: switch between windows, switch between pages πŸ“„ πŸ”„ πŸ“„

ctrl+wq: Quit a window, cut a part of page or whole page βœ‚οΈ πŸ“„

c-w+hjkl
πŸ“„ Move to window in direction, move to page in direction πŸ“„ πŸ”„ πŸ“„ πŸ“„

C-w o: Close other windows, cut other pages βœ‚οΈ πŸ“„

References

Footnotes

  1. Two Simple Steps to go from IDE to Vim - YouTube ↩