There are times in Sublime Text when I want to show the current file in the sidebar and then navigate the folder structure.
This can be achieved using the reveal_in_side_bar and focus_side_bar , however they should be associated with two separate key combinations, so I have to make 2 key combinations to achieve my goal, when ideally I would like only one (I am lazy).
Can I associate multiple commands with a single key combination? for example something like this:
{ "keys": ["alt+shift+l"], "commands": ["reveal_in_side_bar", "focus_side_bar"] },
Decision
Based on @ artem-ivanyk and @d_rail answers
1) Tools β New plugin
import sublime, sublime_plugin class RevealInSideBarAndFocusCommand(sublime_plugin.WindowCommand): def run(self): self.window.run_command("reveal_in_side_bar") self.window.run_command("focus_side_bar")
Save as RevealInSideBarAndFocus.py
2) Sublime Text 2 β Preferences β Key Bindings - User
Bind it to a shortcut:
{ "keys": ["alt+shift+l"], "command": "reveal_in_side_bar_and_focus" }
sublimetext keyboard-shortcuts
James Hollingworth Mar 10 '12 at 12:50 2012-03-10 12:50
source share