I'd like Sublime Text 2, not TextEdit, to be the default program to open my bash_profile
file when I call open ~/.bash_profile
in Terminal. Normally I would just control-click on the file in Finder to set the default program, but given that bash_profile
is hidden I'm not sure how to go about this.
Set bash_profile to open with Sublime Text 2 by default
bashsublimetextterminal
Related Question
- MacOS – How to use Atom as the default editor for “open”
- MacOS – I broke the PATH by editing the ~/.bash_profile and Bash will not recognize most commands
- Install SublimeHighlight plugin on Sublime Text 3
- Keyboard shortcut to open folder with Sublime Text
- Oops! Terminal is opening all applications with texteditor after Open with:/Change All
- MacOS – How to set “default” .bash_profile when opening Terminal on Catalina
Best Answer
You can temporarily show hidden files. In terminal write:
defaults write com.apple.finder AppleShowAllFiles TRUE
and then
killall Finder
to restart Finder.Change what you need and then hide hidden files again by changing
TRUE
toFALSE
.Edit: Making this more explicit. In Finder, locate .bash_profile, open up the properties by right click + "Get Info". Then change the "Open with" to Sublime Text 2. This works, I just tried it.