From d53b00208e32b2a0f20499b669af9f297fec6e94 Mon Sep 17 00:00:00 2001 From: RClaw Date: Thu, 12 Mar 2026 14:48:46 +0000 Subject: [PATCH] docs: expand Vim/Neovim navigation cheatsheet --- Cheatsheet/Vim.md | 73 +++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 61 insertions(+), 12 deletions(-) diff --git a/Cheatsheet/Vim.md b/Cheatsheet/Vim.md index af9249e..839b648 100644 --- a/Cheatsheet/Vim.md +++ b/Cheatsheet/Vim.md @@ -5,20 +5,69 @@ | : | command | | v | visual | | esc | exit to normal mode | + ## Navigation (Normal Mode) -| Command | Action | -| -------- | ------------------------------ | -| `w` | Jump to start of next word | -| `b` | Jump to start of previous word | -| `0` | Jump to start of line | -| `$` | Jump to end of line | -| `gg` | Go to first line of file | -| `G` | Go to last line of file | -| `:n` | Go to line `n` (e.g., `:42`) | -| `Ctrl+u` | Move up half a page | -| `Ctrl+d` | Move down half a page | -## File Operations (Command Mode) +| Command | Action | +| ------------- | ------------------------------------------- | +| `h j k l` | Left / down / up / right | +| `w` | Jump to start of next word | +| `b` | Jump to start of previous word | +| `e` | Jump to end of word | +| `0` | Jump to start of line | +| `^` | Jump to first non-blank character of line | +| `$` | Jump to end of line | +| `gg` | Go to first line of file | +| `G` | Go to last line of file | +| `{n}G` | Go to line n (e.g., `42G`) | +| `:n` | Go to line n (e.g., `:42`) | +| `Ctrl+u` | Move up half a page | +| `Ctrl+d` | Move down half a page | +| `Ctrl+b` | Move up full page | +| `Ctrl+f` | Move down full page | +| `zz` | Center current line on screen | +| `zt` | Scroll current line to top | +| `zb` | Scroll current line to bottom | + +## Jumping +| Command | Action | +| ----------- | ------------------------------------------- | +| `%` | Jump to matching bracket `()` `[]` `{}` | +| `*` | Search word under cursor (forward) | +| `#` | Search word under cursor (backward) | +| `''` | Jump back to last position | +| `Ctrl+o` | Jump back in jump list | +| `Ctrl+i` | Jump forward in jump list | + +## Search +| Command | Action | +| ------------ | --------------------------- | +| `/pattern` | Search forward | +| `?pattern` | Search backward | +| `n` | Next match | +| `N` | Previous match | +## Marks +| Command | Action | +| ------- | ------------------ | +| `ma` | Set mark `a` | +| `` `a ``| Jump to mark `a` | + +## Splits & Windows +| Command | Action | +| -------------- | ----------------------------- | +| `Ctrl+w s` | Horizontal split | +| `Ctrl+w v` | Vertical split | +| `Ctrl+w h/j/k/l` | Move between splits | +| `Ctrl+w q` | Close split | + +## Buffers +| Command | Action | +| ------- | ----------------- | +| `:bn` | Next buffer | +| `:bp` | Previous buffer | +| `:bd` | Delete buffer | + +## File Operations (Command Mode) | Command | Description | | ------- | ------------------------ | | `:q` | Quit |