Как использовать Sublime Text в качестве редактора ОС в Mac OS X?

4511
Edward

Как установить Sublime Text в качестве редактора для коммитов git в Mac OS X?

В моем .zshrc у меня есть:

export EDITOR='subl -w' 

Но если я сделаю:

bundle open devise 

Я получаю ошибку:

Could not run 'subl -w /Users/edwardandrews-hodgson/.rvm/gems/ruby-1.9.2-p320@neighbours/gems/devise-2.1.3' 

Как мне ссылаться на Sublime?

4
Можете ли вы запустить Sublime Text, запустив `subl -w` вручную? 10 лет назад 1
если исполняемый файл subl отсутствует в вашем пути, попробуйте использовать полный путь в переменной среды редактора 10 лет назад 0
... или добавьте путь к месту, где находится команда `subl`. TTM 10 лет назад 0

1 ответ на вопрос

5
MattDMo

First, you'll need to create a soft link to the subl command. If you haven't already, create a personal bin directory:

mkdir ~/bin 

then create the soft link:

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

Next, open your .zshrc and add the following to the end:

export PATH=$PATH:~/bin 

Now restart Terminal.app (or whichever term program you're using) and you should be able to open any file in ST2 from the command line using the subl command. Since your $EDITOR variable is already set properly, bundle open devise should work as expected. Keep in mind that if you have the MacPorts version of Python installed, you'll need to open Sublime Text 2.app from the Finder before the command line subl command will work.

Фантастика - это было сложнее, чем я думал! Edward 10 лет назад 0