Sublime Forum

Open directories AS new projects with command-line

#1

Most of the time, a project is contained within a root directory… at least for me.

I do like the “project” system for certain circumstances, but generally, I feel like the project file gets in the way for my needs.

With my current work flow (sorry, but it’s with textmate…)

cd path/to/project git pull mate .

This opens a fresh instance of TM with the file tree root being the directory you’re in, no project files required…

I’d love the command-line tool subl to accept a directory, and then just open a fresh instance of the editor with only that folder added to the project…

reasonable?

0 Likes

#2

It does that currently?

0 Likes

#3

I do this as well on Windows 7. But I created extra context menus for this.

reg add "HKLM\\SOFTWARE\\Classes\\Directory\\shell\\subl" /t REG_SZ /ve /d "Open in sublime text"
reg add "HKLM\\SOFTWARE\\Classes\\Directory\\shell\\subl" /t REG_EXPAND_SZ /v "Icon" /d "${subl},0"
reg add "HKLM\\SOFTWARE\\Classes\\Directory\\shell\\subl\\command" /t REG_SZ /ve /d "${subl} --new-window \"%1\" "

reg add "HKLM\\SOFTWARE\\Classes\\Directory\\Background\\shell\\subl" /t REG_SZ /ve /d "Open in sublime text"
reg add "HKLM\\SOFTWARE\\Classes\\Directory\\Background\\shell\\subl" /t REG_EXPAND_SZ /v "Icon" /d "${subl},0"
reg add "HKLM\\SOFTWARE\\Classes\\Directory\\Background\\shell\\subl\\command" /t REG_SZ /ve /d "${subl} --new-window \"%V\""

I’m slowly working my out of the command prompt and into using plugins and build scripts to do what I need within ST2.
The command palette is a wonderful thing.

0 Likes