ashersyed / macvim

Automatically exported from code.google.com/p/macvim
0 stars 0 forks source link

Shortcut to switch from a tab to another #156

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
>> What steps will reproduce the problem?
Just open some tabs

>> What is the expected output? What do you see instead?
Command + Shift + left/right arrow (as in Safari) changes the active Tab (thus, 
I'd like a bind of 
:tabprev and :tabnext to these shortcut keys)

>> What version of MacVim and OS X are you using (see "MacVim->About MacVim" 
and  "Apple 
Menu->About This Mac" menu items, e.g. "Snapshot 40, 10.5.6 Intel")?
MacVim Snapshot 42 and OS X 10.5.6 Intel

Original issue reported on code.google.com by d9pou...@gmail.com on 18 Feb 2009 at 2:01

GoogleCodeExporter commented 9 years ago
Currently MacVim is not localized so it tries to follow the key bindings used 
on an
English keyboard layout so tab changes are bound to Cmd+{ and Cmd+}.

Changing the keys for menu items is covered in the help file (please always 
look at
the help before asking questions like this!).  See ":h macvim-menus".  To save 
you
some time, all you have to do is add the following lines to your .gvimrc:

    :macm Window.Previous\ Tab  key=<D-S-Left>
    :macm Window.Next\ Tab      key=<D-S-Right>

Original comment by bjorn.winckler@gmail.com on 18 Feb 2009 at 3:20

GoogleCodeExporter commented 9 years ago
MacVim has next/prev tab bound to ⌘⇧[ / ⌘⇧] – this seems like the one 
next tab/prev tab keyboard 
shortcut that all apps support (Safari, Terminal, Firefox, Adium after a Prefs 
change).

⌘⇧
← and ⌘⇧→ don't work in Firefox. But they do work in Safari and 
Terminal, so perhaps we should add 
those bindings to MacVim too?

Anyways, you can add this to your ~/_vimrc to create the keybindings for you:

macmenukey Window.Previous\ Tab                   <D-S-Left>
macmenukey Window.Next\ Tab                       <D-S-Right>

Original comment by nicotha...@gmail.com on 18 Feb 2009 at 3:21

GoogleCodeExporter commented 9 years ago
A menu can only be bound to one key combination so I don't think we should have 
more
than one (the alternative of mixing Vim mappings and menu bindings sounds kind 
of
bad).  Uh, hold on, how do they manage this in Terminal?  (It doesn't work in 
Safari
for me.)

Original comment by bjorn.winckler@gmail.com on 20 Feb 2009 at 2:00

GoogleCodeExporter commented 9 years ago
In Safari, ⌘⇧⇠/⇢ doesn't work something (i.e. a text field) has 
keyboard focus, which means that it doesn't 
work for empty tabs (location bar has focus), rss feeds (the search box gets 
focus; when you remove its focus, 
the shortcut works). So ⌘⇧[/] is more reliable in Safari.

Original comment by nicotha...@gmail.com on 20 Feb 2009 at 3:18

GoogleCodeExporter commented 9 years ago

Original comment by bjorn.winckler@gmail.com on 8 Apr 2009 at 12:49

GoogleCodeExporter commented 9 years ago
The "macm:" lines above did not work for me in OS X 10.6.2 and MacVim snapshot 
51.  I was able to change 
the shortcuts via System Preferences->Keyboard->Application Shortcuts

Original comment by sean.p.d...@gmail.com on 17 Dec 2009 at 3:31

GoogleCodeExporter commented 9 years ago
The menus have changed so the correct commands are now

macm Window.Select\ Previous\ Tab  key=<D-S-Left>
macm Window.Select\ Next\ Tab      key=<D-S-Right>

Put these in your ~/.gvimrc file (_not_ ~/.vimrc).

Original comment by bjorn.winckler@gmail.com on 17 Dec 2009 at 4:53

GoogleCodeExporter commented 9 years ago
Hi all,

I am looking at ways to optimize tab switching for use on a MacbookPro and no 
mouse. 
The default shortcut is rather cumbersome on a Belgian keyboard it's Cmd + Alt 
+ ( or 
)

I will try the settings posted by bjorn but thought I would mention a tip I saw 
on 
StackOverflow, which was for the Terminal:

"You can change key bindings for almost all Cocoa apps in the system
keyboard preference pane, including Terminal.app"

"I just tried this under Snow Leopard and it worked beautifully:

System Preferences => Keyboard => Keyboard Shortcuts
Click on "Application Shortcuts" on the left
Click the little "+" to add a program
Navigate to Terminal (it's hidden in Applications/Utilities)
For the Menu Title type "Select Next Tab"
For the Keyboard Shortcut type ctrl-tab
Click Add.
"

Does MacVim expose its shortcuts in this way? I imagine it would have to 
"declare" 
its configurable shortcuts somehow, but that may be handy since there is 
already a 
GUI there for the user to pick key combos.

Original comment by fabrice....@gmail.com on 17 Mar 2010 at 3:29

GoogleCodeExporter commented 9 years ago
Cmd+{ and Cmd+} work fine for me, and it is customizable in OS X Keyboard 
Shortcuts. 
@fabrice - yes they are exposed there - "Select Next Tab" and "Select Previous 
Tab"

Original comment by philfreo on 4 Jan 2013 at 11:27