Created
June 12, 2013 21:46
-
-
Save jacob-ogre/5769414 to your computer and use it in GitHub Desktop.
NerdTree-like behavior for Sublime Text 2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sublime, sublime_plugin | |
class NerdTreeCommand(sublime_plugin.WindowCommand): | |
def run(self): | |
self.window.run_command("toggle_side_bar") | |
self.window.run_command("focus_side_bar") |
import sublime, sublime_plugin
class NerdTreeCommand(sublime_plugin.WindowCommand):
def run(self):
was_visible = self.window.is_sidebar_visible()
self.window.run_command("toggle_side_bar")
if was_visible:
self.window.run_command("focus_group", { "group": 0 })
else:
self.window.run_command("focus_side_bar")
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I use 'nt' in Vim to toggle NerdTree; in ST2, to avoid any conflict, use 'nt' to open and 'tn' to close the sidebar (and return focus to group 0).