开发者

specify which vim is called from a command like git

I'm doing some rails dev on mac osx. I have an alias for vim that calls the version in homebrew

vim: aliased to /usr/local/Cellar/vim/7.3.266/bin/vim

But if I execute say git rebase -i [sha] then it will call a different vim from the one that's aliased. It's calling /usr/bin/vim which is NOT w开发者_高级运维hat I want.

How do I fix this?


You can use:

git  config --global core.editor  /usr/local/Cellar/vim/7.3.266/bin/vim


Create an alias (and make sure you export it) and set this as your editor of choice inside your .gitconfig file.


On most UNIX/Linux systems, there is a variable

export EDITOR=/usr/bin/gvim

This editor ought to be used by all programs requiring input (qmv, visudo, crontab -e, git commit etc. etc.)

On debian there is

sudo update-alternatives --config editor
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜