天天看點

vim tab 操作的小技巧

本文摘至:http://vim.wikia.com/wiki/Using_tab_pages

Opening and closing tabs

Once Vim has been launched, there are many commands that directly create or close tabs:

:tabedit {file}   edit specified file in a new tab
:tabfind {file}   open a new tab with filename given, searching the 'path' to find it
:tabclose         close current tab
:tabclose {i}     close i-th tab
:tabonly          close all other tabs (show only the current tab)
      

Navigation
vim tab 操作的小技巧

:tabs         list all tabs including their displayed windows
:tabm 0       move current tab to first
:tabm         move current tab to last
:tabm {i}     move current tab to position i+1

:tabn         go to next tab
:tabp         go to previous tab
:tabfirst     go to first tab
:tablast      go to last tab
      

In normal mode, you can type:

gt            go to next tab
gT            go to previous tab
{i}gt         go to tab in position i
      

Note that the gt command counts from one. That means 3gt will jump to the third tab. Also note is 0gt and 1gt mean the same thing: jumping to the first tab. 

繼續閱讀