Skip to content

Support standard tab navigation key shortcuts on macOS #12831

Closed

Description

macOS has OS wide shortcuts for navigating to the previous/next tab of:

cmd+shift+[
cmd+shift+]

Surprised to see that these don't work in VSCode. This was mentioned in #9333 but implemented as API commands and #8234 comes close but neither get all the way to making it standard for macOS or even making it an option for keybindings.json (as far as I can tell). Would be great for this to be supported.

Activity

  1. added
    help wanted
    feature-request
    workbench-tabs
    on Sep 28, 2016
  2. bpasero commented on Sep 28, 2016

    @bpasero
    Contributor

    Sounds like a good area for a Pull Request 👍

  3. bpasero commented on Sep 28, 2016

    @bpasero
    Contributor

    Looks like we cannot do this because this keybinding is already taken by editor folding.

  4. removed
    help wanted
    on Sep 28, 2016
  5. matthewrk commented on Sep 29, 2016

    @matthewrk
    Author

    These are the standard os wide shortcuts for switching to the left/right tab, so on macOS any users who tried this would find it a little jarring if VSCode did nothing or worse something different altogether such as editor folding. Would that be a sufficient argument for remapping? Difficult territory I know.

  6. bpasero commented on Sep 30, 2016

    @bpasero
    Contributor

    alexandrudima and Martin Aeschlimann (@aeschli) should chime in why those keybindings got picked, they might as well be THE standard keybindings for folding, so it is a tough call.

  7. matthewrk commented on Sep 30, 2016

    @matthewrk
    Author

    In comparison to other code editors, I can confirm that Atom, Sublime Text 2 and IntelliJ IDEA (with mac style bindings enabled) all use this shortcut for moving left/right a tab.

    That's in addition to any standard Mac app that has tabs; Safari, Terminal, Finder, Messages etc.

  8. alexdima commented on Oct 6, 2016

    @alexdima
    Member
  9. kidoman commented on Oct 11, 2016

    @kidoman

    I would like to chime in here as well.

    I have come from a big line of cult Mac OS X editors; TextMate, Sublime Text, and now VSCode.

    The most jarring thing for me has been not being able to use Cmd+1,2,3 to switch tabs (guess what it probably works this way in your current browser if you are using Mac OS X to browse to this page, it does in Chrome for Mac OS X) and lot of other standards defined by the other editors not being followed in VSCode (or working imperfectly).

    Although VSCode has now become my daily driver, it not respecting the lay of the land is continuing to be off putting #WhenInRome

  10. bpasero commented on Oct 16, 2016

    @bpasero
    Contributor

    Karan Misra (@kidoman) agree, but it is also hard to change something that has worked in one way for a long time. we did not have tabs from day 1 and so Cmd+1 means something else in VS Code and many users might have gotten used to that.

    You can always change keybindings easily, however I think what we need to do is provide a way for users to just say "I want Sublime keybindings" and you get it.

    Wade Anderson (@waderyan) fyi for this topic

  11. matthewrk commented on Oct 16, 2016

    @matthewrk
    Author

    Benjamin Pasero (@bpasero) Is there a way to manually rebind this currently using the json config file? I thought it wasn't exposed as an option.

    +1 on the idea of enabling default sets of keybindings, IntelliJ IDEA does something similar (see attached screenshot). However its worth re-emphasising that this isn't "Sublime style" its a native macOS style, every app that I've tried with tabs supports this, code editors or otherwise. So perhaps better to name this preset "macOS Native" rather than "Sublime", if it were to have a name.

    screen shot 2016-10-16 at 18 06 24

  12. 5 remaining items

  13. matthewrk commented on Nov 2, 2016

    @matthewrk
    Author

    Benjamin Pasero (@bpasero) I'm happy to consider this issue closed as I am able to do what I need via custom keybindings as you provided or via the sublime keybinding extension.

    However, in a more general sense by default Visual Studio Code is still not honouring default mac key shortcuts and the solution isn't immediately clear on how they can resolve this. These key shortcuts are part of the sublime extension but sublime only has them because they're mac defaults, so they're not sublime key shortcuts as such and mac users won't necessarily look to that extension naturally as a solution.

    Not sure if that's something you or the team want to tackle, otherwise as mentioned, I'm happy for this issue to be closed on the basis that my exact issue is resolved with custom settings.

  14. bpasero commented on Nov 3, 2016

    @bpasero
    Contributor

    We are looking into more solutions here, one possible idea is to ask the user on startup which keyscheme to use. Still, we should take a step back and look at all keybindings across OS to make them consistent 👍

  15. jupdike commented on Dec 21, 2016

    @jupdike

    I agree with Matthew King (@matthewrk). I am new to / really excited by VS Code and running into any issue like this where you feel like your fingers are chopped off is very jarring (hit expected combo and code disappears instead of changing tabs...).

    If it could be possible to allow all existing users to keep the ("incorrect") folding Cmd+Shift+[ ] but all new users get Cmd+Shift+[ ] = changing tabs, that would be a very desireable improvement. (I mean, if you don't want to match Mac conventions, change Cmd+S for Save to Ctrl+S for Save and watch people fly off the handle. And if that suggestion is just plain stupid, then so is ignoring Mac tab-changing keyboard shortcut conventions.)

    Not to be mean or pile on, but whoever picked those default shortcuts for code folding was demonstrably wrong and did not "speak the Mac keyboard shortcut language" natively or else they absolutely would not have picked the wrong shortcuts. The list of apps mentioned above should be enough proof that these shortcuts are supposed to be set aside for changing between tabs on macOS. (And the VS200X/Windows convention of the mini Ctrl+Tab/Cmd+Tab (but for open editor switching) is fine for what it does but that does not mean that Cmd+Shift+[ ] should not work as expected out of the box.) So this is a longwinded vote for "least surprise" and "feel as native as possible" and let people have a graceful onramp to VS Code by listening to long-time Mac users when they give you evidence that you made a mistake. (But only if you can do so without messing with people who have learned the "wrong" shortcuts because that would probably be even more confusing.)

    And finally, I'm only commenting because I think something can be improved and because VS Code is super cool and deserves to be its best self and be as easy to transition to as possible.

  16. added
    verification-needed
    on Dec 22, 2016
  17. bpasero commented on Dec 22, 2016

    @bpasero
    Contributor

    I pushed a change to improve keybindings on macOS:

    • cmd+shift+] = Next Tab (works across multiple groups)
    • cmd+shift+[ = Previous Tab (works across multiple groups)
    • cmd+alt+[ = Fold All
    • cmd+alt+] = Unfold All
  18. matthewrk commented on Dec 22, 2016

    @matthewrk
    Author

    Benjamin Pasero (@bpasero) thanks for your work! I really hope that's cmd+shift+] for next tab though, rather than [ as you quoted...

  19. leegee commented on Jan 12, 2017

    @leegee

    Solution proposed, and issue closed, but not locked so — please add by default CMD+n for editor at index n. All other tabbed software has it, how on earth are you living without it?

  20. bpasero commented on Jan 23, 2017

    @bpasero
    Contributor

    how on earth are you living without it?

    I was not and never will be using tabs, so for me it is natural that Cmd+1, Cmd+2 and Cmd+3 switch between editor groups.

  21. bpasero commented on Jan 23, 2017

    @bpasero
    Contributor
    • To verify:
    • cmd+shift+] = Next Tab (works across multiple groups)
    • cmd+shift+[ = Previous Tab (works across multiple groups)
    • cmd+alt+[ = Fold All
    • cmd+alt+] = Unfold All
  22. locked and limited conversation to collaborators on Nov 18, 2017
  23. added a commit that references this issue on Sep 6, 2026
    a5d7dfd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

feature-requestverification-neededverifiedworkbench-tabs

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions