opensuse42.2vim安装YouCompleteMe

来源:互联网 发布:linux开机自启动命令 编辑:程序博客网 时间:2024/05/01 08:12

原文:https://github.com/Valloric/YouCompleteMe#full-installation-guide
安装cmake git
sudo zypper install cmake git
删除vim
sudo zypper remove vim
创建一个文件夹放vim源码
mkdir software
mkdir software
使用git下载源码
git clone https://github.com/vim/vim.git
cd vim
./configure --with-features=huge \            --enable-multibyte \            --enable-rubyinterp=yes \            --enable-pythoninterp=yes \            --with-python-config-dir=/usr/lib64/python2.7/config \            --enable-python3interp=yes \            --with-python3-config-dir=/usr/lib64/python3.4/config3.4m \            --enable-perlinterp=yes \            --enable-luainterp=yes \            --enable-gui=gtk2 \            --enable-cscope \            --prefix=/usrmake VIMRUNTIMEDIR=/usr/share/vim/vim80
sudo make install
到此vim安装成功
安装vim插件管理工具Vundle
git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
编辑.vimrc文件
call vundle#begin()和call vundle#end()中放自己的插件
set nocompatible              " be iMproved, requiredfiletype off                  " required" 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'" 在这里放YouCompleteMe插件
plugin '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 http://vim-scripts.org/vim/scripts.html" 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 line
cd ~/.vim/bundle
git下载YouCompleteMe
git clone https://github.com/Valloric/YouCompleteMe.git
检查完整性(在 `~/.vim/bundle/YouCompleteMe` 目录下)
$ git submodule update --init --recursive
安装YouCompleteMe
cd ~/.vim/bundle/YouCompleteMe./install.py
编译安装clang和llvm
  1. Get the required tools.
    • See Getting Started with the LLVM System - Requirements.
    • Note also that Python is needed for running the test suite. Get it at: http://www.python.org/download
    • Standard build process uses CMake. Get it at: http://www.cmake.org/download
  2. Check out LLVM:
    • Change directory to where you want the llvm directory placed.
    • svn co http://llvm.org/svn/llvm-project/llvm/trunk llvm
  3. Check out Clang:
    • cd llvm/tools
    • svn co http://llvm.org/svn/llvm-project/cfe/trunk clang
    • cd ../..
  4. Check out extra Clang tools: (optional)
    • cd llvm/tools/clang/tools
    • svn co http://llvm.org/svn/llvm-project/clang-tools-extra/trunk extra
    • cd ../../../..
  5. Check out Compiler-RT (optional):
    • cd llvm/projects
    • svn co http://llvm.org/svn/llvm-project/compiler-rt/trunk compiler-rt
    • cd ../..
  6. Check out libcxx: (only required to build and run Compiler-RT tests on OS X, optional otherwise)
    • cd llvm/projects
    • svn co http://llvm.org/svn/llvm-project/libcxx/trunk libcxx
    • cd ../..
  7. Build LLVM and Clang:
    • mkdir build (in-tree build is not supported)
    • cd build
    • cmake -G "Unix Makefiles" ../llvm
    • make
    • This builds both LLVM and Clang for debug mode.
    • Note: For subsequent Clang development, you can just run make clang.
    • CMake allows you to generate project files for several IDEs: Xcode, Eclipse CDT4, CodeBlocks, Qt-Creator (use the CodeBlocks generator), KDevelop3. For more details see Building LLVM with CMake page.
  8. If you intend to use Clang's C++ support, you may need to tell it how to find your C++ standard library headers. In general, Clang will detect the best version of libstdc++ headers available and use them - it will look both for system installations of libstdc++ as well as installations adjacent to Clang itself. If your configuration fits neither of these scenarios, you can use the -DGCC_INSTALL_PREFIX cmake option to tell Clang where the gcc containing the desired libstdc++ is installed.
  9. Try it out (assuming you add llvm/build/bin to your path):
    • clang --help
    • clang file.c -fsyntax-only (check for correctness)
    • clang file.c -S -emit-llvm -o - (print out unoptimized llvm code)
    • clang file.c -S -emit-llvm -o - -O3
    • clang file.c -S -O3 -o - (output native machine code)

原创粉丝点击