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