今天試着配置vim關於python的設置,在使用YouCompleteMe操作的時候,提示'encoding' is an invalid keyword argument on python files
,查看message,爲:~/.vim/bundle/YouCompleteMe/third_party/ycmd/ycmd/utils.py
中的ReadFile引起的問題:
def ReadFile( filepath ):
with open( filepath, encoding = 'utf8' ) as f:
return f.read()
排查發現,是因爲這段代碼只支持python3,所以需要vim支持python3,用brew install vim --with-python3
解決