如何适应从基于选项卡的编码到基于缓冲区的编码的转变 (Vim)
我最近从 notepad++ 换成了 Vim。在记事本++中,我曾经通过以下方式了解我打开的文件 将它们视为选项卡,因此当我想关闭或更改它们时,我只需按 Shift-Tab 或 Ctrl-W。 Vim 中也有选项卡,但当我使用它们时,我感觉我只是回到了我的 notepad++ 管理文件的方式。除了分割缓冲区之外,还有列出、管理、切换和删除缓冲区的好方法吗?
I recently changed from notepad++ to Vim. In notepad++ I used to be aware of my open files by
seeing them as tabs, so when I wanted to close or change them I just pressed Shift-Tab or Ctrl-W. In Vim there are also tabs, but when I use them I feel like I'm just going back to my notepad++ way of managing my files. Is there a good way of list, manage, switch and delete buffers other than splitting them?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
是的。我推荐一个缓冲区浏览器插件以及学习缓冲区命令。我用这个插件。
http://www.vim.org/scripts/script.php?script_id= 42
一旦您习惯了缓冲区范例,它就会变得非常优雅。减少视觉混乱。但你可以用 vim 自由地找到你自己的东西
Yep. I recommend a buffer explorer plugin as well as learning buffer commands. I use this plugin.
http://www.vim.org/scripts/script.php?script_id=42
The buffer paradigm is quite elegant once you are used to it. Less visual clutter. but you are free with vim to find your own thing
您可以使用以下命令:
ls
- 列出所有打开的缓冲区bp
、bn
- 切换到上一个或下一个缓冲区b number - 切换到具有该数字的缓冲区
b
text - 切换到名称包含字符串 textYou can use these commands:
ls
- list all open buffersbp
,bn
- switch to the previous or next bufferb
number - switch to the buffer with that numberb
text - switch to the buffer whose name includes the string text我已经尝试了几种 Vim 设置。我之前的尝试是使用制表符而不是缓冲区。这不是很令人满意。
现在我已经返回到缓冲区,并且为了导航文件和缓冲区,我仅使用 NERDTree 和 fuzzyfinder (我猜前 Textmate 用户可能更喜欢fuzzyfinder_textmate)插件,两者都很棒。
为了定位文件,我使用绑定到 n 的 NERDTree 或 fuzzyfinder 的文件模式。为了导航打开的缓冲区,我仅使用 fuzzfinder 的缓冲区模式,绑定到 b。
最近我还发现我可以使用 Ctrl-6 切换到之前打开的缓冲区(我想这可能是大多数键盘上的 Ctrl-^ )。
I've tried several setups for Vim. My previous was one where I tried to use tabs instead of buffers. It was not very satisfying.
Now I've returned to buffers and for navigating files and buffers I use only the NERDTree and fuzzyfinder (I guess ex Textmate users may prefer fuzzyfinder_textmate) plugins, both are great.
For locating files I use either NERDTree bound to n or fuzzyfinder's File mode. For navigating open buffers I use fuzzfinder's buffer mode solely, bound to b.
Recently I also discovered that I could switch to the previously open buffer with Ctrl-6 (I think maybe that is Ctrl-^ on most keyboard).
vim 中有很多处理缓冲区的方法。
CTRL-^ 在缓冲区之间切换。
:q 与 Ctrl-W 相同
有关更多详细信息,请参见 http://vim.wikia.com/wiki /easy_buffer_switching
There are so many ways to deal with buffers in vim.
CTRL-^ to switch between buffers.
:q is the same as Ctrl-W
For further details see http://vim.wikia.com/wiki/Easier_buffer_switching
BufferExplorerLight
或者
但是你真的必须尝试 FuzzyFinder!
BufferExplorerLight
Alternatively
But really you have to try FuzzyFinder!