Vim Tab)

Source: Internet
Author: User

Create a tab

Use: TabeCommand and file name parameters, you can open the specified file in the new tab. You can also use: TabnewCommand to edit the new file in the new tab. Command: Tab splitThe file in the current buffer is opened in the new tab.

Command: TabfYou can search for files in the current directory and open them on the new tab. For example, if you want to open the img.txt file under the current directory, you can use: Tabf IMG .*Command. Note that this command can only open one file. If Multiple matching files are searched, you will be prompted "too many file names". In this case, you need to provide more accurate search conditions to open the file.

By default, VIM can only open up to 10 tabs. You can useSet tabpagemax = 15Change this restriction.

List tabs

Command: TabsThe list of opened tabs is displayed, the current page is marked with ">", and the changed page is marked with "+.

Close Tab

Command: TabcYou can close the current tab. Commands: TaboAll tabs are closed.

Switch Tab

Command: TabnOrGTYou can move to the next tab. Commands: TABPOrGTWill be moved to the previous tab. If you have reached the last or foremost tab, the cycle is automatically switched.

If you open many tabs, you can use: TabfirstOr: TabrCommand to move to the first tab. Use: TablastCommand to move to the last tab.

Move Tab

If you want to arrange tabs in the specified order, you can use: TabmCommand. Note that the order of tabs starts from 0. For example: Tabm 1The current tab will be moved to the 2nd position. If you do not: TabmCommand to specify parameters, the current tab will be moved to the end.

Configuration tab

By default, the tab bar is displayed at the top of the window only when a new tab is created.Set showtabline = 1. If you want to always display the label bar, you can useSet showtabline = 2Command. You can useSet showtabline = 0.

Multi-tab command

Use: TabdoCommand, we can execute the command in multiple tabs at the same time. For example, if you open multiple tabs and replace "food" in these files with "drink", you can use: Tabdo % S/food/drink/gCommand to replace all files at a time, instead of repeating operations on each file.

Graphic Interface

If you are using gvim with a graphical interface, you can right-click the tab to create, close, and open a tab. You only need to click the corresponding tag to switch between different tabs.

Pass: Help tab-page-introCommand to obtain more information about the use of tabs.

Command Summary
: Tabnew Create a tab
: Tabs Display the list of opened tabs
: Tabc Close current tab
: Tabn Move to the next tab
: TABP Move to the previous Tab
: Tabfirst Move to the first tab
: Tablast Move to the last tab
Related Article

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.