- Mastering Vim
- Ruslan Osipov
- 299字
- 2021-06-10 18:51:29
Tabs
In many modern editors, tabs are used to represent different files. While you can certainly do this in Vim, you might want to consider their original purpose.
Vim uses tabs to switch between collections of windows, allowing you to effectively have multiple workspaces. Tabs are often used to work on a slightly different problem or set of files within the same Vim session. Personally, I don't get a lot of use out of tab pages, but if you find yourself often switching context within the project or between projects, then tabs might be exactly what you're looking for.
You can open a new tab with an empty buffer as follows:
:tabnew
As you can see, tabs are displayed on the top of the screen. The tab labeled 3 farm.py is a tab with three open windows and an active buffer farm.py. The [No Name] tab is the one we just opened:

You can load a file in it in the usual way: :e <filename>. You can also switch to a desired buffer using the :b command.
To navigate between tabs, you can use the following:
- gt or :tabnext to move to the next tab
- gT or :tabprevious to move to the previous tab
The tabs can be closed using :tabclose or by closing all of the windows it contains (for example, with :q if it's the only window).
:tabmove N lets you place the tab after the Nth tab (or as a first tab if N is 0).
- JavaScript:Functional Programming for JavaScript Developers
- 摩登創(chuàng)客:與智能手機(jī)和平板電腦共舞
- PHP網(wǎng)絡(luò)編程學(xué)習(xí)筆記
- Hands-On Enterprise Automation with Python.
- 可解釋機(jī)器學(xué)習(xí):模型、方法與實(shí)踐
- 常用工具軟件立體化教程(微課版)
- Mastering Git
- Python+Tableau數(shù)據(jù)可視化之美
- Spring Boot實(shí)戰(zhàn)
- Vue.js應(yīng)用測試
- 從零開始:C語言快速入門教程
- Learning Shiny
- 循序漸進(jìn)Vue.js 3前端開發(fā)實(shí)戰(zhàn)
- Web程序設(shè)計(jì)與架構(gòu)
- Analytics for the Internet of Things(IoT)