Skip to content

Commit

Permalink
Adds explanation for save and exit command (freeCodeCamp#1375)
Browse files Browse the repository at this point in the history
@barisinanc, thanks for contributing! Good catch on the command.
  • Loading branch information
barisinanc authored and IsaacAbrahamson committed Oct 27, 2017
1 parent fc12958 commit 96dc289
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/pages/vim/useful-commands/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,12 @@ title: Useful Commands

## Exiting Vi, Vim, Nvim, Gvim
1. Press escape to get you into "normal" mode
2. Type `:q`, press enter. If you receive an error try `:q!`
(NOTE: The command `:q!` will force vim to exit without saving. Make sure you save first by typing the command `:w` if you do not want to lose any changes you've made.)
2. To exit, type `:q` but if you made any changes in file Vim gives error code `E37` in this case:
- To save and exit, type `:wq`
- To ignore changes and exit, type `:q!`

**OR**
- Type ZZ (save and quit)
- Close your terminal
- Shut down your computer

## Bare minimum functionality
Most likely you'll find yourself in "normal" mode, it allows you to enter commands by pressing the colon `:` key.
Expand All @@ -37,10 +36,10 @@ You are now in *paste* mode.
You can then enter insert mode with `i` and paste the block of text/code without any issues!
To return to regular Vim without paste mode you can enter normal mode (`escape` or `crtl + c`) and type `:set nopaste`, and press ENTER


## I Want to Learn Vim!
Start by pressing `escape` to check if you're in normal mode, press colon `:`, type `Tutor`, and press `enter`.

## Other Resources
- <a href='https://vimgolf.com/' target='_blank' rel='nofollow'>Vim Golf</a> - A good way to learn from doing vim challenges to get the lowest amount of keystrokes. You can see solutions submitted by others if you can't figure the challenge out.
- Read the rest of our Vim Guides to get a better understanding of this powerful editor.
- Read the rest of our Vim Guides to get a better understanding of this powerful editor.

0 comments on commit 96dc289

Please sign in to comment.