Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to configure Visual studio code to use standard tab switching shortcut for mac?

Most OS X applications with tabbed interface allow using Cmd+Shift+[ and Cmd+Shift+] to switch tabs.

VSCode does not follow this. Is there a way to configure it to use these shortcuts to quickly switch to the next (towards right) and previous (towards left) tab.

This behavior is different from Ctrl+Tab behavior which shows a menu of most recent buffers. Repeatedly pressing Ctrl+Tab will keep alternating between same two recent buffers. But I would expect both Cmd+Shift+[ or Cmd+Shift+] to cycle through all the tabs, in right to left and left to right direction respectively.

like image 252
lorefnon Avatar asked Nov 05 '16 14:11

lorefnon


People also ask

How do you switch between tabs in VS Code on a Mac?

macOS. To quickly navigate between tabs, press and hold the CMD key, followed by the number (1 through 9) of the tab you want to switch to. You also have the ability to switch between the previous/next tab via the CMD + ALT + LEFT/RIGHT keyboard shortcut.

How do you quickly switch tabs in VS Code?

You can switch between views using ctrl + 1 ( ⌘ + 1 ), ctrl + 2 ( ⌘ + 2 ), and so on. Alternatively, you can switch between tabs (and, by extension, between views) using ctrl + page up / page down ( ⌘ + page up / page down ).

How do I customize a shortcut in VS Code?

Advanced customization# To configure keyboard shortcuts through the JSON file, open Keyboard Shortcuts editor and select the Open Keyboard Shortcuts (JSON) button on the right of the editor title bar. This will open your keybindings.json file where you can overwrite the Default Keyboard Shortcuts.


1 Answers

You can bind every shortcut yourself if you want. Open you keybindings.json (via command palette or menu Code->Preferences->Keyboard Shortcuts).

Pressing cmd+k cmd+k gives you a little input field that prefills the correct JSON syntax.

The commands for switching tabs are called workbench.action.nextEditor and workbench.action.previousEditor

like image 167
kwood Avatar answered Oct 25 '22 04:10

kwood