Skip to content

Instantly share code, notes, and snippets.

@zahash
Last active May 10, 2024 15:22
Show Gist options
  • Save zahash/252db83db68e17274e937d42149b6257 to your computer and use it in GitHub Desktop.
Save zahash/252db83db68e17274e937d42149b6257 to your computer and use it in GitHub Desktop.
x - select current line
c - delete current selection and enters insert mode. (shorthand for di)
<space> + y/p - yank/paste from system clipboard
n{motion} - number before motion repeats it that many times. eg: 2w, 10j, etc...
% - select whole file
/ - search (uses regex). n and N to cycle through matches.
entering visual mode (v) when using n and N will multi-select matches instead of cycling.
C - multiple cursors
s - select matches in highlighted text. useful for find and replace.
( and ) to cycle through selections. <alt>, to remove primary selection
R - replace current selection with previously yanked text
> - indent
< - outdent
"<ch> - select register
Q - start/stop recording macro. default register = @
q - use macro. uses from default register
~/`/<alt>` - switch case/lower case/upper case for selected text
<ctrl>c - comment/uncomment
<ctrl>s - manually save position to jumplist
<ctrl>i/o - cycle through jumplist
<space> + b - cycle between open files
<space> + a - perform code action
goto mode (g) + jump to definition (d)
m - go to matching bracket
]d - go to next error
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment