如何使用 vim-youcompleteme

upp*_*ane 15 vim-plugin

我是vim-youcompleteme从 Ubuntu 的软件中心下载的。但我不知道如何使它工作。当我重新启动 vim 并进行测试时,没有发生任何特殊情况。而且vim-syntastic是一样的。有人能告诉我如何让它们工作吗?我应该用我的东西做点什么~/.vimrc吗?提前致谢!

mur*_*uru 20

来自特定于包的自述文件 ( /usr/share/doc/vim-youcompleteme/README.Debian):

vim-youcompleteme
-----------------

A code completion plugin for Vim. This package designed to work with
vim-addon-manager. To use this addon install vim-addon-manager package first
and use this command:

  $ vam install youcompleteme
Run Code Online (Sandbox Code Playgroud)

vim-addon-manager由 when 推荐vim-youcompleteme,所以很有可能它已经安装了。如果不:

sudo apt-get install vim-addon-manager
Run Code Online (Sandbox Code Playgroud)

然后运行 ​​README 中给出的命令。vim-syntastic仅适用于 14.10,从包 index 中的结果来看,但鉴于它明确依赖于vim-addon-manager,我想说类似的东西也适用于它。


use*_*275 8

在 18.04 中,它只是;

sudo apt install vim-youcompleteme
vim-addon-manager install youcompleteme
Run Code Online (Sandbox Code Playgroud)

ubuntu 版本不支持 Java,因此您可能需要最新版本,具体取决于您选择的语言,因此可以选择;

cd ~/.vim/bundle
git clone --depth=1 https://github.com/Valloric/YouCompleteMe.git
cd YouCompleteMe
git submodule update --init --recursive
./install.py --all
Run Code Online (Sandbox Code Playgroud)


ser*_*rup 5

尝试这样的事情:

将它放在 .vimrc 的顶部以使用 Vundle。

set nocompatible              " be iMproved, required
filetype off                  " required

" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')

" let Vundle manage Vundle, required
Plugin 'VundleVim/Vundle.vim'


" All of your Plugins must be added before the following line
call vundle#end()            " required
filetype plugin indent on    " required
Run Code Online (Sandbox Code Playgroud)

运行以下命令进行安装:

git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
cd ~/.vim/bundle
git clone https://github.com/Valloric/YouCompleteMe.git
cd YouCompleteMe
git submodule update --init --recursive
./install.sh --clang-completer
Run Code Online (Sandbox Code Playgroud)