Basically I’m using Sublime Text 2 to edit and (hopefully) run Python files. At the minute though, to run a file, I’m having to tap Ctrl + Shift + P, type at least two letters (P, Y) and hit enter. Then the script runs. I want to assign this to a hotkey. I therefor ventured into the world of sublime-keymap files, and nearly died of boredom.
A sample command:
{ "keys": ["ctrl+v"], "command": "paste" },
My attempt:
{ "keys": ["f5"], "command": "SublimeREPL: Python - RUN current file" },
Could someone please inform me of what mistake it is that I’m making?
How can I go about not making that mistake?
You may try the build system, as morphyn suggested, but I’ll address the issue of using SublimeRepl (and key bindings). The command you want isn’t the text from the command palette, but the command actually running. After a quick look through the plugin, I tracked down the commands file here. This file specifies what will be shown in the command palette, and what will be run when selected. For your specific case, you will want to create the following in your User defined key maps (accessible through
Preferences -> Key Bindings - User, but I think you found that already).I haven’t run it myself, but that should work.
Hope that helps.