我按照this指南为我的服务器设置了YouCompleteMe。这就是我所做的:
cd ~/.vim/bundle
git clone https://github.com/Valloric/YouCompleteMe.git
cd YouCompleteMe
git submodule update --init --recursive
./install.sh --clang-completer
然后将其添加到我的vimrc:
让g:ycm_global_ycm_extra_conf =“〜/ .vim / .ycm_extra_conf.py”
我的.ycm_extra_conf.py有https://github.com/rasendubi/dotfiles/blob/master/.vim/.ycm_extra_conf.py
当我启动vim时,启动速度非常慢(大约需要30秒),然后我收到此错误:
Traceback(最近一次调用最后一次):文件 “/home/stu9/s15/hxg7013/.vim/bundle/YouCompleteMe/third_party/ycmd/third_party/requests/requests/packages/urllib3/connection.py” 第137行,在_new_conn中 (self.host,self.port),self.timeout,** extra_kw)文件“/home/stu9/s15/hxg7013/.vim/bundle/YouCompleteMe/third_party/ycmd/third_party/requests/requests/packages/urllib3/ UTIL / connection.py” 第91行,在create_connection中 提出错误文件“/home/stu9/s15/hxg7013/.vim/bundle/YouCompleteMe/third_party/ycmd/third_party/requests/requests/packages/urllib3/util/connection.py”, 第81行,在create_connection中 sock.connect(sa)ConnectionRefusedError:[Errno 111]连接被拒绝在处理上述异常时,另一个异常 发生:回溯(最近一次调用最后一次):文件 “/home/stu9/s15/hxg7013/.vim/bundle/YouCompleteMe/third_party/ycmd/third_party/requests/requests/packages/urllib3/connectionpool.py” 第559行,在urlopen中 body = body,headers = headers)文件“/home/stu9/s15/hxg7013/.vim/bundle/YouCompleteMe/third_party/ycmd/third_party/requests/requests/packages/urllib3/connectionpool.py”, 第353行,在_make_request中 conn.request(method,url,** httplib_request_kw)文件“/usr/lib/python3.5/http/client.py”,第1106行,请求中 self._send_request(method,url,body,headers)文件“/usr/lib/python3.5/http/client.py”,第1151行,在_send_request中 self.endheaders(body)文件“/usr/lib/python3.5/http/client.py”,第1102行,在endheaders中 self._send_output(message_body)文件“/usr/lib/python3.5/http/client.py”,第934行,在_send_output中 self.send(msg)文件“/usr/lib/python3.5/http/client.py”,第877行,发送 self.connect()文件“/home/stu9/s15/hxg7013/.vim/bundle/YouCompleteMe/third_party/ycmd/third_party/requests/requests/packages/urllib3/connection.py”, 第162行,在连接中 conn = self._new_conn()文件“/home/stu9/s15/hxg7013/.vim/bundle/YouCompleteMe/third_party/ycmd/third_party/requests/requests/packages/urllib3/connection.py”, 第146行,在_new_conn中 self,“无法建立新连接:%s”%e)requests.packages.urllib3.exceptions.NewConnectionError: :无法建立新连接:[Errno 111] 连接被拒绝在处理上述异常时,另一个 发生异常:回溯(最近一次调用最后一次):文件 “/home/stu9/s15/hxg7013/.vim/bundle/YouCompleteMe/third_party/ycmd/third_party/requests/requests/adapters.py” 第376行,发送 timeout = timeout文件“/home/stu9/s15/hxg7013/.vim/bundle/YouCompleteMe/third_party/ycmd/third_party/requests/requests/packages/urllib3/connectionpool.py”, 第609行,在urlopen中 _stacktrace = sys.exc_info()[2])文件“/home/stu9/s15/hxg7013/.vim/bundle/YouCompleteMe/third_party/ycmd/third_party/requests/requests/packages/urllib3/util/retry.py”, 第273行,增量 引发MaxRetryError(_pool,url,error或ResponseError(cause))requests.packages.urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host ='127.0.0.1',port = 37001):超出最大重试次数 使用url:/ shutdown(由NewConnectionError引起(':无法建立新连接:[Errno 111] 连接拒绝',))在处理上述异常时,另一个 发生异常:回溯(最近一次调用最后一次):文件 文件中的“”,第1行 “/home/stu9/s15/hxg7013/.vim/bundle/YouCompleteMe/autoload/../python/ycm/youcompleteme.py” 第337行,在OnVimLeave中 self._ShutdownServer()文件“/home/stu9/s15/hxg7013/.vim/bundle/YouCompleteMe/autoload/../python/ycm/youcompleteme.py”, 第214行,在_ShutdownServer
中然而,在此之后,我能够使用vim罚款(它仍然缓慢,但是 我可以使用它。)