Use vim (II): common functions

Source: Internet
Author: User

Use vim (II): common functions
1. Common vim functions: common functions of vim, including block selection, copying, multi-file editing, and multi-window functions. 2. Select the vim block to copy and paste a part of the document without processing the entire line. 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 is a process in which vim opens 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. Multi-Window vim multi-window display is very convenient for displaying multiple files. You can copy and paste 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.