git commit错误保存vimfiles [英] git commit error saving vimfiles
问题描述
我在~/
目录中初始化了一个空的git实例,然后添加了.vimrc
和.vim/
文件.
I initialised an empty git instance in my ~/
directory and then added my .vimrc
and my .vim/
files.
git add .vimrc
git add .vim
但是,当我执行git commit
命令时,最终得到的似乎是无关的错误消息.
However when I do the git commit
command I end up with what seems unrelated error messages.
sayth@linux-kt34:~> git commit
Error detected while processing /home/sayth/.vimrc:
line 203:
E319: Sorry, the command is not available in this version: py << EOF
line 204:
E492: Not an editor command: import os.path
line 205:
E492: Not an editor command: import sys
line 206:
E492: Not an editor command: import vim
line 207:
E15: Invalid expression: 'VIRTUAL_ENV' in os.environ:
line 224:
E171: Missing :endif
Press ENTER or type command to continue
如果按回车键,我将进入一个文件.我在做什么错了.
If I press enter I get taken to a file. What am I doing wrong with this.
已从.vimrc
中删除virtualenv ref.从来没有注意到该错误,因为我使用的是gvim,它从未解决过该错误.
have removed virtualenv ref from .vimrc
. Never noticed the error because i was using gvim which never dislpayed the error.
推荐答案
在运行git commit
而不在命令行上指定提交消息的情况下,它将启动编辑器(在您的情况下为vim
),以便您可以输入一个.您看到的那些错误来自vim
,报告您在.vimrc
文件中存在错误.如果仅正常启动vim
,您应该会遇到相同的错误.
When you run git commit
without specifying a commit message on the command line, it will launch an editor (in your case vim
) so that you can enter one. Those errors that you see are from vim
, reporting that you have errors in your .vimrc
file. You should get the same errors if you just launch vim
normally.
这篇关于git commit错误保存vimfiles的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!