1

I want to use sublime text to edit scripts, and it could be helpful to "evaluate" (run) a line in the command line, right in sublime text.

I thought I'd do this with the Shell Command Plugin, which allows me to run command line commands, and open the output in a new windows.

Now, I'm trying to tie a keybinding to the shell_command, so that it uses the current line as an argument, thus allowing me to "execute" arbitrary lines in my script, for testing.

What I have

{ "keys": ["ctrl+enter"], "command": "shell_command", "args": {
    "command": "cmd /c",
    "syntax": "Batch File",
    "region": "arg",
    "wait_for_completion": true,
    "title": "Output",
    "panel": true
}},

This would use the current word under courser and send it to commandline (which isnt useful), but if you manually select all the line, then it sends all the line. Otherwise, it send the whole file (also useful, but a bit dangerous :)

how can I make it send just the line as input?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.