2

From git, I'm trying to set a default text editor sublime text 3, and to launch it from git I have only found instructions for old versions, and been unsuccessful.

Do you know a way to do this with the most recent version of git?

I have been trying to assign sublime text 3 as the default text editor. I tried

git config --global core.editor "sublime_text.exe" -n -w

and have placed the executable file in the directory.

Darrick Herwehe
  • 3,553
  • 1
  • 21
  • 30
DennisWPaulsenJR
  • 465
  • 1
  • 5
  • 16
  • 2
    What you did is mostly right; just either specify the entire path to sublime text when you set the setting or (even better) add the directory that you installed sublime in to your path. – OdatNurd Aug 04 '16 at 02:19
  • ok, i have moved it around to different directories, and have used absolute paths to designate exactly where sublime 3 is...now when enter the global command, it doesn't throw any error, but when i type subl it says...bash: C:/program: No such file or directory. – DennisWPaulsenJR Aug 07 '16 at 04:15
  • 1
    Firstly, if you want to just start the editor with `subl`, make sure you're adding to the PATH variable. Secondly, when filenames have spaces in them, you need to quote them; otherwise things get confused and think they're multiple arguments. Try something like `/c/program\ files/sublime\ text\ 3/` as the path (note the use of the slashes in front of the spaces to tell bash that they're still part of the same argument). – OdatNurd Aug 07 '16 at 04:47
  • Computer@DennisOne MINGW64 /reflections (master) $ git config --global core.editor "C:\Program Files\Sublime Text 3\sublime_text.exe" Computer@DennisOne MINGW64 /reflections (master) $ subl bash: C:/program: No such file or directory – DennisWPaulsenJR Aug 13 '16 at 04:02
  • I am still unable to launch the text editor from the command line. I have moved the location of .exe - I have specified the absolute and relative paths in every way I know how - when i enter the --global command, it throws no error, but does seem to accept the command because in skips to the next line just as it would as if you had pressed enter. I did notice that when i launch git itself now it does spit the following code at me...bash: alias: C:\Program Files\Sublime Text 3\subl.exe: not found – DennisWPaulsenJR Aug 13 '16 at 04:08
  • now when i launch git , it spits the following code at me . . .C:/program\ files/sublime\ text\ 3/sublime_text.exe alias subl=C:/program files/sublime text 3/sublime_text.exe C:/program\ files/sublime\ text\ 3/sublime_text.exe alias subl=C:/program files/sublime text 3/sublime_text.exe C:/program\ files/sublime\ text\ 3/sublime_text.exe alias subl=C:/program files/sublime text 3/sublime_text.exe – DennisWPaulsenJR Aug 13 '16 at 04:08
  • 1
    This question is already answered at the following link; you need to replace the 2 in the sublime text path with a 3 if you're using sublime 3, though. http://stackoverflow.com/questions/8951275/how-can-i-make-sublime-text-the-default-editor-for-git – OdatNurd Aug 13 '16 at 05:03

0 Answers0