Is there a way to make files opened for editing in the terminal open in Textedit instead?
For example, where a command might open a file for editing (like git
For Sublime Text 3:
defaults write com.apple.LaunchServices LSHandlers -array-add '{LSHandlerContentType=public.plain-text;LSHandlerRoleAll=com.sublimetext.3;}'
See Set TextMate as the default text editor on Mac OS X for details.
For anyone coming here in 2018:
make Sublime Text 3 your default text editor: (Restart required)
defaults write com.apple.LaunchServices LSHandlers -array-add "{LSHandlerContentType=public.plain-text;LSHandlerRoleAll=com.sublimetext.3;}"
make sublime then your default git text editor
git config --global core.editor "subl -W"
Most programs will check the $EDITOR
environment variable, so you can set that to the path of TextEdit in your bashrc. Git will use this as well.
~/.bashrc
file:export EDITOR="/Applications/TextEdit.app/Contents/MacOS/TextEdit"
echo "export EDITOR=\"/Applications/TextEdit.app/Contents/MacOS/TextEdit\"" >> ~/.bashrc
If you are using zsh, use ~/.zshrc
instead of ~/.bashrc
.
Make subl available.
Put this in ~/.bash_profile
[[ -s ~/.bashrc ]] && source ~/.bashrc
Put this in ~/.bashrc
export EDITOR=subl
Use git config --global core.editor mate -w
or git config --global core.editor open
as @dmckee suggests in the comments.
Reference: http://git-scm.com/docs/git-config