Look at the C + + code, lack the right editor, and tinker with Vim.
Installing the Vundle for plug-in management
git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim --depth=1
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
-
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
Using Youcompleteme, install the Bear
git clone https://github.com/rizsotto/Bear.git --depth=1cd Bearcmake -DCMAKE_INSTALL_PREFIX=/opt/Bear .make allmake install
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