In Linux, the Vim editor is the system's own text editor, which is powerful. This vim (VI) is very simple. Note: The Linux command should be lowercase oh!
Vim Editor, you can create a new file can also modify the file, the command is: vim/usr/local/con.cfg If this file is not previously, then for new, enter the command click on the button below the prompt for the new file. If the file already exists, there is no prompt. After entering the editor, press "I", that is, switch to the "insert" state. You can move the cursor up or down, or space, backspace, and enter to edit the content, and Windows is the same. Methods and differences for exiting the VIM editor when the text edits are finished, you need to exit the editor. Exit Editor is divided into 4 cases: Save exit, normal exit, do not save exit and force quit.
1. Save and exit. Edit or modify the contents of the file, to save and exit, at this point, we want to press "ESC" in the upper left corner of the keyboard, then we enter "Colon", that is ":" (do not need double quotes), there will be a colon, wait for the input command, and then enter Wq.
W:write, writing
Q:quit, exit
Then return to the store and exit.
Save the second method of exiting:
A: In the last input command, the direct input "X", is also the same, that is, X=wq.
B: The quickest way: After pressing ESC, press SHIFT+ZZ directly, or switch to uppercase mode by ZZ, you can save the exit, that is, by 2 uppercase Z.
We can use the View command: Cat to view its contents: cat/usr/local/con.cfg
2, normal exit, the normal exit has a precondition is: Open text file in the content has not been changed. Press ESC and then enter a colon, enter "Q" When you enter the command,
3, to see not save the method of exit, many times opened the file, or modified some places, only to find the wrong, very need not to save the exit. Press ESC, enter a colon, and enter "q!" as you enter the command.
4, forced to quit. This is an action that should not be done and is not recommended. Press ESC first, then the colon, and enter "!" directly when you enter the command. After forced exit, there will be a prompt!
Note: Essay content source, online information.
How to get out of the VIM editor in a Linux system, methods and differences