Is it possible to create a shortcut that runs a command on the current file?
I want a shortcut that runs ‘standardrb --fix CURRENT_FILE’.
Standardrb --fix
roeland
#1
0 Likes
OdatNurd
#3
This is what build systems are for; choose Tools > Build System > New Build System
from the menu and replace the stub content with the following, and then save it in the location Sublime will offer with a name of your choosing (make sure it has the sublime-build
extension):
{
"shell_cmd": "standardrb --fix \"${file}\"",
"selector": "source.ruby"
}
Make sure that in Tools > Build System
that the checkmark is next to either Automatic
or the entry with the name you saved the file as, and then while you’re editing one of your files you can use Tools > Build
or the key binding associated with it (visible in the menu) to run the command.
0 Likes