Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Run Commands ViewNew to Visual Studio Code? Get it now.

Run Commands View

Alexander

|
1,215 installs
| (1) | Free
Run commands from its own view
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Run Commands View

demo

It's also possible to run commands from Quick Open with run-commands-view.openAsQuickPick command:

demo quick pick

"run-commands-view.commands": {
	// Place commands here
},

The simplest example (string):

"💤 Toggle Status Bar": "workbench.action.toggleStatusbarVisibility",

Use vscode product icons Icons List

"$(zap|zapcolor) Zap": "workbench.action.toggleStatusbarVisibility",
"$(flame|errorForeground) Flame": "workbench.action.toggleStatusbarVisibility",

Optionally, define colors (in settings.json)

"workbench.colorCustomizations": {
	"zapcolor": "#fff000",
},

icons demo

Specifying arguments (object):

"🔶 Insert text": {
	"command": "editor.action.insertSnippet",
	"args": { "snippet": "text" }
},

Running multiple commands in sequence (array of strings)

"📒 Toggle Minimap & Status Bar": [
	"editor.action.toggleMinimap",
	"workbench.action.toggleStatusbarVisibility"
],

Specifying the delay

"⏳ Delay": [
	"workbench.action.toggleSidebarVisibility",
	{
		"command": "workbench.action.toggleSidebarVisibility",
		"delayBefore": 1000,// <=====
	}
],

Using folders/hierarchy (nested commands)

"Toggle Settings ====================": {
	"items": {
		"🔋 Toggle Status Bar": "workbench.action.toggleStatusbarVisibility",
		"🗺 Toggle minimap": "editor.action.toggleMinimap"
	}
},

Register command to invoke it with a keybinding

"📜 Toggle sidebar and minimap": {
	"registerId": "toggleSidebarMinimap",// <=====
	"sequence": [
		"workbench.action.toggleSidebarVisibility",
		"editor.action.toggleMinimap"
	]
},

Register command without showing it in the View

"📜 Toggle sidebar and minimap": {
	"registerId": "toggleSidebarMinimap",
	"excludeFromView": true,// <=====
	"sequence": [
		"workbench.action.toggleSidebarVisibility",
		"editor.action.toggleMinimap"
	]
},

Additional commands

Open Folder

"📁 Open Folder": {
	"command": "openFolder",
	"args": "C:\\Users"
},

Open File

"📝 Open File": {
	"command": "openFolder",
	"args": "C:\\inbox.md"
},

Use Terminal

"1️⃣ run in teminal": {
	"command": "workbench.action.terminal.sendSequence",
	"args": {
		"text": "npm run test\r"
	}
},
"2️⃣ create new teminal": {
	"sequence": [
		{
			"command": "workbench.action.terminal.new"
		},
		{
			"command": "workbench.action.terminal.sendSequence",
			"args": {
				"text": "npm run test\r"
			}
		}
	]
},

Toggle Settings

"🔢 Toggle Line Numbers": {
	"command": "run-commands-view.toggleSetting",
	"args": {
		"setting": "editor.lineNumbers",
		"value": "on,off"
	}
},

Increment/decrement Settings

"fontSize ➕": {
	"command": "run-commands-view.incrementSetting",
	"args": {
		"setting": "editor.fontSize",
		"value": 0.5
	}
},
"fontSize ➖": {
	"command": "run-commands-view.decrementSetting",
	"args": {
		"setting": "editor.fontSize",
		"value": 0.5
	}
},

Add property to Settings object (nesting supported)

"✨ add item to object": {
	"command": "setting.merge",
	"args": {
		"setting": "[markdown]",
		"value": {
			"editor.lineHeight": 40
		}
	}
},

Results in:

"[markdown]": {
	"editor.wordWrap": "on",
	"editor.quickSuggestions": false,
+	"editor.lineHeight": 40
},

How to build

Before running this extension in debugger you must first execute

yarn watch

or

npm run watch
  • Contact us
  • Jobs
  • Privacy
  • Terms of use
  • Trademarks
© 2019 Microsoft