Use Vim (II): common functions

Source: Internet
Author: User
1. Common Vim Functions
Common functions of VIM, including block selection, copying, multi-file editing, and multi-window functions.
2. Vim Block Selection
Block Selection is to copy and paste one part of the document without the entire line of processing. Press V, V, CTRL + V to select the block. Appears in the lower left corner
-- Visual line --
V: select the character, and select "V" for the reversed area of the cursor. Select "Ctrl + V" for the entire line after the cursor. Select "Y" for the rectangle: copy the Selected Location D: Delete the selected location
Copy the data copied by Y, find the appropriate position, and paste it by P.
3. Multi-file editing
Multi-file editing allows Vim to open multiple files at a time. These files can be easily copied and pasted. Otherwise, if two Vim files are used, they can only be copied and pasted with the mouse. Open multiple files:
Vim test1 Test2
: N: Edit next file: N: Edit last file: Files: list all files opened by VIM
$ Vim test test1: Files 1% A = "test" Line 1 2 # "test1" line 24yy # copy 4 rows: N # Open another file P # paste: Q! # Exit

4. Multiple windows
Vim's multi-window display allows you to conveniently display multiple files. You can copy and paste the data in two windows in YY mode. : SP [filename]: open a new window. filename can be blank. If it is empty, open the current file Ctrl + W + J: Move the window below. Press Ctrl + W to open it first, then J or press Ctrl + W + K: Move the top window Ctrl + W + Q: exit the file, the same as Q
Address: http://blog.csdn.net/yonggang7/article/details/38455105

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.