Skip to main content
Fix capitalization. Add syntax highlighting. Remove noise.
Source Link
wjandrea
  • 31.6k
  • 9
  • 67
  • 88

visual studio code Visual Studio Code keybindings - Running two or more commands with one shortcut

I have the following keybinding in VS codeCode which toggles the position of the cursor between the active document and built-in terminal:

  // Toggle between terminal and editor focus
{
    "key": "oem_8",
    "command": "workbench.action.terminal.focus"
},
{
    "key": "oem_8",
    "command": "workbench.action.focusActiveEditorGroup",
    "when": "terminalFocus"
}
  // Toggle between terminal and editor focus
{
    "key": "oem_8",
    "command": "workbench.action.terminal.focus"
},
{
    "key": "oem_8",
    "command": "workbench.action.focusActiveEditorGroup",
    "when": "terminalFocus"
}

Before i click the shortcut key to move the cursor to the terminal, i first have to save the active file.

I would therefore like to run the file saving command, which after searching on google i believe is :workbench.action.files.save

How would i do this please? iI have tried adding the above code snippet at the end of the "command" line but it has not worked.

cheers

visual studio code keybindings - Running two or more commands with one shortcut

I have the following keybinding in VS code which toggles the position of the cursor between the active document and built-in terminal:

  // Toggle between terminal and editor focus
{
    "key": "oem_8",
    "command": "workbench.action.terminal.focus"
},
{
    "key": "oem_8",
    "command": "workbench.action.focusActiveEditorGroup",
    "when": "terminalFocus"
}

Before i click the shortcut key to move the cursor to the terminal, i first have to save the active file.

I would therefore like to run the file saving command, which after searching on google i believe is :workbench.action.files.save

How would i do this please? i have tried adding the above code snippet at the end of the "command" line but it has not worked.

cheers

Visual Studio Code keybindings - Running two or more commands with one shortcut

I have the following keybinding in VS Code which toggles the position of the cursor between the active document and built-in terminal:

  // Toggle between terminal and editor focus
{
    "key": "oem_8",
    "command": "workbench.action.terminal.focus"
},
{
    "key": "oem_8",
    "command": "workbench.action.focusActiveEditorGroup",
    "when": "terminalFocus"
}

Before i click the shortcut key to move the cursor to the terminal, i first have to save the active file.

I would therefore like to run the file saving command, which after searching on google i believe is workbench.action.files.save

How would i do this? I have tried adding the above code snippet at the end of the "command" line but it has not worked.

Source Link
Nick
  • 3.7k
  • 6
  • 35
  • 58

visual studio code keybindings - Running two or more commands with one shortcut

I have the following keybinding in VS code which toggles the position of the cursor between the active document and built-in terminal:

  // Toggle between terminal and editor focus
{
    "key": "oem_8",
    "command": "workbench.action.terminal.focus"
},
{
    "key": "oem_8",
    "command": "workbench.action.focusActiveEditorGroup",
    "when": "terminalFocus"
}

Before i click the shortcut key to move the cursor to the terminal, i first have to save the active file.

I would therefore like to run the file saving command, which after searching on google i believe is :workbench.action.files.save

How would i do this please? i have tried adding the above code snippet at the end of the "command" line but it has not worked.

cheers