2- Override [`,`] to:
[
{ "keys": ["<Your shortucut>"], "command": "exec", "args": { "cmd"["<Path to your command>"]} }
]
Where <Your shortcut> could be f1, ctrl+shift+f1, etc. and <Path to your command> echo, /home/garou/scripts/my_script.py, ls, etc.
Example
[
{ "keys": ["f1"], "command": "exec", "args": { "cmd": ["/media/data/Scripts/myScript"]} },
]
sublime rulez
ReplyDeleteThank you.
ReplyDeleteIs there any way to make the path to the script relative to the sublime data directory? I have an issue where I have synchronised settings across more than one computer but the location for the data directory (i.e. the username in Windows) changes, and I want to specify a script which lives in the data folder.
ReplyDeleteNed Martin, I'm currently not using sublime, but the easy way to do this, is simple create a script that reads files (and execute programs) the lives at your specific directory. For example something like:
ReplyDelete.bat
cd path\to\your\directory
program.exe
.sh
#!/bin/sh
cd /path/to/your/directory
sh program.sh
Everything you need to do (for example, change directories or remove files or create) you should and can do over your script.
I hope it helps.
I used this method. I am getting "[Errno 8] Exec format error" while executing from sublime key press.
ReplyDeleteThe same script I use in cmd works fine on terminal.
On ubuntu 12.04.