| Action | Command |
|---|---|
| Left | h |
| Down | j |
| Up | k |
| Right | l |
| Start of line | 0 |
| First non-blank of line | ^ |
| End of line | $ |
| Column N | |N |
| Middle of screen line | gm |
| Top of file | gg |
| Bottom of file | G |
| Top of screen | H |
| Middle of screen | M |
| Bottom of screen | L |
| Action | Command |
|---|---|
| Move to next word | w |
| Move to end of word | e |
| Move to previous word | b |
| Move to next WORD (whitespace-delimited) | W |
| Move to end of WORD | E |
| Move to previous WORD | B |
| Action | Command |
|---|---|
| Next sentence | ) |
| Previous sentence | ( |
| Next paragraph | } |
| Previous paragraph | { |
| Action | Command |
|---|---|
| Search forward | /pattern |
| Search backward | ?pattern |
| Repeat forward | n |
| Repeat backward | N |
| Find char forward | f |
| Till char forward | t |
| Find char backward | F |
| Till char backward | T |
| Repeat last find | ; |
| Repeat opposite dir | , |
| Delete lines by matching | :g/http/d |
| Delete all do not match | :v/http/d |
Text objects do not move the cursor on their own—you must combine them with an operator (
d,c,y,>,<, etc.)
| Object | Inner (i…) |
Around (a…) |
|---|---|---|
| word | iw | aw |
| WORD (big-word) | iW | aW |
| sentence | is | as |
| paragraph | ip | ap |
| block (any B) | iB or ib | aB or ab |
parentheses ( ) |
i( or i) | a( or a) |
brackets [ ] |
i[ or i] | a[ or a] |
braces { } |
i{ or i} | a{ or a} |
| single-quotes | i' | a' |
| double-quotes | i" | a" |
| Operator | Description |
|---|---|
| d{motion} | Delete up to motion |
| c{motion} | Change (delete + enter Insert mode) |
| y{motion} | Yank (copy) up to motion |
| >{motion} | Indent selection |
| <{motion} | Un-indent selection |
| g~{motion} | Swap case |
| gu{motion} | Make lowercase |
| gU{motion} | Make uppercase |
| Example | Effect |
|---|---|
| daw | delete a word (including surrounding space) |
| diw | delete inner word (just the word) |
| ciw | change inner word → enter Insert mode |
| yaw | yank a word (including any trailing space) |
| yip | yank inner paragraph |
| >ap | indent around paragraph |
| Action | Command |
|---|---|
| Set mark | m |
| Jump to mark (line) | ' |
| Jump to mark (exact position) | ` |
| Jumplist back | Ctrl-O |
| Jumplist forward | Ctrl-I |
| Jump to matching parenthesis/bracket/brace | % |
| Search word under cursor forward | * |
| Search word under cursor backward | # |
| Partial-word search forward | g* |
| Partial-word search backward | g# |
| Jump through change-list (newer changes) | g; |
| Jump through change-list (older changes) | g, |
| Increment number under cursor | Ctrl-a |
| Decrement number under cursor | Ctrl-x |
| Action | Command |
|---|---|
| Record macro into r | q r |
| Stop recording | q |
| Play macro r | @r |
| Repeat last macro | @@ |
| Yank into register r | " r y{motion} |
| Paste from register r | " r p |
| Action | Command |
|---|---|
| Close fold | zc |
| Open fold | zo |
| Fold more (deeper) | zm |
| Fold less (shallower) | zr |
| Close all folds | zM |
| Open all folds | zR |
| Toggle fold under cursor | za |
| Toggle all under cursor | zA |
| Toggle folding feature | zi |
| Action | Command |
|---|---|
| Toggle case under cursor | ~ |
| Swap case via motion | g~{motion} |
| Lowercase via motion | gu{motion} |
| Uppercase via motion | gU{motion} |
| Lowercase entire line | guu |
| Uppercase entire line | gUU |
| Swap case on current char (repeat) | g~~ |
| Action | Command |
|---|---|
| Half-page down | Ctrl-d |
| Half-page up | Ctrl-u |
| Center cursor on screen | zz |
| Top of screen | zt |
| Bottom of screen | zb |
| Action | Command |
|---|---|
| Undo | u |
| Redo | Ctrl-r |
| Repeat last change | . |
| Action | Command |
|---|---|
| Save | :w |
| Quit | :q |
| Save & quit | :wq or ZZ |
| Quit without saving | :q! or ZQ |
| Search & replace in entire file | :%s/old/new/g |
| Search & replace with confirmation | :%s/old/new/gc |
| Auto-indent selection or motion | = |
| Format whole file | gg=G |
| Rename symbol | cr |
| Start debug | dc |
| Action | Command |
|---|---|
| Split horizontally | :split or :sp |
| Split vertically | :vsplit or :vs |
| Move between windows | Ctrl-W {h/j/k/l} |
| Open next buffer | :bnext or :bn |
| Open previous buffer | :bprev or :bp |
| List buffers | :ls |
| Close buffer | :bd |
| Next tab | gt |
| Previous tab | gT |
| Open new tab | :tabnew |
| Sort key unique | :sort u |
| Sort text asc | :sort |
| Sort text desc | :sort! |
| Add content to the buffer | :read path |
| Add output command to the buffer | :read !ls |
| Execute command select visual mode | :'<,'>! jq .city |
| description | command |
|---|---|
| Show logs | :MasonLog |
| show notifier errors | :lua Snacks.notifier.show_history() |
| show hidden explorer and fuzzy | { "folke/snacks.nvim",opts = {picker = { sources = {files = { hidden = true, ignored = true,},},hidden = true, ignored = true, },},}, |
| restart lsp | :LspRestart |
| load session current directory | qs |