你如何喜欢在Vim中的缓冲区之间切换?

前端之家收集整理的这篇文章主要介绍了你如何喜欢在Vim中的缓冲区之间切换?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我试过 MiniBufExplorer,但我通常最后有几个窗口显示它或完全关闭。我想要的是像增量搜索LustyJuggler,我在Emacs中的缓冲区之间切换的方式。当然有这样的脚本?
我已经使用Wincent Colaiuta的 Command-T vim plugin几个月了。 Wincent写了它的需要在C中快速的部分,我必须说,它是!而且,我认为它的文件模式匹配逻辑甚至比Textmate的Command-T更好。查看 screencast

The Command-T plug-in for VIM provides
an extremely fast,intuitive mechanism
for opening files with a minimal
number of keystrokes. It’s named
“Command-T” because it is inspired by
the “Go to File” window bound to
Command-T in TextMate.

Files are selected by typing
characters that appear in their paths,
and are ordered by an algorithm which
knows that characters that appear in
certain locations (for example,
immediately after a path separator)
should be given more weight.

Easier buffer switching包含许多有用的提示。我已经适应以下到我的.vimrc,它做缓冲区名称自动完成,将最有用的缓冲区切换命令映射到我的< Leader>和左侧主行键,并在状态行中显示当前缓冲区号:

"" Tab triggers buffer-name auto-completion
set wildchar=<Tab> wildmenu wildmode=full

let mapleader = ","

map <Leader>t :CommandT<Return>
map <Leader>a :bprev<Return>
map <Leader>s :bnext<Return>
map <Leader>d :bd<Return>
map <Leader>f :b 

"" Show the buffer number in the status line.
set laststatus=2 statusline=%02n:%<%f\ %h%m%r%=%-14.(%l,%c%V%)\ %P

我还使用MiniBufExplorer,它提供了每个列出的缓冲区在其自己的水平分割顶部的紧凑列表。

猜你在找的Bash相关文章