如何使用vim-youcompleteme


13

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

Answers:


20

从特定于软件包的README(/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

vim-addon-manager由when推荐vim-youcompleteme,因此很有可能已经安装。如果不:

sudo apt-get install vim-addon-manager

然后运行自述文件中给出的命令。vim-syntasticpackage index的结果中仅可用于14.10,但鉴于它显式依赖vim-addon-manager,我想说也适用于它。


5

在18.04中,

sudo apt install vim-youcompleteme
vim-addon-manager install youcompleteme

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

4

试试这样的事情:

将其放在.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

运行以下命令进行安装:

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
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.