开发者

specify which vim is called from a command like git

开发者 https://www.devze.com 2023-04-07 02:54 出处:网络
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

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

精彩评论

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