解決YouCompleteMe"encoding" is an invalid keyword 錯誤

今天試着配置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解決

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章