Multiple tags
Open the file in the form of multiple tags before entering vim-P <File Name>. For example, VIM-p * is used to edit all files in the current directory. In Vim editing, tabnew adds a label: tabc to close the current tab: Tabo to close all other tabs: tabs view all open tabs: TABP or GT previous: tabn or GT next to a new tab
: Tabe <File Name> open the specified file on the new tab.
: Tabnew <File Name> edit the new file on the new tab.
: Tab split in the new tab, open the file in the current buffer. : Tabf allows you to search for files in the current directory and open it in the new tab. For example, tabf IMG .*. This command can open only one file. Vim can open up to 10 tabs by default. You can use set tabpagemax = 15 to change this restriction. List tabs: tabs displays the list of opened tabs, uses ">" to identify the current page, and uses "+" to identify the changed page. Close tab: tabc closes the current tab.
: Tabo: Close all tabs. Switch label: Move tabn or GT to the next tab.
: Move TABP or GT to the previous tab. : Tabfirst or: tabr move to the first tab.
: Move tablast to the last tab. Move tab: the order in which tabm [sequence] Moves tabs of the current file. For example, tabm 1 moves the current tab to the 2nd position. For example, if no parameter is specified for tabm, it will be moved to the end. Configuration tab: The set showtabline = [, 3] tab displays the tab bar above the window. = 0: the label bar is not displayed at all. = 1: The label bar is displayed only when the user creates a new one. = 2: The label bar is always displayed.
Multi-tab command: tabdo <command> execute commands on multiple tabs at the same time. For example, the tabdo % S/food/drink/g command replaces "food" in multiple tab files with "drink ".
Help
: Help tab-page-intro command to obtain more information about the use of tabs.
Window
1. open multiple windows (editing in VIM)To open multiple windows, run the following commands: horizontal cut window: New + window name (save as the file name ):Split+ Window name, which can also be abbreviated as SP + window name vertical cut window Name:Vsplit+ Window name, which can also be abbreviated as: VSP + window name vim-O file1 file2... # Open multiple Windows horizontally, VIM-O file1 file2... # vertically open multiple windows, VIM-D file1 file2... # Open multiple Windows vertically and compare vimdiff file1 file2 .. # equivalent to the previous sentence2. Close multiple windowsCan be used: Q !, You can also use close. The last window cannot be closed using close. Close is used only to temporarily close the window, and its content is still in the cache. Only Q! is used! , W! Or X to exit. Close Window Q or close # Close current window only # Keep current window, close all other Windows qall (QA) # exit all windows wall # Save all windows3. Window Switching: Ctrl + W + J/K. You can switch up and down through J/K, or press Ctrl + W to add the up and down keys, or double-click Ctrl + W to switch the window in sequence.4. Adjust the window sizeVertical adjustment: Ctrl + W + vertical expansion (increase in the number of rows): Ctrl + w-vertical reduction (decrease in the number of rows): res (ize) num example: Res 5, adjust the number of displayed rows to 5 rows: res (ize) + num increase the height of the current window by adding num row: res (ize)-num to reduce the height of the current window by horizontal adjustment of num rows: vertical res (ize) num specifies that the current window is the num column: vertical res (ize) + num to add the num column in the current window: vertical res (ize)-num to reduce the num column in the current window5. Rename the window: F File6. open multiple files in VI (before entering Vim)Vi a B C: N jump to the next file, you can also directly specify the file to jump, such as: n C, you can directly jump to the C file: E # Back to the file just edited7. File browsing: Ex Open Directory browser, you can browse all files in the current directory, and you can select: Sex horizontal split current window, and Open Directory browser in a window: ls display current buffer status8. Switch between VI and Shell: Shell can switch to the shell command line without disabling VI: exit from shell back to VI