sabitovvt / vscode-favorites-panel

VSCODE Extension favorites panel
GNU General Public License v3.0
10 stars 12 forks source link

Possible open directly a setting like "editor.wordWrap" or "editor.tabSize"? #12

Open carloscadux opened 2 years ago

carloscadux commented 2 years ago

Hi, I'd appreciate your help. I'm trying trying to set 'Favorites panel' to run a command that opens directly a setting like "editor.wordWrap" or "editor.tabSize". Is it possible? How to? Thank you, Carlos

CopyQ CXSuAk

sabitovvt commented 1 year ago

You can replace a substring in the .vscode/settings.json file (but it must already exist)

and press Ctrl+S The settings file will be saved.

"favoritesPanel.commands": [ { "label": "editor.wordWrap", "description": "- off", "arguments": [ ".vscode\settings.json", "\"editor.wordWrap\": \"on\"", "\"editor.wordWrap\": \"off\"", "replace" ], "command": "insertNewCode", "icon": "find-replace", } ],

You can use regular expressions.

or better so: { "label": "toggleWordWrap", "command": "runCommand", "arguments": [ "editor.action.toggleWordWrap" ], "icon": "edit" }