I use MacBook Air with OSX 10.7.2.
I would like to create an alias that does the following:
- Opens TextMate with ~/.bashrc and allows me to edit it
- Once I close TextMate, "sources" ~/.bashrc (so if I add a new alias, for example, it will be available immediately)
I tried the following:
alias b="/usr/bin/mate -w ~/.bashrc; source ~/.bashrc"
but it doesn't work: when I close TextMate, the shell doesn't return (I don't see the shell prompt).
Any ideas?
bashrcsyntax okay? – slhck♦ Nov 22 '11 at 22:15unalias -acommand before thesourcecommand in the definition so any deletions you make in the editor will be reflected in the current shell's new alias set. F/ex, if you found you'd accidentally made a dangerous alias and you use yourbalias to edit it out, the present definition would leave the bad alias in the current shell, waiting to bite you. – JRobert Nov 23 '11 at 1:11