Let's say I select some text in the editor. I would like to define my own Python functions or scripts that:
Moreover, I would like to ideally register these functions or scripts as a VSCode commands (with a specific commandID
s) that I can define myself and to the command palette in VSCode. By doing so, I can bind them to a shortcut in keybindings.json
with specific shortcuts and when clauses.
Is there any built-in functionality in VSCode to do this? If not, what set of steps can I follow to do it?
Expand the Search widget to display the Replace text box. When you type text into the Replace text box, you will see a diff display of the pending changes. You can replace across all files from the Replace text box, replace all in one file or replace a single change.
Select and activate an environment# By default, the Python extension looks for and uses the first Python interpreter it finds in the system path. To select a specific environment, use the Python: Select Interpreter command from the Command Palette (Ctrl+Shift+P).
Disclaimer: We are the author of vscode-texty extension
Based on OP's suggestion, we have enhanced the vscode-texty to add this support.
Now it supports following capabilities.
One issue (due to limitation of vscode api) is that, custom commands does not appear in the standard command palette. So to invoke via UI, you first invoke command Texty: Process selections using custom command
, which shows all available commands as quick pick options, executes the selection.
It is technically possible, but I'm unaware of any extension that currently supports this idea. You will probably need to write your extension to do this.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With