Gravy
Gravy

Reputation: 12445

Sublime Text - Unable to edit package settings

I am trying to edit the settings for an installed package for Sublime Text.

Background:

  1. Installed Laravel 4 Artisan package via Package Control: Install Package.
  2. Trying to run Artisan commands returns an error message:

    Laravel requires the Mcrypt PHP extension.

  3. Via terminal, artisan works fine. This leads me to believe that the PHP version used by Laravel 4 Artisan in Sublime Text is different from the version set up in my .bash_profile.
  4. In the terminal, which php returns /Applications/MAMP/bin/php/php5.4.10/bin/php
  5. In Sublime Text, Package Settings > Laravel 4 Artisan > Settings - Default points to:

    {
        "php_path": "php"
    }
    
  6. These settings seem to be read-only. I cannot even change the text, let alone save it with the new PHP location.

Any ideas or am I missing something simple?

Upvotes: 11

Views: 7122

Answers (3)

Jason Bishop
Jason Bishop

Reputation: 11

Also in case anyone is still struggling after doing this, remember to restart SublimeText to enable.

Upvotes: 1

skuroda
skuroda

Reputation: 19754

Happy to see you solved your problem. I'll clarify a bit to help anyone else who comes across this. You are correct in the fact that the settings are merged. The load order determines how these files are merged. The User folder is always last. So whatever you specify there will always be taken over that of previous configurations.

Depending on how you installed your plugin, the "Default" settings that came with the plugin may be overwritten. So you don't want to make any changes there that you hope to persist, so placing them in the User folder is the correct thing to do. As an additional note, you don't have to copy the entire contents of the "default" settings. Rather, you only need to specify the settings you want to override. Things will be merged appropriately.

One last thing, I don't believe ST2 makes the default settings read only. I do know ST3 does (well based on where it is installed). Be sure to post questions with the correct tag (sublimetext3 in this case). Was to long for a comment, but I hope this helps clarify things for you.

Upvotes: 6

Gravy
Gravy

Reputation: 12445

problem solved. The problem is me being a Sublime Text noob.

Solution for those of you who don't know:

Sublime text packages appear to have various settings modes. A default mode and a user mode.

If you copy the contents of default mode over to user mode, then edit user mode. Then I believe that the settings in user will extend / override the settings in the default mode.

From what I can see, you cannot edit the settings in default.

So instead of { "php_path": "php" }, user settings should be something like the following depending on your php setup.

{
    "php_path": "/Applications/MAMP/bin/php/php5.4.10/bin/php"
}

Upvotes: 13

Related Questions