Is it possible to chain key binding commands in sublime text 2?

前端 未结 8 1635
自闭症患者
自闭症患者 2020-11-29 18:06

There are times in Sublime Text when I want to reveal the current file in the side bar and then navigate around the folder structure.

This can be achieved using the

8条回答
  •  时光取名叫无心
    2020-11-29 18:46

    Updating @Artem Ivanyk's answer. I do not know what changed in Sublime, but that solution did not work for me, but I got this to work:

    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")
    

    .

    { "keys": ["ctrl+shift+8"], "command": "reveal_in_side_bar_and_focus" }
    

    Btw, I'm using Build 2220

提交回复
热议问题