Quantcast
Channel: Active questions tagged visual-studio-code - Stack Overflow
Viewing all articles
Browse latest Browse all 97327

Run vscode command (not external process!) on file save

$
0
0

I have this handy little keyboard shortcut in my settings.json for vscode which reloads my repl:

{
  "key": "cmd+shift+r",
  "command": "workbench.action.terminal.sendSequence",
  "args": { "text": ":r\n" }
},

Now I would like this command to run on file save, without having to hit the shortcut. VSCode has an inbuilt setting editor.codeActionsOnSave, but the above command is not a code action. The extensions I have found are all for running shell commands.

Plus points for solutions which let me conditionally execute the command based on file extensions and whether my terminal is open and running the repl.


Viewing all articles
Browse latest Browse all 97327

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>