Created
June 16, 2020 22:40
-
-
Save vosechu/c2df0281d86148f799caa8f4044b41c5 to your computer and use it in GitHub Desktop.
Minimal vim commands
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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