前几天听同事介绍,找了几个 Vundle 、ctrlp 之类的插件,配置了~/.vimrc 写了几句 Plugin 之类的指令
然后就发现,凡是我自己用 vim 就正常,但是 git commit 的时候总是提示不识别 Plugin 命令 进一步检查,发现 git 调用的是 vi 命令,是由 vim-minimal 软件包提供的;我用的 vim 命令,是由 vim-enhanced 软件包提供的。没有 alternative 机制管理 vi 命令
然后我就搜啊,https://git-scm.com/book/en/v2/Customizing-Git-Git-Configuration 文档说 core.editor By default, Git uses whatever you’ve set as your default text editor via one of the shell environment variables VISUAL or EDITOR, or else falls back to the vi editor to create and edit your commit and tag messages.
所以我最后只好用符号链接解决了这个问题,让 git 通过符号链接 vi 来调用 vim
但是多了一个不属于包管理的可执行文件,感觉很 dirty 请问有没有干净一些的做法?
我这里 CentOS 7 旧操作系统