Venkatesh Nadar
Venkatesh Nadar

Reputation: 142

how to pass dynamic argument in sublime text 3?

for eg : if I want to install npm package through keyboard shortcut in sublime text by selecting the text then every time the argument will be the one that I selected(using mouse/keyboard) before using keyboard shortcut to trigger.

Upvotes: 1

Views: 897

Answers (1)

OlivierBlanvillain
OlivierBlanvillain

Reputation: 7768

You could use the sublime-text-shell-command plugin. According to the documentation, the following should do exactly what you want:

[
  {
    "keys": ["ctrl+enter"],
    "command": "shell_command",
    "args": {
      "command": "npm install",
      "region": "arg"
    }
  }
]

Upvotes: 3

Related Questions