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 commit), instead of opening that file in vim or emacs, it would open in Textedit (or perhaps another text editing application of your choosing, such as Coda or Sublime).
And as a bonus question, is there any way to specifically configure git to automatically open the file created after running git commit in an editor from the applications directory?
Most programs will check the
$EDITORenvironment variable, so you can set that to the path of TextEdit in your bashrc. Git will use this as well.How to do this:
~/.bashrcfile:export EDITOR="/Applications/TextEdit.app/Contents/MacOS/TextEdit"echo "export EDITOR=\"/Applications/TextEdit.app/Contents/MacOS/TextEdit\"" >> ~/.bashrcIf you are using zsh, use
~/.zshrcinstead of~/.bashrc.