简体   繁体   English

minibufexplorer(vim)的替代品?

[英]An alternative to minibufexplorer (vim)?

minibufexplorer is a persistent buffer manager for vim that lives in its own window. minibufexplorer是vim的持久性缓冲区管理器,它位于自己的窗口中。 It shows all the buffers you have open, with color indicators as to which are currently visible in windows and which have unsaved changes. 它显示了所有打开的缓冲区,并带有颜色指示符,用于指示当前在窗口中可见以及尚未保存的更改。

It's a great plugin which I've been hooked on forever. 这是一个很棒的插件,我一直迷住了。 And without the persistent buffer display I find that I now feel lost. 在没有持久缓冲区显示的情况下,我现在感到迷失了。

The problem is, minibufexpl tends to get in the way of other window controls. 问题是,minibufexpl倾向于妨碍其他窗口控件。 As it is a normal vim window, it behaves like one, causing issues if you wanted to say, rotate your other working windows. 因为它是一个普通的vim窗口,所以它的行为类似于一个窗口,如果您要说的话,旋转其他工作窗口会引起问题。 Minibufexplorer's window would rotate as well, which is obviously less than desirable. Minibufexplorer的窗口也会旋转,这显然不是所希望的。

What I really need is a plugin that persistently displays the open buffers, but doesn't behave like a window. 我真正需要的是一个可持久显示打开缓冲区但不像窗口一样运行的插件。 I don't need file navigation or anything as I use other means for that. 我不需要文件导航或其他任何东西,因为我使用了其他方法。 Perhaps even something like an extended status bar that was capable of displaying information on buffers like minibufexpl does? 也许甚至像扩展状态栏之类的东西也能够像minibufexpl这样在缓冲区上显示信息吗?

There's a new fork of minibufexpl.vim on GitHub which aims to solve some of these problems. GitHub上一个minibufexpl.vim的新分支 ,旨在解决其中的一些问题。 One of its new features is "Prevents resizing of MBE buffer by window resizing commands" and it is immune to commands such as CW CR (rotate windows). 它的新功能之一是“通过窗口调整大小来防止MBE缓冲区调整大小”,并且不受CW CR (旋转窗口)等命令的影响。

https://github.com/fholgado/minibufexpl.vim https://github.com/fholgado/minibufexpl.vim

While this is not an exact answer to your question, I think you could find it useful. 虽然这并不是您问题的确切答案,但我认为您会发现它很有用。

FuzzyFinder plugin provides good visual representation of your open buffers, and also offers great way to jump between them - fuzzy match. FuzzyFinder插件可以很好地直观显示打开的缓冲区,并且还提供一种在它们之间跳转的方法-模糊匹配。

Its list of buffers is not "persistent" meaning it's only shown on demand, but I consider this an advantage: firstly the buffers list doesn't eat up precious screen estate, and secondly with fuzzy match I don't feel a need to see it at all. 它的缓冲区列表不是“持久的”,这意味着它仅按需显示,但是我认为这是一个优势:首先,缓冲区列表不会占用宝贵的屏幕资源,其次,通过模糊匹配,我不需要看到一切。

Consider the below screenshot: in order to switch to ext_gcd.py I just need to press 考虑下面的屏幕截图:为了切换到ext_gcd.py我只需要按
,bg : ,b invokes buffers list and g fuzzy-matches the only buffer whose name contains letter g . ,bg,b调用缓冲区列表,并且g使名称唯一包含字母g的唯一缓冲区模糊匹配。

在此处输入图片说明

PS: it works with files too. PS:它也适用于文件。 My mappings are as follows: 我的映射如下:

map <leader>f :FufFileWithCurrentBufferDir **/<C-M> 
map <leader>b :FufBuffer<C-M>

,f in this case recursively fuzzy-matches files starting from a directory where current buffer is placed. 在这种情况下,f递归地模糊匹配从当前缓冲区所在目录开始的文件。

Old thread, but for anyone else searching checkout the vim-airline plugin. 旧线程,但对其他正在搜索的人来说,签出vim-airline插件。 It's very popular and has great compatibility with other plugins. 它非常流行,并且与其他插件具有很好的兼容性。

Use the g:airline#extensions#bufferline#enabled option to get what your looking for. 使用g:airline#extensions#bufferline#enabled选项可获取所需的内容。

I really enjoy buftabs.vim because it keeps the information about which buffers I have open in the status line, which disappear when I need to type there in a nice clear manner. 我非常喜欢buftabs.vim,因为它保留了有关我在状态行中打开了哪些缓冲区的信息,当我需要以一种清晰清晰的方式在其中键入内容时,这些缓冲区就会消失。 I find this quite preferable to minibufexplorer because my cursor never accidentally ends up in a read-only scratch buffer which takes up more space than necessary. 我发现这对minibufexplorer来说是更好的选择,因为我的光标永远不会偶然出现在只读的暂存缓冲区中,该缓冲区只占用必要的空间。 It also does some magic-mapping of :bnext and :blast to allow hopping between buffers for a rather more "familiar" feeling. 它还对:bnext:blast进行了魔术映射,以允许在缓冲区之间跳动,从而获得更“熟悉”的感觉。

在此处输入图片说明

You can use ctrlp , a plugin written in pure Vimscript and highly configurable . 您可以使用ctrlp ,这是一个用纯Vimscript编写且可高度配置的插件。

:CtrlPBuffer open a window with the list of open buffers :CtrlPBuffer用打开的缓冲区列表打开一个窗口

you can begin to type, it is a fuzzy finder. 您可以开始输入,这是一个模糊的查找器。

There is also Tagma Buffer Manager . 还有Tagma缓冲区管理器 I am not using it yet, but someday I will give it a try, for sure. 我尚未使用它,但是有一天我会尝试一下。

You can try Powerline's tabline ! 您可以尝试Powerline's tabline

I tried many plugins but they tend to take up the command line or the status line, or won't show up the whole tabs when there're too many of them. 我尝试了很多插件,但是它们往往占用命令行或状态行,或者当插件太多时,它们不会显示整个选项卡。

Here is a screen shot (the top bar is the tabline !): 是一个屏幕截图(顶部栏是tabline !):

You need to add set showtabline=2 in .vimrc after install Powerline. 安装Powerline之后,需要在.vimrc中添加set showtabline=2

And if you want to go to the 8th buffer, :b 8 will jump to it! 如果要转到第8个缓冲区, :b 8将跳转至该缓冲区!

Hope this helps. 希望这可以帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM