How to implement multi-window operation on Linux on Linux

  
                

When operating vim on Linux, you can implement multi-window editing. There are many ways to edit vim multi-window. Most people only use one of them. The following small series will give you a detailed introduction to Linux. A method for implementing vim multi-window editing.

Starting multi-window editing

Vim's multi-window is dynamic, you can open multiple windows when you start editing, or you can add new windows at any time while working, or delete a window.

$ vim -o file1 file2 Opens an editing session, which is displayed as a window split horizontally into two halves, one file occupies one window.

$ vim -O file1 file2 the same as above, but is vertically divided halves window

as shown below:

is not sufficient if the screen division With all the windows in it, the first file will take up most of the window, and the rest of the window will be loaded into the buffer, which you can't see for the time being, but you can still use it.

-o followed by a number n, which is in the form of a pre-allocated window:

$ vim -o5 file1 file2 will allocate 5 identical windows, 3 will be idle

Multiple window editing for vim

:split Create a new window that splits the current window into two halves. They display the contents of the same buffer (the same file). This will allow you to browse the same file in both windows.

:vsplit Creates a new vertically split window that also displays the same file content as the current window. The effect is as follows:
Previous123Next page Total 3 pages

Copyright © Windows knowledge All Rights Reserved