Ⅰ. 插件描述
Deprecated, use wintabs insteadⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'zefei/buftabs-you-belong-with-me'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'zefei/buftabs-you-belong-with-me'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'zefei/buftabs-you-belong-with-me'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/zefei/buftabs
Ⅳ. 文档说明
This is a fork of http://www.vim.org/scripts/script.php?script_id=1664
Introduction
This is a simple script that shows a tabs-like list of buffers in the
- The biggest advantage of this script over various others is that
- does not create new window, and thus will not conflit with other navigation
plugins such as nerdtree.
Screeshots
a few opened files in one window: http://i.imgur.com/stvMQ.png
3 windows - nerdtree, help and files: http://i.imgur.com/Pdsg9.png
3 windows - fugitive and files: http://i.imgur.com/XUoHT.png
(color scheme used in screenshots is https://github.com/zefei/simple-dark)
Usage
Just copy the file to vim plugin directory, it will start showing buffer list
on your statusline. By default, it will take over the entire statusline; but
if you want to use only part of the statusline for buftabs, please check the
configuration options below.
It might be handy to create a few maps for easy switching of buffers in your
.vimrc file. For example:
noremap <F1> :bprev!<CR>
noremap <F2> :bnext!<CR>
noremap <F4> :confirm bd<CR>
Configuration
The following extra configuration variables are availabe:
- statusline
By default buftabs will take up the whole statusline. You can
alternatively specify precisely where it goes using #{buftabs} e.g.:
:set laststatus=2
:set statusline= #{buftabs}%= Ln %-5.5l Col %-4.4v
NOTICE: If you customize your statusline like above, you will HAVE to
specify the total charactor length of non-buftabs components in the
- By default, it is 0 since there are no other components. To
change:
" for the example statusline above, length of other components is 20
:let g:buftabs_other_components_length=20
- g:buftabs_active_highlight_group (default '')
The name of a highlight group (:help highligh-groups) which is used to
show the name of the current active buffer. To change:
:let g:buftabs_active_highlight_group="Visual"
- g:buftabs_only_basename (default 1)
This variable makes buftabs only print the filename of each buffer,
omitting the preceding directory name. To unset:
:let g:buftabs_only_basename=0
- g:buftabs_show_number 1
- g:buftabs_marker_start [
- g:buftabs_marker_end ]
- g:buftabs_separator -
- g:buftabs_marker_modified !
These strings are drawn around each tab as separators, the 'marker_modified'
symbol is used to denote a modified (unsaved) buffer. If
'buftabs_show_number' is set to 0, neither buffer number nor separator is
- To change:
:let g:buftabs_separator = "."
:let g:buftabs_marker_start = " "
:let g:buftabs_marker_end = " "
:let g:buftabs_marker_modified = " +"
- g:buftabs_blacklist (default ["^NERD_tree_[0-9]*$"])
You might not want to show buftabs when working with some buffers (e.g.
NERDtree). You can add patterns of these buffer names to
'buftabs_blacklist':
:let g:buftabs_blacklist = ["^NERD_tree_[0-9]*$", "^__Tagbar__$"]