- 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).
- C和C++安全編碼(原書第2版)
- Java Web及其框架技術(shù)
- R語言游戲數(shù)據(jù)分析與挖掘
- Java Web程序設計
- Python GUI Programming Cookbook
- Monitoring Elasticsearch
- OpenGL Data Visualization Cookbook
- 編寫高質(zhì)量代碼:改善Objective-C程序的61個建議
- 區(qū)塊鏈國產(chǎn)化實踐指南:基于Fabric 2.0
- jQuery for Designers Beginner's Guide Second Edition
- C指針原理揭秘:基于底層實現(xiàn)機制
- 超簡單:Photoshop+JavaScript+Python智能修圖與圖像自動化處理
- Python硬件編程實戰(zhàn)
- Three.js權(quán)威指南:在網(wǎng)頁上創(chuàng)建3D圖形和動畫的方法與實踐(原書第4版)
- 計算機組裝與維護(第二版)