You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Support standard tab navigation key shortcuts on macOS #12831
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.
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.
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.
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.
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
Reacted by Lee Goddard, joe miller, Krzysztof Szafranek, Andrei Simionescu, Matthew, Eddy Hernandez, Roman Khitin and Stephen Beck
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.
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.
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.
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 👍
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.
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?
Activity
bpasero commentedon Sep 28, 2016
Sounds like a good area for a Pull Request 👍
bpasero commentedon Sep 28, 2016
Looks like we cannot do this because this keybinding is already taken by editor folding.
matthewrk commentedon Sep 29, 2016
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.
bpasero commentedon Sep 30, 2016
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.
matthewrk commentedon Sep 30, 2016
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.
alexdima commentedon Oct 6, 2016
Martin Aeschlimann (@aeschli) knows
kidoman commentedon Oct 11, 2016
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
bpasero commentedon Oct 16, 2016
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
matthewrk commentedon Oct 16, 2016
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.
5 remaining items
matthewrk commentedon Nov 2, 2016
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.
bpasero commentedon Nov 3, 2016
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 👍
jupdike commentedon Dec 21, 2016
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.
bpasero commentedon Dec 22, 2016
I pushed a change to improve keybindings on macOS:
matthewrk commentedon Dec 22, 2016
Benjamin Pasero (@bpasero) thanks for your work! I really hope that's cmd+shift+] for next tab though, rather than [ as you quoted...
leegee commentedon Jan 12, 2017
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?
bpasero commentedon Jan 23, 2017
I was not and never will be using tabs, so for me it is natural that
Cmd+1,Cmd+2andCmd+3switch between editor groups.bpasero commentedon Jan 23, 2017
Support standard tab navigation key shortcuts on macOS (fixes microso…