new*_*ife 13 git emacs bash shell
在我.bash_profile,我用这个:
export EDITOR=emacsclient
alias e='emacsclient -t'
Run Code Online (Sandbox Code Playgroud)
当我使用Git提交更改时,它将打开一个新的emacs窗口,但是emacs --daemon.如何将我的默认Git编辑器设置为启用了t标志的emacs?
tac*_*ell 18
git config --global core.editor 'emacsclient -t -a=\"\"'
Run Code Online (Sandbox Code Playgroud)
如果还没有一个守护进程,这将启动一个守护进程.
您可能遇到引号问题,因为它在我的.gitconfig中显示为
[core]
editor = emacsclient -t -a=\\\"\\\"
Run Code Online (Sandbox Code Playgroud)
export GIT_EDITOR="`which emacsclient` -t -s $EMACS_SERVER_FILE"
Run Code Online (Sandbox Code Playgroud)
在调用您的EDITOR或GIT_EDITOR之前,git似乎已经使用了PATH变量,因此即使通常会调用来自更新的Emacs的emacsclient,也会调用来自/ usr/bin的内置emacsclient.我通过从子进程获取可执行文件的路径来解决这个问题,我认为它具有自己的环境(无论哪种方式都可以...).
在OS X 10.8.2上测试,本地构建Emacs 24.1,服务器运行,客户端通过套接字连接.
我还没有测试过tcp客户端.