Linux - Exit vim interface

reference:

https://blog.csdn.net/achi010/article/details/72775721

https://www.cnblogs.com/dalaoban/p/9381305.html

 

I did not want to write anything about vim article, but unfortunately today I have forgotten how to exit vim , and frequently used commands are ESC, then: wq (save and exit) ,: q (force quit without saving)!

 

First, quit as follows:

: q - quit (which is: quit the abbreviation)
:! q - exit without saving (! this is: quit abbreviation)
: WQ - write the file and exit (this is: The abbreviation writequit)
: WQ! - (If you only read the file permissions) write and exit; (if the file does not have write permission, forced to write)
: the X-- like: wq, if the file is no change, it is not written
: qa - exit all ( this is: the abbreviation quitall)

 

Second, if you just use a simple text editor, quit using the command 4 will suffice:
1, the Linux open the vi text editor,
vi filename
2, insertion (ie, text editors)
i

3, forced to save and exit (first: Press the ESC key to skip the command mode)
: WQ!
4, and forced to quit without saving (first: Press the ESC key to skip the command mode)
: q!

 

Third, the examples are as follows:
1, open the file, use the command: vi spring-context.xml


2, into the vi text editor, display the following

3, into the insertion state, directly by the keyboard letter i


This state can edit the contents of the file
4, press the ESC key to skip the command mode and enter:! Q forced to exit without saving


5, back to the initial interface

 

Other commands, methods, Great God has summed up well, not repeat them. Following address:
the VIM
http://blog.csdn.net/xiaolong2w/article/details/8224839
https://jingyan.baidu.com/article/48206aeaf07f37216ad6b3a6.html
Vl
http://blog.csdn.net/xueziheng/article / the Details / 2048054
https://jingyan.baidu.com/article/59703552e2e1e38fc107405a.html
----------------
Disclaimer: This article is CSDN blogger "achi010" original articles, follow CC 4.0 BY-SA copyright agreement, reproduced, please attach the original source link and this statement.
Original link: https: //blog.csdn.net/achi010/article/details/72775721

Guess you like

Origin www.cnblogs.com/frankcui/p/12040740.html