- Open a new or existing file with
vim FILE_NAME. - Type
ito switch intoinsert modeso that you can start editing the file. pressEscTo get out of insert mode and back to command mode. :wq- To save and exit your file.:q!- Quit without first saving the file you were working on:w- To save file:e FILE_NAME- open and edit FILE_NAME/[keyword]- Searches for text in the document where keyword is whatever keyword, phrase or string of characters you're looking for?[keyword]- Searches previous text for your keyword, phrase or character string:%s/[pattern]/[replacement]/g- This replaces all occurrences of a pattern without confirming each one:%s/[pattern]/[replacement]/gc- Replaces all occurrences of a pattern and confirms each one
Last active
December 23, 2022 19:55
-
-
Save farid-mkh/e5a5fa9bfb17a56a2d5e2068f0600b8c to your computer and use it in GitHub Desktop.
vim cheat sheet
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment