CentOS6.4 text editor Vi/Vim

Source: Internet
Author: User
CentOS6.4 text editor Vi/VimVim/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 positioning command delete command... 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 #
^ 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!
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.