keyboard shortcut to switch focus in VSCode on a Mac? - visual-studio-code

Having a SQL file open in the editor, and psql running from the command line using the VSCode terminal, is there a keyboard shortcut to toggle the focus back and forth? I end up doing the CMD and the ` key to open/close the terminal but it'd be nice just to switch back and forth. Mac user.

Answering my own question: you can define workbench.action.terminal.focus in Keyboard Shortcuts (Preferences -> Keyboard Shortcuts) and then use that shortcut plus the CMD+1 to focus back on the editor (or CMD-2 etc). If someone has something more clever, let me know!

Related

What is vscode integrated terminal keyboard shortcut name

Sorry for the noob question. I am on an Italian keyboard and I would like to change the keyboard shortcut for the integrated terminal to something I can actually use.
When trying to change it I can't actually find the option for which I should change the key bind.
I have the Open New External Terminal option, but not something like Open Internal Terminal Option.

How can I prevent keyboard binding from syncing in VS Code?

I use VS Code in Mac and Windows. All the sudden VS Code is trying to sync my key binding between the two. Is there a way to stop that?
You can disable the syncing of keyboard shortcuts using the command palette:
Press Ctrl+Shift+P to open command palette.
Type and select > Settings Sync: Configure...
Untick the option named Keyboard shortcuts
Hit the OK button in the top right and you should be good to go.

Commenting out code does not work properly in VS code

I used to able to comment or uncomment multiple lines of code by pressing ctrl+/
# x = 10
# print(x)
But now I press ctrl+/, it becomes the following:
...
I tried to search for solution online, and I believe it is because the Windows shortcut somehow overwrite the shortcut in VS code. But I cannot find a solution.
I tried:
1.Reset the shortcut
2.Reinstall VS code
They don't work. Any help is appreciated.
First of all see which keyboard layout you are using on your System. Change the Keyboard layout to US-Keyboard if US keyboard is not selected.
If it is US keyboard then,
The shortcut key might have changed.
You can edit your preferences on VS code.
Goto File > Preferences > Keyboard Shortcuts
Search for Toggle Line Comments.
Click on edit icon and press your desired shortcut key
It could also be caused due to the same key bindings for shortcuts.The Keyboard Shortcuts editor has a context menu command Show Same Keybindings, which will filter the keybindings based on a keyboard shortcut to display conflicts. To view same key bindings follow the above steps till Step 3.
Now right click on the Toggle Line commands and click Show same key bindings.
It depends on what language you are programming.
But if you want to type # character you can hold down shift key and press number 3 on your keyboard.
I encounter this problem before. You should press shift key to switch back to type English and try again.

How do I switch terminals in Visual Studio code using a keyboard shortcut?

I would like to be able to switch between terminal panes in VSCode using a keyboard shortcut. I am on a Mac.
I have opened keyboard shortcuts (Commandkey+K, Commandkey+S) and found the workbench.action.terminal.focusNextPane setting:
where it states quite clearly what the keyboard shortcut should be (option+command+downarrow or option+command+leftarrow) but neither of those work. They DO work when focus is in the editor and I want to switch between panes there, but not working when the focus in the terminal.
Not sure what I'm doing wrong but I hope I'm missing something obvious. Can anyone explain?
The commands you are looking at (Terminal: Focus Next Pane and Terminal: Focus Previous Pane) are to switch between split terminal panes.
The commands to switch between terminals are:
Terminal: Focus Next Terminal
workbench.action.terminal.focusNext
Terminal: Focus Previous Terminal
workbench.action.terminal.focusPrevious
both of which are unbound by default.

Keyboard shortcut to cycle between opened editors in vscode

What is the keyboard shortcut Ctrl+` actually meant to do?
According to https://code.visualstudio.com/Docs/customization/keybindings, you can use Ctrl+` to "Cycle Between Opened Editors".
Viewing the vscode Explorer, I can see that there are several "working files", but pressing Ctrl+` does nothing.
I miss being able to use the "standard" keyboard shortcuts Ctrl+W or Ctrl+F6.
(Note: I found that Ctrl+Tab does the job!)
Another problem with Ctrl+` is that the symbol is not easily accessible on, for example, a Norwegian keyboard layout. What am I missing here?
When you open multiple documents side by side (Ctrl+Click in file list), this shortcut lets you switch between them.