SublimeText / PackageDev

Tools to ease the creation of snippets, syntax definitions, etc. for Sublime Text.
MIT License
436 stars 83 forks source link

Command to symlink a folder on the filesystem to Packages #128

Closed michaelblyons closed 5 years ago

michaelblyons commented 7 years ago

I may be Doing It WrongTM, but when I want to tinker with someone's ST build, my SOP looks like the installation instructions for the default language packages. That is, git clone where I expect to do the tinkering and then create a symlink (for whatever OS) into the Packages folder.

If this workflow is normal, I'd like to be able to do that from PackageDev commands. Ideally, it does all these:

If this is not normal, please tell me what I should be doing instead. 😉

FichteFoll commented 7 years ago

I can't exactly say that I do this for any package outside of the default packages repo (where it is a requirement basically), but I can see why people would do it.

However, what I don't see is why this would be (much) faster than just running the command on a terminal. I'd like to see if there is more interest for this before I add it.

michaelblyons commented 7 years ago

Does this mean that your Packages directory is full of git repos? I was secretly hoping that other people had a better system than I do, but I'd rather keep my repos in the places I have already filed them.

I'll admit, the command line is sufficiently quick on *Nix systems where I have a shell up all the time. But sometimes I do work on Windows, and I have to look up the syntax (and often fiddle with it to make the expansions work right) every single time.

No worries on waiting for more interest. If you think it's a reasonable addition to PackageDev, I may work on it myself. (No promises, yet, though.) If not, I may make a separate package.

FichteFoll commented 7 years ago

I'll consider it over the next week but it probably won't make the cut for 3.0. Additionally I worry about the UX aspect because there is no folder browser api in sublime text and that seems to be a core aspect of your proposal. The only way for this I see currently would be piggybacking of the one st itself uses for project folders and propose to symlink the current project folder to the packages folder.

michaelblyons commented 6 years ago

In case it is helpful to others, this is what I've been using on macOS:

# Link a folder to ST3's packages location
function ln_st3 {
    local repo=${1?"Folder is required for ST3 alias"}
    local stalias=${2:-${1%/}}
    local pkgdir="$HOME/Library/Application Support/Sublime Text 3/Packages"
    ln -hsfi "$(pwd)/$repo" "$pkgdir/$stalias"
}
FichteFoll commented 5 years ago

I don't see a good way to implement this.

I believe this belongs to your cloning workflow and shouldn't need to be handled by PD. Personally, I create symlinks with ranger, my file manager, or my shell where I have tab completion and that is faster than any reasonable implementation inside ST that I can think of.