I have Markdown preview package installed in my sublime text and I want to create a shortcut / key binding for it, let's say:
ctrl + shift + p
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.
Users can customize their key bindings by creating a file named Default. sublime-keymap in their Packages/User/ directory. For example, the following will create a key binding to show unsaved changes, if any exist, via Ctrl+Shift+`.
The shortcut key for this purpose is Ctrl+Shift+P for Windows and Cmd+Shift+P for Mac.
In the ST console, enter sublime.log_commands(True)
to see what command is being executed form the command palette. Alternatively you can look in the Default.sublime-menu
file for the appropriate caption/command pair. After you've done that, you can create a custom key binding. To do this, open your user key binding file by going to Preferences -> Key Binding - User
. Enter something like the following.
[
{"keys": ["ctrl+shift+p"], "command": "<preview_command_here>"}
]
The settings file is just a list, so if you already have an entry, you do not need the square brackets.
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