How to use vi editing

【1】Insert and use ------- Press [ shfit+i ] to enter the insert editing text mode.

【2】Exit and save----- press【ESC】key to jump to command mode

[2.1] Press the [ESC] key to jump to the command mode, then press the [:] colon key, and finally press [wq] to save and exit the vi editing state.

【2.2】If you don’t want to keep pressing the [:] colon key and the [q!] key, you can exit directly without saving.

【3】Bottom line command mode

Press [:] in command mode to enter bottom line command mode

:w saves the file but does not exit vi;

:w file will save the modifications to file without exiting vi;

:w! Force save without exiting vi;

:wq save the file and exit vi;

:wq! Force save the file and exit vi;

:q: Exit vi without saving the file;

:q! Forcefully exit vi without saving the file;

:e! Abandon all changes and start editing again from the last time you saved the file;

Guess you like

Origin blog.csdn.net/weixin_71435518/article/details/129679569