Sublime Text3をターミナルのテキストエディタに設定する


ターミナルにSublimeTextを設定しようとしたところ、以下のようなエラーが出ました。

$ git config --global core.editor "subl -n -w"
$ git commit
hint: Waiting for your editor to close the file... subl -n -w: subl: command not found
error: There was a problem with the editor 'subl -n -w'.
Please supply the message using either -m or -F option.

以下の1行で解決しました。

$ git config --global core.editor "/Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl -n -w"

パスが解決できてなかったようです。