What is the command to make Sublime Text my core editor? What is the command to make Sublime Text my core editor? windows windows

What is the command to make Sublime Text my core editor?


As this ranked highly when I was searching Google for Mac instructions, here is a combination of solutions I found.

First I set up a command line utility matching "subl" to Sublime Text from any terminal instance with this terminal command.

sudo ln -s "/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl" /bin/subl

Then I do a similar git config command to the Windows solution above, but with a -w parameter at the end.

git config --global core.editor "subl -w"


Enter this command in a prompt:

git config --global core.editor "C:/Program Files/Sublime Text 2/sublime_text.exe"

It will then pop up when prompted for a commit message, or any other edition task, but if it was already open it won't work since it uses the same instance. Don't know how to workaround this.


Since build 3010 of Sublime Text 3, the subl.exe helper is included by default. So, combining CharlesB and Ted's answers gives you the best answer --

type in a prompt (cmd.exe or git_bash):

setx SUBLIME c:\path\to\sublime\install\dirgit config --global core.editor "subl.exe -w"

Note the presence/absence of quotes. git config requires them, whereas setx does NOT. Also, while you're at it, try using a path\to\sublime that doesn't use spaces. That way you can use this with both MSysGit and Cygwin Git.