Vim command learning Summary

Source: Internet
Author: User


Vim command learning summary today I have reviewed the operations in the vim editor and made a record of some commonly used commands. Vim can be regarded as an advanced version of vi or a "program editor ". Its official website claims that vim is a "program development tool ". Vim has three modes: general mode, edit mode, and command mode. Www.2cto.com in normal mode, the files opened with vim directly enter the normal mode. In this mode, you can move the cursor by pressing the top, bottom, left, and right buttons to delete, copy, and paste the cursor. In this mode, Common commands are as follows: [Page Down] [Page Up] Page turning G moves to the first line of the file. gg moves to the last line of the file x, X x deletes a character backward, X is the forward deletion of a character dd (ndd) to delete the entire (n) row of the cursor yy (nyy) copy the (n) row of the cursor p, p. paste the copied data in the next line of the cursor (the last line) u. Restore the previous operation www.2cto.com [Ctrl] + r and redo the previous operation. In edit mode, press I, a, o, r enters edit mode command mode: w writes the edited data to the hard disk file: w! Force write to this file: q leaves vim: q! Do not save force Exit: wq save and exit: w [filename] save another file: r [filename] adds the file content to the vim multi-file edit www.2cto.com vim test.txt test1.txt behind the row where the cursor is located. Two files are opened simultaneously: n editing the next file: N editing the previous file; files: list all opened files. Multi-Window Function: Enter sp test1.txt in a text.txt file to enter multi-window mode.

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.