我在通过自制软件安装的OSX上使用UI emacs。我有emacs设置为我的git编辑器。当git为提交消息或rebase merge打开emacs它会打开一个没有任何git输入的空缓冲区。以下是我的设置:
Emacs快捷命令
kev-pc:server kevisazombie$ cat /usr/local/bin/emacs
#!/bin/sh
$(/Applications/Emacs.app/Contents/MacOS/Emacs "$@") &
Git config
kev-pc:server kevisazombie$ cat ~/.gitconfig
[core]
editor = emacs
exclusesfile = /Users/kevisazombie/.gitignore_global
excludesfile = /Users/kevisazombie/.gitignore_global
[color]
ui = auto
[merge]
tool = ediff
[mergetool "ediff"]
cmd = emacs --eval \"(ediff-merge-files-with-ancestor \\\"$LOCAL\\\" \\\"$REMOTE\\\" \\\"$BASE\\\" nil \\\"$MERGED\\\")\"
答案 0 :(得分:1)
在PATH
中创建一个名为“ec”的脚本,其中包含
#!/bin/sh
which osascript > /dev/null 2>&1 && osascript -e 'tell application "Emacs" to activate'
/Applications/Emacs.app/Contents/MacOS/bin/emacsclient -c "$@"
然后使用git config --global core.editor ec
更简单的版本只是git config --global core.editor "/Applications/Emacs.app/Contents/MacOS/bin/emacsclient -c"
,但我相信这需要Emacs运行。
但是,这个问题可能应该转移到超级用户身上。