在 gvim 中用鼠标重新排列选项卡
gVim 有没有办法通过用鼠标拖放选项卡来重新排列选项卡?我正在寻找的行为类似于 Firefox 和 Chrome 中的选项卡。
我知道可以使用 :tabm n
更改选项卡顺序,但这需要弄清楚您想要移动到多少个选项卡。对于这个空间任务来说,使用鼠标会更有用。
任何将选项卡向左/向右移动一个位置的方法也将很有用,因为人们可以重新映射键并移动选项卡而无需费力思考。
Is there any way in gVim
to rearrange tabs by dragging and dropping them with the mouse? The behavior I'm looking for is that similar to tabs in Firefox and Chrome.
I know that it's possible to change tab order using :tabm n
but that requires figuring out exactly how many tabs in you'd like to move to. Using the mouse would be more useful for this spatial task.
Any methods to move tabs left/right by one position would also be useful, since one could remap keys and move tabs without thinking too hard.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
以下是我的 vimrc 中有关选项卡的内容:
Here's what's in my vimrc regarding tabs:
这是一个将选项卡向左移动一个位置的函数。将其放入您的 vimrc 文件中并按照您认为合适的方式设置键(普通调用它,
:execute TabLeft()
)。请注意,这些函数分别从第一个到最后一个和从最后一个到第一个“滚动”选项卡,因此向左移动第一个选项卡使其成为最后一个选项卡,向右移动最后一个选项卡使其成为第一个选项卡。
) - 1 else execute "tabm" tab_number - 1 endif endfunction...然后向右
Here is a function to move a tab to the left one position. Put it in your vimrc file and set up your keys as you see fit (to call it longhand,
:execute TabLeft()
).Note that these functions "roll" tabs from first to last and last to first, respectively, so moving the first tab left makes it the last tab, and moving the last tab right makes it the first tab.
) - 1 else execute "tabm" tab_number - 1 endif endfunction...and to the right
谢谢,我已经修改了你的 vimrc 代码:
然后在我的 GVim 中,我映射 [ctrl+shift+left] 向左移动,[ctrl+shift+right] 向左移动
Thanks, and I have modified your code for my vimrc :
Then in my GVim, I map [ctrl+shift+left] to move left, [ctrl+shift+right] to move left
chris.ritsen 的解决方案在 vim v7.4 中不再为我工作,所以这里有一个更简单的替代方案:
chris.ritsen's solution stopped working for me in vim v7.4 so here's a simpler alternative:
Ken Takata 编写了一个补丁来执行此操作 https://groups.google.com /forum/#!msg/vim_dev/LnZVZYls1yk/PHQl4WNDAgAJ 。一种选择是下载 vim 源代码,应用此补丁并编译。
Ken Takata wrote a patch to do this https://groups.google.com/forum/#!msg/vim_dev/LnZVZYls1yk/PHQl4WNDAgAJ . One option is to download vim source code, aply this patch and compile.
将选项卡向左/右移动
这不涉及使用鼠标,但它使用非常简单的
gvim
键盘映射:现在您将能够移动当前选项卡:
Move Tabs to the Left / Right
This doesn't involve using a mouse, but it uses very simple keymaps for
gvim
:Now you'll be able to move the current tab: