如果我在命令行中输入mate <filepath>
,它会在TextMate中打开正确的文件。
但是当我执行以下操作时:
$ mate -v
open: invalid option -- v
Usage: open [-e] [-t] [-f] [-W] [-R] [-n] [-g] [-h] [-b <bundle identifier>] [-a <application>] [filenames] [--args arguments]
此外,当我执行
git commit
时,会看到以下内容:$ git commit
error: cannot run mate: No such file or directory
error: There was a problem with the editor 'mate'.
Please supply the message using either -m or -F option.
我的~/.bashprofile
文件中有以下几行内容:
#Set Textmate as my default editor from the command-line
alias mate='open -a TextMate.app'
export EDITOR="/usr/local/bin/mate -w"
而 ~/.bashrc
中只有这一个内容:
alias mate='open -a TextMate.app'
编辑1
我的~/.gitconfig
包含以下内容:
[user]
name = My Name
email = myemail@address.com
[core]
editor = mate
[github]
user = marcamillion
token = 50e3iuaidsgadjkhwkjegakjhbsdkjb30432 (don't worry, this is fake)
帮帮我!
EXPORT "EDITOR="mate"
,这样会更好吗? - VonCexport EDITOR="mate"
添加到我的.bashprofile
,那么是的,我刚刚尝试了一下,但它没有起作用。我需要完全关闭终端,还是只需关闭该终端会话并重新打开它即可?我在另一个终端会话中运行着 Rails 服务器,所以我不想关闭它。但如果必须这样做,我可以关闭它。 - marcamillion