10

EDIT: Question is about Sublime 3. Edited title for clarity.

I have a couple of projects that require me to connect through SSH. This is fine except that SublimeLinter-php and GitGutter execute extremely slowly over SSH.

Obviously, I can manually enable/disable as needed; but that appears to require restarting Sublime every time I switch between a local project and an SSH project.

I'm probably dreaming here, but ideally, there would be a way for me to enable/disable packages on a project-by-project basis, but I have not found any way to do this.

Is this possible or not? If possible, how do I do it?

Trip
  • 2,018
  • 15
  • 27

1 Answers1

6

In a .sublime-project file there are three main keys: folders, settings, and build systems. You should be able to add a "settings" section like so (remember that the files are JSON-formatted):

{
    "folders":
    [
        {
            "follow_symlinks": true,
            "path": "/path/to/my/folder"
        }
    ],
    "settings":
    {
        "ignored_packages": 
        [
            "Vintage",
            "SublimeLinter-php",
            "GitGutter"
        ]
    }
}

You should be able to add any item found in Preferences -> Settings-Default (or Settings-User, for that matter) to the "settings" array. For complete documentation on .sublime-project files, check out the Sublime website.

MattDMo
  • 100,794
  • 21
  • 241
  • 231
  • 1
    In my testing, this does not appear to work. Before I opened a non-SSH project, it looked like SublimeLinter-php had been successfully disabled, but GitGutter was still running. After the non-SSH project was opened, neither package was ignored. – Trip Mar 26 '14 at 21:15
  • @Trip - that's no good. Have you tested in both ST2 and ST3? It seems to be a lot easier to ignore and restart plugins in 2 vs. 3, which needs to be restarted (in my experience) for changes to stick in some circumstances. Also, go to `Preferences -> Package Settings -> Package Control -> Settings-User` and ensure the plugin names are spelled and capitalized correctly - not sure if it'll make a difference or not, but you can try. – MattDMo Mar 26 '14 at 21:30
  • I haven't tried with ST2, but if the network connection to this remote server doesn't get any faster, I'll probably have to give it a shot. Would feel weird to "downgrade", though. FWIW, spelling and CAPS are/were correct. – Trip Mar 26 '14 at 21:38
  • @Trip - is SSH slow for everything, or just saving? If you haven't already seen it, check out [my answer to this question](http://stackoverflow.com/questions/20634684/what-is-sublime-text-doing-when-i-save-a-file/20639093#20639093) about saving over the network and disabling `"http://stackoverflow.com/questions/20634684/what-is-sublime-text-doing-when-i-save-a-file/20639093#20639093 – MattDMo Mar 26 '14 at 22:02
  • I actually read that yesterday and tried it even though I was having typing issues (huge keystroke lag) rather than save issues. The connection is a volatile VPN tunnel to a private dev server. Some days are better than others, but I've never seen keystroke lag like this. – Trip Mar 26 '14 at 23:02
  • This solution does not seem to work for GitGutter under ST3. A Sublime moderator commented that disabling a package on a per project basis is not possible, but the comment is from Oct 2013 so perhaps (hopefully) this has changed. https://forum.sublimetext.com/t/ignored-packages-setting-in-project-ignored/6525/7 – Taylor D. Edmiston Dec 28 '16 at 20:52
  • 3
    The [documentation](http://www.sublimetext.com/docs/3/settings.html) says "Application Behavior Settings are global to the entire application and can not be controlled by a syntax specific settings file, nor the settings key in a .sublime-project", so that does not work. – jpsecher Sep 06 '18 at 10:50