1

I am using bash-it in my Mac OSX terminal. However, lately i have been having problems related to the EDITOR and GIT_EDITOR variables.

In a custom bash file i set those variables clearly via:

# Make Sublime the default editor
export EDITOR="subl";
export GIT_EDITOR="subl --wait";

However, something is overwriting those variables as when i do export -p the values assigned are:

declare -x EDITOR=" -w"
declare -x GIT_EDITOR=" -w"

I have checked the other sourced files to see if they are being overwritten by a plugin somewhere but with no luck.

Would appreciate any pointers on how to debug and fix this.

Thanks

AhmadAssaf
  • 3,556
  • 5
  • 31
  • 42
  • 3
    check [find-out-where-an-environment-variable-was-last-set-in-bash](http://stackoverflow.com/questions/5299886/find-out-where-an-environment-variable-was-last-set-in-bash) – amdixon Jul 20 '15 at 12:48
  • Great ! Thanks @amdixon .. i caught it now – AhmadAssaf Jul 20 '15 at 13:46

1 Answers1

1

This is caused by having Bash-it's textmate plugin enabled. It tries to define the EDITOR and GIT_EDITOR variables based on your local textmate installation:

export EDITOR="$(which mate) -w"
export GIT_EDITOR=$EDITOR

If you don't have the mate command on your path, if will set the variables to what you have seen, just -w. This is an error in Bash-it, there should be an if statement around these definitions. I have created a pull request to fix that.

If you're not using TextMate, simply disable the textmate plugin:

bash-it disable plugin textmate

Then open a new shell window, and you should be all set.

nwinkler
  • 52,665
  • 21
  • 154
  • 168
  • Thanks @nwinkler i got that from debugging what was setting those variables. Disabled the plugin and all is good now :) – AhmadAssaf Jul 20 '15 at 16:39
  • Thanks, good to hear. Have fun with Bash-it and please feel free to open issues or contribute pull requests on the GitHub repo. – nwinkler Jul 21 '15 at 06:48