Questions tagged [vscode-keybinding]
101 questions
1
vote
2 answers
VS Code Keybinding for Line Break
I would like to add a key binding for inserting a line break in the editor (textInputFocus). Normally the Return key does this (VS Code calls the key Enter). Which command in VS Code can I use?
There is lineBreakInsert but this does not behave…

mrn
- 87
- 1
- 1
- 9
1
vote
1 answer
VS Code when clause context (for keyboard shortcuts) for LaTeX math mode
In VS Code I can define keyboard shortcuts to only work in certain conditions:
https://code.visualstudio.com/api/references/when-clause-contexts
So i can add different variables, e.g. this keyboard shortcut would only work when writing latex…

Hebol
- 51
- 7
1
vote
1 answer
Is there a way to define different keybinds depending on file extension in VSCode?
I am trying to get something similar to VSCode Python Jupyter Notebook functionality but with C++, and I have succeeded for the most part by using Code Runner extension along with a custom python script to add a preamble to the cpp file before…

Anton Bogun
- 23
- 2
- 5
1
vote
1 answer
How to add the custom compile commands in VS Code?
I usually do competitive programming in Geany IDE and have the following custom compile command to compile C++ programs -
g++ -std=c++17 -Wshadow -Wall -o "%e" "%f" -g -fsanitize=address -fsanitize=undefined -D_GLIBCXX_DEBUG
The compile command is…

sushruta19
- 327
- 3
- 12
1
vote
1 answer
In VS Code what's the difference between Quick Switch Window and Switch Window?
It seems like both commands do the same thing?

nullify0844
- 4,641
- 1
- 22
- 16
1
vote
1 answer
VSCode Keybinding Snippet: Use TM_SELECTED_TEXT to Remove All Slashes From A Selected String
How can I use a custom Visual Studio Code snippet to remove slashes (/), along with other characters, from a selected piece of code?
When I've created a new object to keybindings.json, it only recognized the plus sign (+) :
{
"key":…
user13084463
1
vote
1 answer
What's the `When` condition for checking if the debug console is active?
I'm trying to bind Clear Console(workbench.debug.panel.action.clearReplAction) to a shortcut, the problem is what's the When condition for checking if the debug console is active?

Wenfang Du
- 8,804
- 9
- 59
- 90
1
vote
1 answer
How to check if the text in an editor has focus when developing an extension?
Same to editorTextFocus, but I want to check this condition when developing an extension, what's the API for that?
I've tried the following:
if (window.activeTextEditor) {
// ...
}
But the result is not the same as using editorTextFocus.

Wenfang Du
- 8,804
- 9
- 59
- 90
1
vote
1 answer
What does `workbench.action.terminal.switchTerminal` do?
Tried this command, seems to be doing nothing , does anyone know the purpose of it?

Wenfang Du
- 8,804
- 9
- 59
- 90
1
vote
1 answer
vscode use tab and shift tab for up and down in dropdown menu/quick open menus
When in drop down menus or quick open menus, by using keybindings like ctrl+p or ctrl+shift+p, how would I make it so tab and shift+tab go up/down the list?
Instead what happens when I use tab/shift+tab, is that it tabs across the editor.

karizma
- 284
- 2
- 11
0
votes
2 answers
How can I execute a fixed command in VS Code's debug console with a keyboard shortcut?
I am using Native Debug with GDB under VS Code. I can type any GDB command in the debug console. How can I run a fixed command in the debug console (not the terminal) using a shortcut?
I was only able to find editor.debug.action.selectionToRepl…

filo
- 223
- 3
- 14
0
votes
0 answers
How to configure completions and suggestions in VS Code to be triggered by a key?
Context: I appreciate the different completions and suggestions that VS Code can provide, from the language server, from GitHub Copilot, and from words in the document itself. However, I find it extremely irritating if things pop up while I type,…

A. Donda
- 8,381
- 2
- 20
- 49
0
votes
1 answer
How can I write a VS Code key binding to insert a new line when pressing space after a period?
I'm using VS Code to write LaTeX and doing version control using git. Therefore, I would like to have one sentence per line.
\section{Hello}
This is a sentence.
This is another sentence.
What I would like is for VS Code to automatically add a new…

eyldlv
- 1
- 1
0
votes
2 answers
VS Code shortcut key to hide/restore all view and panels but the editor panel
I usually have vs-code with the side bar and the command prompt panel open
And I have to successively press ctrl-b and ctrl-t to show hide each one of them and concentrate on the code
Is there a shortcut key to do both things?
I found this related…

opensas
- 60,462
- 79
- 252
- 386
0
votes
1 answer
How can I make easier-to-reach shortcuts for arrow keys in VS Code?
Alternate of arrow keys in VS Code? especially the right arrow key to move outside the double quotes without moving hand towards arrow keys.
I just want to know if there is already a shortcut available instead of key map manually.

Tahir Mahmood Kamboh
- 28
- 3