Setting up the "mate" command in bash
Attempting to setup bash so I can call the "mate" command to edit text files. After running this line, the link appears to exist but I'm still getting "mate: command not found"
ln -s /Applications/ ~/bin/mate/mate- Textmate is installed in applications
- using OSX Mountain Lion
- directory structure is in place
4 Answers
You need to install the shell support in textmate preferences. Follow these steps.
- Open textmate
- Open Preferences via your top menu TextMate > Preferences or pressing Command + ,
- Click on Terminal tab
- Click the install button
note: This will install the command line support to your bash file by default. If you are not using bash, you'll need to add the following line to your shell or select the correct path from the dropdown menu. Once you reload your terminal, this will load the path to the EDITOR variable.
export EDITOR="/usr/local/bin/mate -w"make sure you reload your shell config by using source like this
source ~/.bashrccheck that your EDITOR variable has been loaded with this command
echo $EDITORDon't know what shell you are using? You can use the echo command to show the result of your $SHELL variable like this
echo $SHELL 1 Try this:
alias mate='/Applications/Put it in your ~/.bashrc file if you want to use it in every terminal session.
I have a feeling that the problem with your symlink solution is that ~/bin is in your PATH, but ~/bin/mate/ is not, so try alternatively:
ln -s /Applications/ ~/bin/mateEdit:
Removed the tilde before Applications, Applications is in the root not in the home directory.
Just tried this and it worked fine for me on Mac OS X (Mountain Lion) and TextMate (1.5.11 r1635) installed in Applications.
It seems like you no longer need to create aliases/symbolic links to access the TextMate shell utility from command line. Instead, mate by default is installed in /usr/bin.
In Terminal, go to /usr/bin and list the files there. Do you see mate over there? If not, check /usr/local/bin.
If you didn't see mate in either of the folders above, try removing and installing again. I just tried a fresh installation and mate worked out of the box for me.
I don't know anything about OSX, but I think you should move that to ~/bin/mate instead of ~/bin/mate/mate. If the system put it there, use this:
ln -s ~/bin/mate/mate ~/bin/mateelse just move it:
mv ~/bin/mate/mate ~/bin/mateYou should also check your PATH. If you didn't already know, the PATH tells the system what executables to execute.
PATH="~/bin:$PATH"