Archlinux YouCompleteMe vim自動補全外掛程式

來源:互聯網
上載者:User

標籤:vim   youcompleteme   archlinux   

Archlinux 安裝和配置vim補全外掛程式YouCompleteMe的過程。

參考:

https://github.com/Valloric/YouCompleteMe

https://github.com/gmarik/Vundle.vim

http://www.cnblogs.com/zhongcq/p/3630047.html



1.用vundle下載YouCompleteMe和syntastic

2.pacman -S clang (編譯會得到/usr/lib/libclang.so)

3. 使用上一步編譯得到的libclang庫

cd ~mkdir ycm_buildcd ycm_build
cmake -G "Unix Makefiles" -DEXTERNAL_LIBCLANG_PATH=/usr/lib/libclang.so. ~/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp
make ycm_support_libs

4.配置.vimrc
""""""""""syntastic""""""""""""let g:syntastic_check_on_open = 1let g:syntastic_cpp_include_dirs = [‘/usr/include/‘]let g:syntastic_cpp_remove_include_errors = 1let g:syntastic_cpp_check_header = 1let g:syntastic_cpp_compiler = ‘clang++‘let g:syntastic_cpp_compiler_options = ‘-std=c++11 -stdlib=libstdc++‘"set error or warning signslet g:syntastic_error_symbol = ‘?‘let g:syntastic_warning_symbol = ‘?‘"whether to show balloonslet g:syntastic_enable_balloons = 1""""""""""""YCM"""""""""""""""""""""let g:ycm_global_ycm_extra_conf = ‘~/.vim/bundle/YouCompleteMe/cpp/ycm/.ycm_extra_conf.py‘"let g:ycm_collect_identifiers_from_tags_files = 1set completeopt=longest,menu"讓Vim的補全菜單行為與一般IDE一致(參考VimTip1228)autocmd InsertLeave * if pumvisible() == 0|pclose|endif"離開插入模式後自動關閉預覽視窗inoremap <expr> <space>       pumvisible() ? "\<C-y>" : "\<space>""按空格鍵即選中當前項let g:ycm_cache_omnifunc=0" 禁止緩衝匹配項,每次都重建匹配項let g:ycm_seed_identifiers_with_syntax = 1let g:ycm_confirm_extra_conf = 0"在注釋輸入中也能補全let g:ycm_complete_in_comments = 1"在字串輸入中也能補全let g:ycm_complete_in_strings = 1"注釋和字串中的文字也會被收入補全let g:ycm_collect_identifiers_from_comments_and_strings = 0nnoremap <leader>jd :YcmCompleter GoToDefinitionElseDeclaration<CR> " 跳轉到定義處"""""""""""""""""""""""""""""""""""""""""

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.