百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
V

vscode-commands

> 开发工具
开源

一个 VSCode 扩展,可从树状视图/状态栏/快速选择运行命令。

100 stars0 点赞2 次浏览
访问官网GitHub

工具介绍

一个 VSCode 扩展,可从树状视图/状态栏/快速选择运行命令。

Features

  • Run commands with arguments ("args")
  • Run multiple commands (in sequence)
  • Use Tree View / Quick Pick / Status Bar / Document link to run commands
  • Assign keyboard shortcut to specified commands
  • Create alias for existing commands

Simple command

javascript
"Toggle activity": "workbench.action.toggleActivityBarVisibility",

Command with arguments

javascript
"Typing": {
    "command": "editor.action.insertSnippet",
    "args": {
        "snippet": "Typing... ",
    },
},

Multiple commands (sequence)

javascript
"Toggle multiple settings": {
    "sequence": [
        "editor.action.toggleMinimap",
        "workbench.action.toggleStatusbarVisibility",
    ],
},

Tree View icons list | colors

javascript
"GitHub": {
    "icon": "github",
},
"Flame": {
    "icon": "flame",
    "iconColor": "errorForeground",
},

Folders (nested items)

javascript
"folder": {
    "nestedItems": {
        "Flame": {
            "icon": "flame",
            "iconColor": "errorForeground",
        },
        "Trusted": {
            "icon": "workspace-trusted",
            "iconColor": "terminal.ansiGreen",
        },
    },
},

Quick Pick commands.openAsQuickPick

Status Bar

javascript
"Toggle line numbers": {
    "command": "commands.toggleSetting",
    "args": {
        "setting": "editor.lineNumbers",
        "value": [
            "on",
            "off",
        ],
    },
    "statusBar": {
        "alignment": "left",
        "text": "",
        "priority": -9999,
    },
},

Commands (12)

Command Description
commands.openAsQuickPick Commands: Open as Quick Pick
commands.selectAndRun Commands: Select and run command
commands.rerun Commands: Rerun last command
commands.suggestCommands Commands: Suggest (autocomplete) commands
commands.suggestCodicons Commands: Suggest Codicons
commands.suggestVariables Commands: Suggest variables that are supported by this extension's variable substitutions, e.g: ${workspaceFolderBasename}. Docs
commands.suggestSettings Commands: Suggest setting ids (user & workspace).
commands.suggestColors Commands: Suggest theme color ids theme-color.
commands.newCommand Commands: Add new command to the list
commands.escapeCommandUriArgument Commands: Escape command uri argument
commands.startTerminalWatch Commands: Start Terminal Watching
commands.extensionModifiedSettings Commands: Show modified settings from Extension

Settings (18)

Setting Default Description
commands.commands {} Main extension property. Commands that will be rendered in the View.
commands.variableSubstitutionEnabled true Allow "args" to replace variables: Docs.
commands.workspaceCommands {} Commands that will be rendered in the View, specific to the workspace.
commands.alias {} Use shorter command ids. Extension registers aliased commands so that they can be also used in keybindings.
commands.cycle {} Register a new command (id will be commands.cycle.${OBJECT_KEY}) that runs one command from the list. If the last command was the last item on the list then run the first command from the list.
commands.showKeybindings false Whether or not to show keyboard shortcuts assigned to command contributed by user. (Currently only displayed in Tree View).
commands.treeViewCollapseFolders false Collapse folders by default. Requires reload before being applied.
commands.treeViewStatusBarVisibleSymbol "" Symbol used in the tree view to indicate that command is also visible in the status bar.
commands.treeViewStatusBarInvisibleSymbol "" Symbol used in the tree view to indicate that status bar item exists but is invisible ("hidden": true,).
commands.treeViewWorkspaceCommandSymbol "" Symbol used in the tree view to indicate workspace command (from #commands.workspaceCommands#) setting.
commands.statusBarDefaultText "same" Controls the text of Status Bar item when adding from Tree View context menu.
commands.statusBarDefaultPosition "left" Where to put command on Status Bar (left or right).
commands.quickPickIncludeAllCommands false When checked - include all commands from Command Palette to the Quick Pick.
commands.populateCommandPalette false Adds all items to Command Palette (Requires editor reload after every change of main config #commands.commands#).
commands.documentLinksEnabled false Run commands as links in documents. Links have format @command?args@.
issues/2
commands.documentLinksPattern "" Glob for #commands.documentLinksEnabled#. Example: **/*.{ts,js} - only enable in TypeScript & JavaScript files.
commands.toggleSettings.showNotification false When enabled - show notification after using commands.toggleSetting or commands.incrementSetting.
commands.watchTerminalStatusBar {...} Enable status bar indicator that is supposed to show the status of a running in terminal command (dev | watch...). Will only work with contributed terminal profile Commands:Watch. Status of errors might not be perfect because it relies on simple text match.
…

Built-in commands (with args)

type Type text into active editor

javascript
"Typing": {
    "command": "type",
    "args": {
        "text": "---",
    },
},

workbench.action.tasks.runTask Run task by its label

javascript
// tasks.json
{
    "label": "hello",
    "type": "shell",
    "command": "echo Hello",
},
// commands
"Run task": {
    "command": "workbench.action.tasks.runTask",
    "args": "hello",
},

editor.action.insertSnippet Insert Snippet

javascript
"Insert snippet": {
    "command": "editor.action.insertSnippet",
    "args": {
        "snippet": "$BLOCK_COMMENT_START ${0:?} $BLOCK_COMMENT_END",
    },
},

workbench.action.terminal.sendSequence Send text to active terminal

javascript
"Terminal: Run Watch": {
    "command": "workbench.action.terminal.sendSequence",
    "args": {
        "text": "npm run watch\r",
    },
},

workbench.action.quickOpen Quick access

Can open Quick Pick with prefilled prefix (@... - symbol, view ... - open view, ...)

javascript
"Quick open (symbol)": {
    "command": "workbench.action.quickOpen",
    "args": "?",
},

workbench.action.openSettings Open settings with prefilled input value

javascript
"Open Settings": {
    "command": "workbench.action.openSettings",
    "args": "commands",
},

workbench.action.openGlobalKeybindings Open keybindings with prefilled value

javascript
"Quick Keybindings Editor": {
    "command": "workbench.action.openGlobalKeybindings",
    "args": "commands.",
},

workbench.extensions.search Open Extensions View with prefilled value

javascript
"Quick Extensions View": {
    "command": "workbench.extensions.search",
    "args": "@builtin",
},

editor.action.codeAction Execute code action

javascript
"Organize imports": {
    "command": "editor.action.codeAction",
    "args": {
        "kind": "source.organizeImports",
    },
},

workbench.action.findInFiles Open search with specified args

javascript
"Search with args": {
    "command": "workbench.action.findInFiles",
    "args": {
        "query": "TODO",
        "isRegex": false,
        "isCaseSensitive": false,
        "matchWholeWord": false,
        "preserveCase": false,
        "excludeSettingAndIgnoreFiles": true,
        "triggerSearch": true,
        "onlyOpenEditors": false,
        // "replace": "",
        // "filesToInclude": "",
        // "filesToExclude": "",
    },
},

editor.actions.findWithArgs Open Editor Find Widget

javascript
"Find Widget with args": {
    "command": "editor.actions.findWithArgs",
    "args": {
        "searchString": "TODO",
        "replaceString": "",
        "isRegex": false,
        "isCaseSensitive": false,
        "matchWholeWord": false,
        "preserveCase": false,
        "findInSelection": false,
    },
},

search.action.openNewEditor Open Search Editor with specified args

javascript
"Open search editor with args": {
    "command": "search.action.openNewEditor",
    "args": {
        "query": "TODO",
        "isRegexp": false,
        "isCaseSensitive": false,
        "matchWholeWord": false,
        "preserveCase": false,
        "excludeSettingAndIgnoreFiles": true,
        "triggerSearch": true,
        "contextLines": 2,
        "showIncludesExcludes": true,
        // "filesToInclude": "",
        // "filesToExclude": "",
    },
},

cursorMove Move cursor to a logical position in the view

Arguments object:

  • to A mandatory logical position value providing where to move the cursor.

'left', 'right', 'up', 'down', 'prevBlankLine', 'nextBlankLine', 'wrappedLineStart', 'wrappedLineEnd', 'wrappedLineColumnCenter' 'wrappedLineFirstNonWhitespaceCharacter', 'wrappedLineLastNonWhitespaceCharacter' 'viewPortTop', 'viewPortCenter', 'viewPortBottom', 'viewPortIfOutside'

  • by Unit to move. Default is computed based on 'to' value.

'line', 'wrappedLine', 'character', 'halfLine'

  • value Number of units to move. Default is '1'.
  • select If 'true' makes the selection. Default is 'false'.
javascript
"Cursor move 10 down": {
    "command": "cursorMove",
    "args": {
        "to": "down",
        "by": "line",
        "value": 10,
    },
},

editorScroll Scroll editor in the given direction

Arguments object:

  • to A mandatory direction value (up or down).
  • by Unit to move. Default is computed based on 'to' value. (line, wrappedLine, page, halfPage).
  • value: Number of units to move. Default is 1.
  • revealCursor: If 'true' reveals the cursor when it is outside view port.
javascript
"Scroll 10 lines down": {
    "command": "editorScroll",
    "args": {
        "to": "down",
        "by": "line",
        "value": 10,
        "revealCursor": true,
    },
},

moveActiveEditor Move the active editor by tabs or groups

  • to String value providing where to move (left or right).
  • by String value providing the unit for move (by tab or by group).
  • value Number value providing how many positions or an absolute position to move.
javascript
"Move editor to the left": {
    "command": "moveActiveEditor",
    "args": {
        "to": "left",
        "by": "tab",
        "value": 50,
    },
},

vscode.setEditorLayout Sets the editor layout

Example for a 2x2 grid:

javascript
"2x2 grid": {
    "command": "vscode.setEditorLayout",
    "args": { "orientation": 0, "groups": [{ "groups": [{}, {}], "size": 0.5 }, { "groups": [{}, {}], "size": 0.5 }] },
},

editor.emmet.action.wrapWithAbbreviation Wrap text with emmet

javascript
"Wrap in div": {
    "command": "editor.emmet.action.wrapWithAbbreviation",
    "args": {
        "abbreviation": "div",
        "language": "html",
    },
},

workbench.action.openSettingsJson Opens settings.json file

javascript
"Reveal setting json": {
    "command": "workbench.action.openSettingsJson",
    "args": {
        "openToSide": true,
        "revealSetting": {
            "key": "editor.fontSize",
        },
    },

Issues· 7 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

TypeScriptcommandrunsequencestatus-bar

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类开发工具
定价开源

> 相关工具

V
VS Code
流行的开源代码编辑器
G
Git
分布式版本控制系统
V
Vite
下一代前端构建工具