I am new to Sublime Text 2 on Mac OS. I installed the package SublimeREPL.
Is it possible to create a keyboard shortcut to run the file with SublimeREPL?
More precisely, here is a screenshot. I want to avoid going through this menu and run quickly with a keyboard shortcut.
Select the Key Bindings - User item under Sublime's Preferences, then add the following example line: {"keys": ["ctrl+shift+c"], "command": "insert_snippet", "args": {"contents": "hello!"}} This will add a CTRL + SHIFT + C shortcut to insert the hello! snippet.
You can set a keyboard shortcut for the command in your screenshot using Sublime key-bindings.
Open Sublime.
Go to Preferences > Key Bindings - User
Add these lines to the opened file between brackets:
{ "keys": ["ctrl+alt+b"], "command": "run_existing_window_command", "args": { "id": "repl_python_run", "file": "config/Python/Main.sublime-menu" }}
Save it.
It's done! You can type any key-combinations instead of "ctrl+alt+b"
, but make sure it's not reserved by Sublime itself (check in Preferences > Key Bindings - Default)
Note: This works for Sublime in Windows. I don't think there would be any difference for Sublime on Mac OS/Linux.
You can set keyboard shortcuts for any menu item that you can select, in any app.
Go to System Preferences → Keyboard → Shortcuts → App Shortcuts
Click the + to add a new shortcut.
Set the Application to Sublime Text.app
, the Menu Title to the exact name of the menu option, and choose a Keyboard Shortcut.
Click Add.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With