VIM series: window control and operation control. next we will mainly introduce some control operations and command skills in the editing and development process using VIM, I used some operation skills during the project development process. I did not discuss the principle in depth... news & nbsp; | & nbsp; VIM series: window control and operation control. next we will mainly introduce some control operations and command skills in the editing and development process using VIM, I used some operation skills during the project development process. I did not discuss the principle in depth and explain it in detail. This article mainly describes the two window control operations and Operation repetition, revocation, and Recovery Control in vim. Multi-window control operation vim fully supports multi-window editing and management operations, which is advantageous for multi-file editing and comparison and browsing. In vim, a window is a view of a file. a file can have multiple windows (views). For more information about Windows, see the help document. run the vim command: 1: the help window describes the common operations and commands used in multi-window control, including moving between windows, closing windows, and adjusting the window size. The window operation prefix key combination is Ctrl-w 1. move between windows. See help: help window-moving window operation key combination plus the direction movement control button in vim. For example, move the cursor to the next window: Ctrl-w j. 2. to close the window, view help: help window-exit to close the current window. There are two ways: first, enter q in the vim command line to close the window; second, add q, ctrl-w q. Close all windows, and enter qa in the vim command line. retain the current window and close all the remaining windows. There are also two ways. first, enter only in the vim command line, 2. add the key combination with o, that is, Ctrl-w o. you can view the details through: help only. Of course, before closing the window, make sure that you have saved the changes. Otherwise, an error will be prompted. 3. adjust the window size. for details, see help: help window-resize. The window has a height and a width. you can adjust them accordingly to meet the requirements. Adjust the height. run the following command: reszie to increase the height: resize + N. reduce the height: resize-N. the unit is row. for example, add 5 rows: resize + 5. Adjust the width by using the command: vertical resize. the parameter is consistent with the height. The resize command can be abbreviated to res. Note 1: When you enter a command on the command line in vim, you can still use the tab key in shell to complete the function. When you only know the commands and the letters of the help topic to be viewed, by pressing the tab key vim will automatically complete the order and keep repeating, in this way, you can select the command and topic you want. the shift-tab key combination performs a reverse loop. Note 2: all vim commands can be added with the help command name to view the help content of the command. Those who have already used the office suite of windows for repeated operations, revocation, and recovery control must be familiar with the undo and recovery operations. this is a lot of use. These two operations in vim are also very convenient to use. 1. repeat the previous operation to view help: help ., or more complex: help repeat.txt in Normal mode, through ". "You can repeat the last operation, but note that you can only repeat the operations performed by the shortcut keys and key combinations, rather than the operations you perform on the command line. 2. undo and restore the last operation. View help: help undo in Normal mode. press u to undo the operation and press Ctrl-r to restore the operation.
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