Skip to content

Instantly share code, notes, and snippets.

@vosechu
Created June 16, 2020 22:40
Show Gist options
  • Save vosechu/c2df0281d86148f799caa8f4044b41c5 to your computer and use it in GitHub Desktop.
Save vosechu/c2df0281d86148f799caa8f4044b41c5 to your computer and use it in GitHub Desktop.
Minimal vim commands
# Minimum vim commands
## Moving around
Arrows - they totally work
# Copy and paste some code
<number>dd - delete n lines
u - undo
p - paste
## Copy and paste some code
<number>dd - delete n lines
u - undo
p - paste
## Add some code
Shift+a - End of line, enter insert mode
^ OR ctrl+a - Start of line
$ OR ctrl+e - End of line
i - enter insert mode
Esc - Leave insert mode
## Copy and paste some code
<number>dd - delete n lines
u - undo
p - paste
## Undo/redo
u - undo
ctrl+r - redo
## Delete some codes
<number>dd - delete n lines
## Saving
:wq OR :x - save what I did
ctrl+Z - send vim to background so I can still undo stuff
fg - bring vim back to foreground so I can undo stuff when it didn't work
## Stuff you shouldn't be doing but probably will
%/<regex>/<replacement>/g - replace codes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment