Last active
September 14, 2020 09:41
-
-
Save aleksb86/64318fc90fbad6426a3a71d0ae66e980 to your computer and use it in GitHub Desktop.
VI shortcuts
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
To comment out blocks in vim: | |
press Esc (to leave editing or other mode) | |
hit ctrl+v (visual block mode) | |
use the ↑/↓ arrow keys to select lines you want (it won't highlight everything - it's OK!) | |
Shift+i (capital I) | |
insert the text you want, e.g. % | |
press EscEsc | |
To uncomment blocks in vim: | |
press Esc (to leave editing or other mode) | |
hit ctrl+v (visual block mode) | |
use the ↑/↓ arrow keys to select the lines to uncomment. | |
If you want to select multiple characters, use one or combine these methods: | |
use the left/right arrow keys to select more text | |
to select chunks of text use shift + ←/→ arrow key | |
you can repeatedly push the delete keys below, like a regular delete button | |
press d or x to delete characters, repeatedly if necessary | |
Undo: | |
u | |
Delete character under cursor: | |
x | |
V - selects entire lines | |
v - selects range of text |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment