Is there a vim command to relocate a tab?

前端 未结 7 1600
南笙
南笙 2021-01-29 18:16

How can I change the position / order of my current tab in Vim? For example, if I want to reposition my current tab to be the first tab?

相关标签:
7条回答
  • 2021-01-29 19:15

    In addition to the fine suggestions in other answers, you can also simply drag tabs with the mouse to move them, if you have mouse support enabled.

    This is on by default in MacVim and other GUI vim implementations, whether using the GUI widget tabs or the terminal style tabs in GUI mode.

    It also works in pure tty mode Vim, if you have set mouse=a and have a suitable terminal (xterm and most emulators of it, such as gnome-terminal, Terminal.app, iTerm2, and PuTTY/KiTTY, to name a view). Note that mouse clicks beyond column 222 also require set ttymouse=sgr; see In Vim, why doesn't my mouse work past the 220th column? for background on that.

    I've written a plugin called vim-tabber that provides some additional functionality for swapping tabs around, shifting them, and adding to the capabilities of the built-in tab manipulation commands, while remaining largely compatible with the builtins. Even if you choose not to use the plugin, there's some general tab usage information in the README.

    0 讨论(0)
提交回复
热议问题