在命令行中,如果我做了mate <filepath>
,它会在TextMate中为我打开正确的文件。如何让git使用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 = [email protected]
[core]
editor = mate
[github]
user = marcamillion
token = 50e3iuaidsgadjkhwkjegakjhbsdkjb30432 (don't worry, this is fake)
帮助!
并且输出'EDITOR =“mate”',这是否更好? – VonC
@VonC吧?不知道我明白你的意思吗?我应该编辑哪个文件,以及我应该编写/替换哪些文件? – marcamillion
@VonC如果你的意思是如果我尝试在''.bashprofile'中添加'export EDITOR =“mate”',那么是的,我只是试过了,它没有工作。我是否必须一起关闭终端,或者我可以关闭终端会话并重新打开它吗?我有Rails服务器在另一个Term会话中运行,所以我不想关闭它。但如果我需要,我可以做到这一点。 – marcamillion