linux怎么查看本机内存大小
424
2022-11-29
ubuntu 16.04配置YouCompleteme插件
这个东西害我倒腾了几天,总算出成效了,发现还不错,我这里把我的方法记录下来,希望帮助后面的人。
1.删除原来的vim包
sudo apt-get remove --purge vim vim-runtime vim-gnome vim-tiny vim-common vim-gui-common
2.安装依赖
vim依赖
sudo apt-get install liblua5.1-dev luajit libluajit-5.1 python-dev libperl-dev libncurses5-dev ruby-dev
必要的话,删除以前编译的vim安装文件
// Clean and prepare folderssudo rm -rf /usr/local/share/vimsudo rm /usr/bin/vim
3.编译安装vim
git clone vim./configure --with-features=huge \ --enable-largefile \ --enable-multibyte \ --enable-fail-if-missing \ \ --enable-rubyinterp \ --with-ruby-command=$(which ruby) \ --enable-pythoninterp \ --with-python-config-dir=/usr/lib/python2.7/config-x86_64-linux-gnu \ --enable-perlinterp \ --enable-luainterp \ --with-luajit \ --enable-gui=auto --enable-cscopemakesudo make install
然后vim就安装成功了,自己可以在terminal上敲击vim试试,如果有反应,则安装成功啦。
4.安装vundle
git clone ~/.vim/bundle/Vundle.vimcd ~touch .vimrcvim ~/.vimrc
将下面内容添加到vimrc的顶部:
set nocompatible " be iMproved, requiredfiletype off " requiredset backspace=indent,eol,start" set the runtime path to include Vundle and initializeset rtp+=~/.vim/bundle/Vundle.vimcall vundle#begin()" alternatively, pass a path where Vundle should install plugins"call vundle#begin('~/some/path/here')" let Vundle manage Vundle, requiredPlugin 'VundleVim/Vundle.vim'" install youcompletemePlugin 'Valloric/YouCompleteMe'" The following are examples of different formats supported." Keep Plugin commands between vundle#begin/end." plugin on GitHub repoPlugin 'tpope/vim-fugitive'" plugin from Plugin 'L9'" Git plugin not hosted on GitHubPlugin 'git://git.wincent.com/command-t.git'" git repos on your local machine (i.e. when working on your own plugin)Plugin 'file:///home/gmarik/path/to/plugin'" The sparkup vim script is in a subdirectory of this repo called vim." Pass the path to set the runtimepath properly.Plugin 'rstacruz/sparkup', {'rtp': 'vim/'}" Install L9 and avoid a Naming conflict if you've already installed a" different version somewhere else." Plugin 'ascenator/L9', {'name': 'newL9'}" All of your Plugins must be added before the following linecall vundle#end() " requiredfiletype plugin indent on " required" To ignore plugin indent changes, instead use:"filetype plugin on"" Brief help" :PluginList - lists configured plugins" :PluginInstall - installs plugins; append `!` to update or just :PluginUpdate" :PluginSearch foo - searches for foo; append `!` to refresh local cache" :PluginClean - confirms removal of unused plugins; append `!` to auto-approve removal"" see :h vundle for more details or wiki for FAQ" Put your non-Plugin stuff after this linelet g:ycm_global_ycm_extra_conf = '~/.vim/bundle/YouCompleteMe/third_party/ycmd/.ycm_extra_conf.py'
5. 安装YouCompleteMe
sudo apt install build-essential cmake clanggit clone --recursive ~/.vim/bundle/YouCompleteMecd ~/.vim/bundle/YouCompleteMe./install.py --clang-completer --system-libclang
youcompleteme的源文件稍稍有些大,这里需要花费的时间较长,需要等待一下。
然后这些弄完以后,创建一个文件,小试牛刀:
touch test.cpp
你在写c++代码的时候,发现正在提示一些库文件,如果没有提示,则注意.vimrc中的
let g:ycm_global_ycm_extra_conf = '~/.vim/bundle/YouCompleteMe/third_party/ycmd/.ycm_extra_conf.py'
的路径是否正确.我的教程就到这里哈,虽然我讲的简单,但是本人也是吃了不少苦头的。
参考文献
[1].Ubuntu 16.04下编译安装vim/gvim 8.0.16.04 + vim8 + vundle + YouCompleteMe.http://blog./walkerqt/1935024
版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。
发表评论
暂时没有评论,来抢沙发吧~