vim learning small note

 Vim has a number of command is a very powerful editor

1, vim startup

vim [file name] will be able to edit the files, the default is Insert into the file, press esc to enter the normal mode state

Insert Mode = [Press esc key] = "normal mode.

Normal mode = [Press i] = "Insert Mode

Movement of the cursor in the normal mode

 2, vim exit

:! q    will discard any changes you've made, and exit vim

: wq   to save the file first, and then quit Vi to return to the shell.

: w    save the current edited file, but does not exit, but continue to wait for user input commands

: w newfile       At this point Vi will save the contents of the current file to the specified newfile, while the original file remains unchanged

:! w newfile       or choose another file name to save the current file.

: q     system quit Vi to return to the shell. If when using this command exit Vi, edit the file is not saved, then Vi following information is displayed in the last line of the display window: No write since last change (! Use to overrides) does not prompt the user to save the file has been modified, then Vi does not exit, continue to wait for user command

 3, editing characters

x = "delete the current label in which the characters when

dw = "in the normal mode, delete the last letter of the word to the current cursor

d $ = "in the normal mode, delete the current cursor to the last letter of the line

dd = "in the normal mode, the entire line can be removed when the

Digital dd = "in the normal mode, the digital lines can be deleted

a = "append text

4、

 

Guess you like

Origin www.cnblogs.com/rickyctbu/p/12237294.html
Recommended