Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

So I'm trying to set up GitHub for the first time ever and I want Sublime Text to be my core editor, how exactly do I do that? Sorry if this is a noob question, I am a noob :/

like image 785
Chris Wildman Avatar asked Sep 29 '11 07:09

Chris Wildman


People also ask

How do I change the default git editor?

The command to do this is git config --global core. editor "nano" . You can change the highlighted section with your editor of choice!

What is SUBL command?

Sublime Text includes a command-line helper called subl . Using the command-line helper, you can open files and folders and perform other actions from the command line. Before using subl , make sure it is on your PATH . To put subl on your PATH , you may need to add directories to PATH or use symbolic links.


2 Answers

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"
like image 53
Ted Avery Avatar answered Oct 02 '22 07:10

Ted Avery


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.

like image 42
CharlesB Avatar answered Oct 02 '22 09:10

CharlesB