Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Execute pre-configured commands #3

Open
W4RH4WK opened this issue Aug 27, 2016 · 4 comments
Open

Execute pre-configured commands #3

W4RH4WK opened this issue Aug 27, 2016 · 4 comments
Assignees

Comments

@W4RH4WK
Copy link

W4RH4WK commented Aug 27, 2016

Is it possible to have certain commands configured/aliased in the user's config + binding a keyboard shortcut to it?

What I am thinking about is this, there are a couple of extensions around for "opening a (external) terminal", "open file in vim", "open file in browser", ... and I use some of them and would like to replace it with one, which can just run any command with a given shortcut.

If course some parameters would need to be passed like the current filename, working directory, line number, ...

@Fred-Vatin
Copy link

Key bindings to user configured commands would be awesome.

@bbenoist
Copy link
Owner

Thank you guys for the feedback!

Oh, and sorry @W4RH4WK for being late to reply 😕

Unfortunately, there is no programmatic way for extensions to dynamically register keybindings in vscode.

The only entry point for keybindings appears to be the package.json file which should not be modified by extensions.

A potential workaround would be to use the tasks.json file which is aimed at defining tasks at a project level. See "Binding keyboard shortcuts to tasks" for more info...

Hope this helps...

@bbenoist bbenoist self-assigned this Mar 23, 2017
@Fred-Vatin
Copy link

We only need unique command name for each new user created command. Then one could use it to user keybindings.

@s-oram
Copy link

s-oram commented Apr 5, 2018

What I am thinking about is this, there are a couple of extensions around for "opening a (external) terminal", "open file in vim", "open file in browser", ... and I use some of them and would like to replace it with one, which can just run any command with a given shortcut.

Yes, this exactly.

Edit: Just found the "Open in Application" extension which handles the above use case.
https://marketplace.visualstudio.com/items?itemName=fabiospampinato.vscode-open-in-application

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants