They are both easily doable
command for "Open Project..." is: openProject
so just bind it to whatever key u want...
<binding key="ctrl+shift+p" command="openProject"/>
For specific directories/project then is the same command with the directory/project as paramater...
<binding key="ctrl+shift+p" command="openProject 'c:/Documents and Settings/eb/Desktop/WORK/.SUBLIMEPROJECTS/bbcom.sublime-project'"/>
there's a few rules when passing the a directory/project path as parameter...
1st: directory separator has to be forward slash "/" not the backslash "\"
2nd: If it contains spaces you need to enclose it in quotes. (single or double, doesn't matter.)
Second request requires a little more code but still not really hard. Mainly because all juicy code is done for you already in the "open from current directory..." plugin. We just gonna modify it to make it work for projects
"""Open project files from specific directory in quickPanel :)"""
allowedExtensions = '.sublime-project']
def wantFile(self, f):
root, ext = os.path.splitext(f)
return os.path.isfile(f) and ext in self.allowedExtensions
def run(self, window, args):
projectPath = str(args)
displayFiles = [f for f in os.listdir(projectPath) if self.wantFile(projectPath+'/'+f)]
projectFilesPath = [projectPath+'/'+str(*displayFiles)]
window.showQuickPanel("", "openProject", projectFilesPath, displayFiles,
sublime.QUICK_PANEL_FILES | sublime.QUICK_PANEL_MULTI_SELECT)[/code]
Now just bind the command to any key you want and you have open project command with quickpanel with your specific directory! :smile:
[code]<binding key="ctrl+f8" command="quickOpenProject 'c:/Documents and Settings/eb/Desktop/WORK/.SUBLIMEPROJECTS'"/>
As you can see just pass the directory you keep your sublime-project files on as parameter and that's it
This allows you to have flexibility to have as many keybindings as you want to any specific directory in case you don't keep all your projects in one folder.
Anyways here is a nice example to let you see how powerful sublime is/can be if you get familiar with it Enjoy it!