Vim to see C + + code

Source: Internet
Author: User
Tags ack git clone

Look at the C + + code, lack the right editor, and tinker with Vim.

  1. Installing the Vundle for plug-in management

    git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim --depth=1
  2. Install Youcompleteme, code completion

    cd ~/.vim/bundle/ git clone https://github.com/Valloric/YouCompleteMe.git --depth=1cd YouCompleteMe/git submodule update --init --recursive./install.py --clang-completer --system-libclang
  3. Modify ~/.vimrc , add the following paragraph, manage additional plugins

      set Rtp+=~/.vim/bundle/vundle.vimcall Vundle#begin () Plugin ' Vundlevim/vundle.vim ' Plugin ' mileszs/ack.vim ' Plugin ' scrooloose/nerdtree ' Plugin ' tyok/ Nerdtree-ack ' Plugin ' xuyuanp/nerdtree-git-plugin ' Plugin ' tpope/vim-rails ' Plugin ' drmingdrmer/xptemplate ' "Begin Snippetplugin ' marcweber/vim-addon-mw-utils ' Plugin ' tomtom/tlib_vim ' Plugin ' garbas/vim-snipmate ' Plugin ' honza/ Vim-snippets ' Plugin ' altercation/vim-colors-solarized ' "End snippetbundle ' valloric/youcompleteme ' Call Vundle#end () Set Nocompatiblenmap <F2>: Nerdtreetoggle<cr>let g:ycm_global_ycm_extra_conf= ' ~/.vim/.ycm_extra_ conf.py ' Let g:ycm_confirm_extra_conf=0 ' basic configuration ' set Mouse=asyntax onset ts=4set sw=4set expandtabset autoindentset nu et si a I pasteset rulerset hlsearchset fileencodings=ucs-bom,utf-8,cp936,gb18030,big5,euc-jp,euc-kr,latin1  
    Install plug-in command :P lugininstall
  4. Using Youcompleteme, install the Bear

    git clone https://github.com/rizsotto/Bear.git --depth=1cd Bearcmake -DCMAKE_INSTALL_PREFIX=/opt/Bear .make allmake install
  5. Specific Use examples

    • Generates Compile_commands.json,youcompleteme based on it, implementing code completion.
    • Actually found, still not. The final tradeoff is to use. ycm_extra_conf.py to add part of the path generated in the JSON to the base_flags.

Vim to see C + + code

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.