git无法使用vim编辑

660 阅读1分钟

前阵子下载git,在使用的时候发现无法使用git进行vim,下面是它的报错。

image.png

hint: Waiting for your editor to close the file ... error: cannot spawn vim: No such file or directory

error: unbale to start editor 'vim'

Please supply the message using either -m or -F option

网上有一个解决办法:说因为默认编辑器不是vim,所以需要把它设置成vim

通过git config --global core.editor vim将core.editor默认编辑修改为vim

但是我试了这种方法,好像是因为找不到vim,所以无法修改,任然报错。

最后解决方法: git config --global core.editor /usr/bin/vim

截图如下:

image.png