提交时在我.bash_profile
emacsclient -t,我用这个:使用Git中
export EDITOR=emacsclient
alias e='emacsclient -t'
当我提交使用Git的变化,它会打开一个新的Emacs窗口,但emacs --daemon
。 如何在启用t标志的情况下将默认Git编辑器设置为emacs?
提交时在我.bash_profile
emacsclient -t,我用这个:使用Git中
export EDITOR=emacsclient
alias e='emacsclient -t'
当我提交使用Git的变化,它会打开一个新的Emacs窗口,但emacs --daemon
。 如何在启用t标志的情况下将默认Git编辑器设置为emacs?
的真正原因是emacs.there的版本是Mac,哪个版本亘古不变的有选项“-t”。还有一个默认的Emacs,似乎不列入混帐读取.bash_profile中
我通常不会说“阅读精细手册”,但在这种情况下,它只是适用。 git commit --help
有这样说的话题:
ENVIRONMENT AND CONFIGURATION VARIABLES
The editor used to edit the commit log message will be chosen
from the GIT_EDITOR environment variable, the core.editor configuration
variable, the VISUAL environment variable, or the EDITOR environment
variable (in that order). See git-var(1) for details.
[核心] editor =“emacsclient -t”我在.gitconfig中使用这个。但是,它不工作,任何建议? – newlife 2012-05-04 18:55:43
git config --global core.editor 'emacsclient -t -a=\"\"'
如果没有一个已经运行这将启动一个守护进程。
你可能有与引号问题,因为它在我的.gitconfig显示为
[core]
editor = emacsclient -t -a=\\\"\\\"
emacsclient:无效选项 - t 尝试使用'emacsclient --help'以获取更多信息 错误:编辑器'emacsclient -t -a = \“\”'出现问题。 请使用-m或-F选项提供消息。这是我使用设置时的输出,我在哪里可以获得关于“引号”的这些规范? – newlife 2012-05-10 02:45:14
当然,没有必要在单引号字符串中避开双引号? – phils 2012-05-10 03:51:27
@newlife你使用的是什么操作系统,以及哪个版本的emacs? http://linux.die.net/man/1/emacsclient – tacaswell 2012-06-05 16:21:39
export GIT_EDITOR="`which emacsclient` -t -s $EMACS_SERVER_FILE"
混帐似乎与PATH变量渣土调用你的编辑器或GIT_EDITOR所以内置的前即使通常会调用更新的Emacs中的emacsclient,也会调用/ usr/bin中的emacsclient。我通过从一个拥有自己的环境的子进程中获取可执行文件的路径来解决这个问题,我相信(无论哪种方式......)。
在OS X 10.8.2上测试,Emacs 24.1在本地构建,服务器运行和客户端通过套接字连接。
我还没有测试过tcp客户端。
设置我敢肯定,莫里茨·布克斯有答案,但我对你的措辞有些困惑。你是说你希望你的标准编辑器是'emacsclient -t'(在这种情况下,你可以简单地指定'EDITOR'的值),或者你希望git编辑器与标准编辑器不同。如果你正在运行'emacs --daemon',那么emacsclient将连接到'-t'标志或其他地方,所以我不确定你的评论意味着什么。 – phils 2012-04-28 08:28:29
实际上,这个要求来自:当emacs启动时,需要一些时间,这就是为什么我使用emacs - daemon。当我使用git commit时,它会打开一个新的emacs,因此我必须等待.so我想用emacsclient -t打开一个emacs窗口。我清楚了吗? – newlife 2012-05-04 18:16:17