VI a terminal to edit multiple file commands

Source: Internet
Author: User

In two cases: open multiple files in a different window: If a file is already open, enter it in the command input state of VI: The path and file name of the SP's other file, so that you can open multiple files in one window. You can use CTRL + two times to press W or CTRL + W and then press the up and down keys to toggle between the upper and lower windows. 2. Window partition implementation edit multiple files * First use VI to open a file, such as VI actinia_proenrule.sh * Split window open additional file command line mode input SP Another file can be split horizontally continue to open the second file, if you want to split vertically, you can make Using the VSP filename Note: sp=split,vsp=vsplit.    The above is the VI support of the shorthand, V is actually vertical, from which we can see the meaning of the change command, and VI not only support two files, but also support more files at the same time in a large window to display the editor, while also supporting the simultaneous opening of two files is the same file. * Window switch can use CTRL + two times press W, so that you can switch in the various files before you feel the vi multi-document editing with very inconvenient, and now touch a few, used minibufexplorer, found not very comfortable looking.  It is better to use LS to look good.    : LS Show all of the open documents below is not used to read the share of the people feel that these are not bad: N1,N2 Co n3: Copy the contents of N1 line to N2 row below the N3: n1,n2 m N3 to move the contents of the N1 line to the N2 row below the N3 line : n1,n2 d: Delete the contents of the N1 line to the N2 line: n1,n2 W!command: The contents of the N1 line to the N2 line in the file are entered and executed as command, and if N1,N2 is not specified, the entire file content is entered as the command input mode 2 The advantages of the Nyy and the PP command can be directly used in each window to copy and paste between the files, the operation is more convenient.

VI command to edit multiple files in one terminal

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.