Ⅰ. 插件描述
Few utilities for pretty tabsⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'gcmt/taboo-vim'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'gcmt/taboo-vim'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'gcmt/taboo-vim'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/gcmt/taboo.vim
Ⅳ. 文档说明
## taboo.vim
Taboo aims to ease the way you set the vim tabline. In addition, Taboo provides fews useful utilities for renaming tabs.
Installation
Install either with Vundle, Pathogen or Neobundle.
NOTE: tabs look different in terminal vim than in gui versions. If you wish having terminal style tabs even in gui versions you have to add the following line to your .vimrc file
set guioptions-=eTaboo is able to remember tab names when you save the current session but you are required to set the following option in your .vimrc file
set sessionoptions+=tabpages,globalsCommands
TabooRename <tabname>Renames the current tab with the name provided.TabooOpen <tabname>Opens a new tab and and gives it the name provided.TabooResetRemoves the custom label associated with the current tab.
Basic options
g:taboo_tab_format
With this option you can customize the look of tabs. Below all the available items:
%f: the name of the first buffer open in the tab%a: the path relative to$HOMEof the first buffer open in the tab%r: the path relative to the current working directory%n: the tab number, but only on the active tab%N: the tab number on each tab%i: same as%n, but using superscript numbers (eg.²)%I: same as%N, but using superscript numbers%w: the number of windows opened into the tab, but only on the active tab%W: the number of windows opened into the tab, on each tab%u: same as%w, but using superscript numbers (eg.³)%U: same as%W, but using superscript numbers%m: the modified flag%p: the tab current working directory%P: the last component of the tab current working directory%S: the shortened tab current working directory%x: close tab button, seeg:taboo_close_tab_label
Default: " %f%m "
g:taboo_renamed_tab_format
Same as g:taboo_tab_format but for renamed tabs. In addition, you can use the following items:
%l: the custom tab name set with:TabooRename
NOTE: with renamed tabs the items %f and %a will be evaluated to an empty string.
Default: " [%l]%m "
g:taboo_modified_tab_flag
This option controls how the modified flag looks like.
Default: "*"
g:taboo_tabline
Turn off this option and Taboo won't generate the tabline. This may be useful if you want to do it yourself with the help of the functions TabooTabTitle(..) or TabooTabName(..).
Default: 1
g:taboo_close_tab_label
This option controls how the close button looks like.
Default: "x"
Public interface
Taboo provides a couple of public functions that may be used by third party plugins:
TabooTabTitle(tabnumber)->stringThis function returns the formatted tab title according to the options `g:taboo_tab_format` and `g:taboo_renamed_tab_format` (for renamed tabs).TabooTabName(tabnumber)->stringThis function returns the name of a renamed tab. If a tab has no name, an empty string is returned.