Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Is it possible to auto focus the side-bar upon opening? I am not able to form a proper command in my keymap file...

I need to combine

toggle_side_bar

with

focus_side_bar
share|improve this question

2 Answers 2

See the answer to this question: http://stackoverflow.com/questions/9646552/is-it-possible-to-chain-key-binding-commands-in-sublime-text-2. Change reveal_in_side_bar to toggle_side_bar

Edit: It wasn't working for me either, but I thought it was something I was doing. Anyway, this works (for now):

import sublime, sublime_plugin

class ToggleSideBarAndFocusCommand(sublime_plugin.WindowCommand):
    def run(self):
        self.window.run_command("toggle_side_bar")
        self.window.run_command("focus_side_bar")

Run in python terminal with:

window.run_command("toggle_side_bar_and_focus")

Keymap:

{ "keys": ["ctrl+shift+9"], "command": "toggle_side_bar_and_focus" },
share|improve this answer
    
Is this working for you? I can't seem to get it right. This is what I've got: gist.github.com/3995023; does nothing –  mreq Nov 1 '12 at 16:58

I've wrote a new plugin to do exactly the same you mentioned, take a look

https://github.com/miguelgraz/FocusFileOnSidebar

share|improve this answer
    
Yes I catched it from the Package Control's RSS :) Will check it out, thanks! –  mreq Jun 11 at 18:22
    
Hope it can be useful, anything please feel free to ping me! =) –  Miguelgraz Jun 11 at 18:25

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.