move tabs using mouse in gvim

313 views
Skip to first unread message

kamaraju kusumanchi

unread,
Dec 24, 2014, 10:55:26 AM12/24/14
to v...@vim.org
Is it possible to move tabs in a gvim window using mouse? Something similar to the way we can move tabs across in chrome and firefox? In firefox, we can even attach/detach tabs which would be really cool to have in gvim.

I am using vim 7.2 on a machine running Red Hat Enterprise Linux Server release 6.5.

A brief google search showed some hits on this issue but none of the solutions posted work with mouse.

Wondering if this is even possible with 7.2? If not, how about a later version?

thanks
raju

--
Kamaraju S Kusumanchi
http://malayamaarutham.blogspot.com/


--
Kamaraju S Kusumanchi
http://malayamaarutham.blogspot.com/

Ben Fritz

unread,
Dec 25, 2014, 11:15:23 PM12/25/14
to vim...@googlegroups.com, v...@vim.org
On Wednesday, December 24, 2014 9:55:26 AM UTC-6, kamaraju kusumanchi wrote:
> Is it possible to move tabs in a gvim window using mouse? Something similar to the way we can move tabs across in chrome and firefox? In firefox, we can even attach/detach tabs which would be really cool to have in gvim.
>
> I am using vim 7.2 on a machine running Red Hat Enterprise Linux Server release 6.5.
>
> A brief google search showed some hits on this issue but none of the solutions posted work with mouse.
>
>

Nope, it's not possible. At least, not with GUI tabs; Vim doesn't get any events you can map/intercept with those. A I doubt it's possible with the non-GUI tabline either but I might be wrong there.

Matthew Jones

unread,
Jan 14, 2015, 8:50:48 PM1/14/15
to vim...@googlegroups.com, v...@vim.org
It's possible. I mistakenly did this today. I assumed that this was standard gvim behaviour: just click & drag right or left. I can't think of a plugin that would be responsible. I think it's native.

-Matt

Matthew Jones

unread,
Jan 14, 2015, 8:55:59 PM1/14/15
to vim...@googlegroups.com, v...@vim.org
On Wednesday, December 24, 2014 at 7:55:26 AM UTC-8, kamaraju kusumanchi wrote:
Follow up:

You may need to add this to your .gvimrc:

set guioptions-=e

Ben Fritz

unread,
Jan 15, 2015, 9:58:44 AM1/15/15
to vim...@googlegroups.com, v...@vim.org
On Wednesday, January 14, 2015 at 7:55:59 PM UTC-6, Matthew Jones wrote:
> On Wednesday, December 24, 2014 at 7:55:26 AM UTC-8, kamaraju kusumanchi wrote:
> > Is it possible to move tabs in a gvim window using mouse? Something similar to the way we can move tabs across in chrome and firefox? In firefox, we can even attach/detach tabs which would be really cool to have in gvim.
> >
>
>
> You may need to add this to your .gvimrc:
>
> set guioptions-=e

Thanks for that, I never would have guessed. On Windows at least, I can drag tabs when using the textual "tabline", but not when using the native-gui-style "guitablabel".

I.e. :set guioptions-=e looks a lot less like tabs in appearance, but behaves more like tabs than the real tabs used by default with 'e' in the guioptions.

kamaraju kusumanchi

unread,
Jan 18, 2015, 9:25:30 PM1/18/15
to vim...@googlegroups.com
On Wed, Jan 14, 2015 at 8:55 PM, Matthew Jones <mathu...@gmail.com> wrote:
>
> Follow up:
>
> You may need to add this to your .gvimrc:
>
> set guioptions-=e
>

That is awesome and worked like a charm. Thanks for the workaround.

Ken Takata

unread,
Jan 20, 2015, 3:21:30 AM1/20/15
to vim...@googlegroups.com, v...@vim.org
Hi,
FYI, there is a patch to enable this without setting guioptions-=e:
https://groups.google.com/d/msg/vim_dev/LnZVZYls1yk/fj_Gz0vhnrsJ
With this patch, you can drag GUI tabs on Linux GTK and Windows.
Unfortunately it is not merged yet.

Regards,
Ken Takata

Ben Fritz

unread,
Jan 20, 2015, 6:53:08 AM1/20/15
to vim...@googlegroups.com, v...@vim.org
On Tuesday, January 20, 2015 at 2:21:30 AM UTC-6, Ken Takata wrote:
>
> FYI, there is a patch to enable this without setting guioptions-=e:
> https://groups.google.com/d/msg/vim_dev/LnZVZYls1yk/fj_Gz0vhnrsJ
> With this patch, you can drag GUI tabs on Linux GTK and Windows.
> Unfortunately it is not merged yet.
>

...and my list of patches to apply to my self-built Vim grows.

Ben Fritz

unread,
Jan 21, 2015, 12:01:56 PM1/21/15
to vim...@googlegroups.com, v...@vim.org
Just a follow-up: this patch still applies cleanly, with some line offsets, and works great.

kamaraju kusumanchi

unread,
Jan 24, 2015, 9:38:42 PM1/24/15
to vim...@googlegroups.com
On Tue, Jan 20, 2015 at 3:21 AM, Ken Takata <ktakat...@gmail.com> wrote:
> Hi,
>
> 2014/12/25 Thu 0:55:26 UTC+9 kamaraju kusumanchi wrote:
>> Is it possible to move tabs in a gvim window using mouse? Something similar to the way we can move tabs across in chrome and firefox? In firefox, we can even attach/detach tabs which would be really cool to have in gvim.
>>
>> I am using vim 7.2 on a machine running Red Hat Enterprise Linux Server release 6.5.
>>
>> A brief google search showed some hits on this issue but none of the solutions posted work with mouse.
>>
>> Wondering if this is even possible with 7.2? If not, how about a later version?
>>
>> thanks
>> raju
>>
>
> FYI, there is a patch to enable this without setting guioptions-=e:
> https://groups.google.com/d/msg/vim_dev/LnZVZYls1yk/fj_Gz0vhnrsJ
> With this patch, you can drag GUI tabs on Linux GTK and Windows.
> Unfortunately it is not merged yet.
>
> Regards,
> Ken Takata
>

Hi Ken,

I see that you are the original author of the patch and proposed it
more than a year ago and was also accepted by Bram Moolenaar. Do you
know why it is not yet included in the official version of gvim?

raju

Ken Takata

unread,
Jan 26, 2015, 9:10:27 AM1/26/15
to vim...@googlegroups.com
Hi raju,

2015/1/25 Sun 11:38:42 UTC+9 kamaraju kusumanchi wrote:
> I see that you are the original author of the patch and proposed it
> more than a year ago and was also accepted by Bram Moolenaar. Do you
> know why it is not yet included in the official version of gvim?

Because there are already too many items in the todo list, and priority
of new features are lower than bug fixes.
Fortunately, the priority of this patch becomes a little bit higher.
https://code.google.com/p/vim/source/diff?spec=svn435956324539eea89a17f0409a15b588973c0cb9&r=435956324539eea89a17f0409a15b588973c0cb9&format=side&path=/runtime/doc/todo.txt
(Line 433 to Line 156)
I hope this patch to be included in a few months.

Regards,
Ken Takata
Reply all
Reply to author
Forward
0 new messages