Skip to content

Instantly share code, notes, and snippets.

@spielhoelle
Last active August 15, 2017 08:54
Show Gist options
  • Save spielhoelle/996a7df19669d993700d13129831d214 to your computer and use it in GitHub Desktop.
Save spielhoelle/996a7df19669d993700d13129831d214 to your computer and use it in GitHub Desktop.
vim index.html open a file
i - go to insert mode:
: (just colon) access command palette:
:help help
:w write file:
:q quit file:
x - to delete the unwanted character
u - to undo the last the command and U to undo the whole line
CTRL-R to redo
A - to append text at the end
:wq - to save and exit
:q! - to trash all changes
dw - move the cursor to the beginning of the word to delete that word
2w - to move the cursor two words forward.
3e - to move the cursor to the end of the third word forward.
0 (zero) to move to the start of the line.
d2w - which deletes 2 words .. number can be changed for deleting the number of consecutive words like d3w
dd to delete the line and 2dd to delete to line .number can be changed for deleting the number of consecutive words
in case vim was not closed correctly, there is a .swp file and vim is complaining when you open it again.
then just delete the swap file:
rm .file.swp
rm .file.swo
and so on
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment