mate -w

I used this command to specify the text editor: $ git config --global core.editor "mate -w"

How can I remove this configuration as I'm getting this error: error: cannot run mate -w: No such file or directory

Or, how can I fix this error instead?

Thanks.

Abder-Rahman Ali wrote:

I used this command to specify the text editor: $ git config --global core.editor "mate -w"

How can I remove this configuration as I'm getting this error: error: cannot run mate -w: No such file or directory

Or, how can I fix this error instead?

I use the mate command for the editor for lots of things. However, I did not tell Git to use it specifically in it's configuration. Instead I set the EDITOR environment variable in ~/.profile like so:

export EDITOR='mate --wait'

Git will respect the EDITOR variable.

To remove the configuration from Git you can remove that configuration from your ~/.gitconfig file.

But, before doing any of the above make sure the mate command line tool is enabled. You can do that from TextMate

Help ->> Terminal Usage... ->> Create Link

Abder-Rahman Ali wrote:

I used this command to specify the text editor: $ git config --global core.editor "mate -w"

How can I remove this configuration as I'm getting this error: error: cannot run mate -w: No such file or directory

Just a wild guess here: does realize that the -w is a parameter, not part of the actual filename? IOW, will it tell the system to try to find a file in your path with the name "mate -w" (all, but sans quotes)? I've run into similar problems with other programs many times. Try chopping off the -w and see if it works. (Or is it necessary in this situation? I don't use mate.)

-Dave

Dave Aronson wrote:

Just a wild guess here: does realize that the -w is a parameter, not part of the actual filename? IOW, will it tell the system to try to find a file in your path with the name "mate -w" (all, but sans quotes)? I've run into similar problems with other programs many times. Try chopping off the -w and see if it works. (Or is it necessary in this situation? I don't use mate.)

You can just drop the -w. (--wait). This is an option to the mate command line tool to wait for the file to be closed. Using TextMate as an "EDITOR" requires the use of the --wait option so the Terminal will wait for the file to be closed before returning to a prompt.

I use this all the time in the way I explained earlier. It should work fine either how I have configured it using the EDITOR environment variable, or configured for use by Git only as shown here:

Robert Walker wrote:

You can just drop the -w. (--wait). This is an option to the mate command line tool to wait for the file to be closed. Using TextMate as an "EDITOR" requires the use of the --wait option so the Terminal will wait for the file to be closed before returning to a prompt.

SORRY, I meant to say "You CANNOT drop the -w..."

Thanks a lot robert4723, this worked just fine.