1

I've been trying to change the default text editor to Sublime Text 3.

I've seen about a dozen different was to do it include multiple ways here but I can't seem to change it. I've tried git config --global core.editor "'/c/Program Files/Sublime Text 3/subl.exe' -w" I've tried C:\\Program Files\\Sublime Text 3\\subl.exe" -w I've also tried using single quotes because it was mentioned in How can I make Sublime Text the default editor for Git?.

I got to the point where I just wanted to change the text editor to anything and I usedgit config --global core.editor "notepad.exe" -w and git config --global core.editor "emacs" -w

I assume I use subl FileName.txt to execute it. when I've tried emacs FileName.txt and notepad because I've tried so many times, when I use git config --list It displays four different properties in core.editor 3 of them are the Sublime variations I've seen online and one is my notepad attempt. Vim is still the only thing that works.

I haven't tried to make PATH changes but I've seen some talk of that but I heard that for those who know what they're doing. Now it started telling me warning core.editor has multiple values error: cannot overwrite multiple values with a single value Use a regexp, --add or --replace-all to change core.editor. And I've got no clue how to do that.

I know this isn't supposed to be this difficult. I think this is just a glaring oversight on my behalf but I've been at this for hours.

mkrieger1
  • 19,194
  • 5
  • 54
  • 65
  • Do you have any local config (`git config --local -l`) which might override *all* your --global attempts? – VonC Aug 29 '15 at 06:52
  • No I haven't attempted changing that. I've found a that creating a `.bash_profile` file and adding `alias subl="/c/Program\ Files/Sublime\ Text\ 2/sublime_text.exe"` to it works for what. I saw similar answers but I'm pretty confident I didn't see any that used `.bash_profile`. Thank you so much for your response. – Wendel ZEnmaster Aug 29 '15 at 07:09

1 Answers1

0

I saw similar answers but I'm pretty confident I didn't see any that used .bash_profile

Actually, this thread mentions a similar option

Using Sublime, I created .bash_profile in $HOME

But one of the difficulties comes from a path with spaces and special charaters (()).
I have a SublimeText3 installed in C:\prgs\sbt\ (using the portable version Sublime Text Build 3083 x64.zip), and it is easier to reference in a git config setting.

A simple git config core.editor "C:/prgs/sbt/sublime_text.exe -n -w" is enough for me.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Thank you. That thread on the Sublime Forum was the exact one I found. Thanks for the tip on portable version of the software. I'll keep that in mind for the future. – Wendel ZEnmaster Aug 29 '15 at 17:57