CentOS6.4 text editor Vi/Vim
Vim/Vi Introduction Vim/Vi is a powerful full-screen text editor, the most common text editor on Linux/UNIX. It is used to create, edit, and display text files.
Vim/Vi has no menu and only commands.
INSERT command
Locating command
DELETE command
Copy and cut commands
Replace and cancel commands
Search and replace commands
: % S/IRCU/ircu/g
: 9127,9131 s/ircu/IRCU/g (do not ask for replacement)
: 9127,9131 s/ircu/IRCU/c (ask for replacement)
Save and exit command
Application Instance
? Import file: r file name
? Run the following command: r! Command
? Import command execution result: r! Command
Combined use of the first two
? Define shortcut key: map shortcut key trigger command
Example: map ^ p I # <ESC>
^ P = CTRL + V, CTRL + P = CTRL + V + P
: Map ^ B 0x
? Continuous Line comment: n1, n2s/^/#/g
^ Tip number indicates the beginning of the line
: N1, n2s/^ # // g remove the first line comment
: N1, n2s // # // g remove all selected rows # comment
: N1, n2s/^/\/g
"\" Escape Character
? Replace: AB 51 blog redking.blog.51cto.com unreplace unab 51 blog
END!