Mohamed

Beyond the borders of sanity

Sublime text 2 current path (plugin development)

Just a quick tip to find your sublime text 2 current path. If you ever find yourself writing a sublime plugin and want to get the current path, DO NOT use os.getcwd , it just doesn't work, and returns your system32 windows path. Instead, you should use the following method supplied by the sublime api to get the path to the packages folder, and then append to it the name of your package, and you're good to go:

import sublime
#############

dir = sublime.packages_path()
sphinxdir = os.path.join(dir, 'NAME_OF_YOUR_PACKAGE')

hope this spares some hours of frustration.

← Back


The people have spoken


comments powered by Disqus