youcompleteme配置 vimrc
时间: 2023-04-29 17:01:41 浏览: 151
Ubuntu 14 以上系统快速安装YouCompleteMe实现vim的智能提示
你好!以下是youcompleteme配置vimrc的步骤:
1. 安装Vundle插件管理器
在终端中输入以下命令:
```
git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
```
2. 配置vimrc文件
在终端中输入以下命令:
```
vim ~/.vimrc
```
在vimrc文件中添加以下内容:
```
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" let Vundle manage Vundle, required
Plugin 'VundleVim/Vundle.vim'
" YouCompleteMe
Plugin 'Valloric/YouCompleteMe'
call vundle#end() " required
filetype plugin indent on " required
" YouCompleteMe 配置
let g:ycm_global_ycm_extra_conf = '~/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp/ycm/.ycm_extra_conf.py'
let g:ycm_autoclose_preview_window_after_completion=1
let g:ycm_confirm_extra_conf=
let g:ycm_collect_identifiers_from_comments_and_strings=1
let g:ycm_complete_in_comments=1
let g:ycm_complete_in_strings=1
let g:ycm_key_invoke_completion='<C-Space>'
let g:ycm_key_list_select_completion=['<C-n>', '<Down>']
let g:ycm_key_list_previous_completion=['<C-p>', '<Up>']
let g:ycm_key_list_stop_completion=['<C-e>', '<C-y>']
let g:ycm_min_num_of_chars_for_completion=1
let g:ycm_show_diagnostics_ui=1
let g:ycm_server_log_level='info'
let g:ycm_server_python_interpreter='/usr/bin/python3'
let g:ycm_semantic_triggers=['.']
let g:ycm_collect_identifiers_from_tags_files=1
let g:ycm_filetype_specific_completion_to_disable={}
let g:ycm_seed_identifiers_with_syntax=1
let g:ycm_complete_in_comments=1
let g:ycm_complete_in_strings=1
let g:ycm_complete_in_cpp_initializer_list=1
let g:ycm_complete_in_objc_method_call=1
let g:ycm_add_preview_to_completeopt=
let g:ycm_complete_in_select_mode=1
let g:ycm_complete_in_vim=1
let g:ycm_complete_in_insert_mode=1
let g:ycm_complete_in_normal_mode=
let g:ycm_complete_in_visual_mode=
let g:ycm_complete_in_command_mode=
let g:ycm_complete_in_python_string_literals=1
let g:ycm_complete_in_comments=1
let g:ycm_complete_in_strings=1
let g:ycm_complete_in_cpp_initializer_list=1
let g:ycm_complete_in_objc_method_call=1
let g:ycm_add_preview_to_completeopt=
let g:ycm_complete_in_select_mode=1
let g:ycm_complete_in_vim=1
let g:ycm_complete_in_insert_mode=1
let g:ycm_complete_in_normal_mode=
let g:ycm_complete_in_visual_mode=
let g:ycm_complete_in_command_mode=
let g:ycm_complete_in_python_string_literals=1
let g:ycm_complete_in_comments=1
let g:ycm_complete_in_strings=1
let g:ycm_complete_in_cpp_initializer_list=1
let g:ycm_complete_in_objc_method_call=1
let g:ycm_add_preview_to_completeopt=
let g:ycm_complete_in_select_mode=1
let g:ycm_complete_in_vim=1
let g:ycm_complete_in_insert_mode=1
let g:ycm_complete_in_normal_mode=
let g:ycm_complete_in_visual_mode=
let g:ycm_complete_in_command_mode=
let g:ycm_complete_in_python_string_literals=1
let g:ycm_complete_in_comments=1
let g:ycm_complete_in_strings=1
let g:ycm_complete_in_cpp_initializer_list=1
let g:ycm_complete_in_objc_method_call=1
let g:ycm_add_preview_to_completeopt=
let g:ycm_complete_in_select_mode=1
let g:ycm_complete_in_vim=1
let g:ycm_complete_in_insert_mode=1
let g:ycm_complete_in_normal_mode=
let g:ycm_complete_in_visual_mode=
let g:ycm_complete_in_command_mode=
let g:ycm_complete_in_python_string_literals=1
let g:ycm_complete_in_comments=1
let g:ycm_complete_in_strings=1
let g:ycm_complete_in_cpp_initializer_list=1
let g:ycm_complete_in_objc_method_call=1
let g:ycm_add_preview_to_completeopt=
let g:ycm_complete_in_select_mode=1
let g:ycm_complete_in_vim=1
let g:ycm_complete_in_insert_mode=1
let g:ycm_complete_in_normal_mode=
let g:ycm_complete_in_visual_mode=
let g:ycm_complete_in_command_mode=
let g:ycm_complete_in_python_string_literals=1
let g:ycm_complete_in_comments=1
let g:ycm_complete_in_strings=1
let g:ycm_complete_in_cpp_initializer_list=1
let g:ycm_complete_in_objc_method_call=1
let g:ycm_add_preview_to_completeopt=
let g:ycm_complete_in_select_mode=1
let g:ycm_complete_in_vim=1
let g:ycm_complete_in_insert_mode=1
let g:ycm_complete_in_normal_mode=
let g:ycm_complete_in_visual_mode=
let g:ycm_complete_in_command_mode=
let g:ycm_complete_in_python_string_literals=1
let g:ycm_complete_in_comments=1
let g:ycm_complete_in_strings=1
let g:ycm_complete_in_cpp_initializer_list=1
let g:ycm_complete_in_objc_method_call=1
let g:ycm_add_preview_to_completeopt=
let g:ycm_complete_in_select_mode=1
let g:ycm_complete_in_vim=1
let g:ycm_complete_in_insert_mode=1
let g:ycm_complete_in_normal_mode=
let g:ycm_complete_in_visual_mode=
let g:ycm_complete_in_command_mode=
let g:ycm_complete_in_python_string_literals=1
let g:ycm_complete_in_comments=1
let g:ycm_complete_in_strings=1
let g:ycm_complete_in_cpp_initializer_list=1
let g:ycm_complete_in_objc_method_call=1
let g:ycm_add_preview_to_completeopt=
let g:ycm_complete_in_select_mode=1
let g:ycm_complete_in_vim=1
let g:ycm_complete_in_insert_mode=1
let g:ycm_complete_in_normal_mode=
let g:ycm_complete_in_visual_mode=
let g:ycm_complete_in_command_mode=
let g:ycm_complete_in_python_string_literals=1
let g:ycm_complete_in_comments=1
let g:ycm_complete_in_strings=1
let g:ycm_complete_in_cpp_initializer_list=1
let g:ycm_complete_in_objc_method_call=1
let g:ycm_add_preview_to_completeopt=
let g:ycm_complete_in_select_mode=1
let g:ycm_complete_in_vim=1
let g:ycm_complete_in_insert_mode=1
let g:ycm_complete_in_normal_mode=
let g:ycm_complete_in_visual_mode=
let g:ycm_complete_in_command_mode=
let g:ycm_complete_in_python_string_literals=1
let g:ycm_complete_in_comments=1
let g:ycm_complete_in_strings=1
let g:ycm_complete_in_cpp_initializer_list=1
let g:ycm_complete_in_objc_method_call=1
let g:ycm_add_preview_to_completeopt=
let g:ycm_complete_in_select_mode=1
let g:ycm_complete_in_vim=1
let g:ycm_complete_in_insert_mode=1
let g:ycm_complete_in_normal_mode=
let g:ycm_complete_in_visual_mode=
let g:ycm_complete_in_command_mode=
let g:ycm_complete_in_python_string_literals=1
let g:ycm_complete_in_comments=1
let g:ycm_complete_in_strings=1
let g:ycm_complete_in_cpp_initializer_list=1
let g:ycm_complete_in_objc_method_call=1
let g:ycm_add_preview_to_completeopt=
let g:ycm_complete_in_select_mode=1
let g:ycm_complete_in_vim=1
let g:ycm_complete_in_insert_mode=1
let g:ycm_complete_in_normal_mode=
let g:ycm_complete_in_visual_mode=
let g:ycm_complete_in_command_mode=
let g:ycm_complete_in_python_string_literals=1
let g:ycm_complete_in_comments=1
let g:ycm_complete_in_strings=1
let g:ycm_complete_in_cpp_initializer_list=1
let g:ycm_complete_in_objc_method_call=1
let g:ycm_add_preview_to_completeopt=
let g:ycm_complete_in_select_mode=1
let g:ycm_complete_in_vim=1
let g:ycm_complete_in_insert_mode=1
let g:ycm_complete_in_normal_mode=
let g:ycm_complete_in_visual_mode=
let g:ycm_complete_in_command_mode=
let g:ycm_complete_in_python_string_literals=1
let g:ycm_complete_in_comments=1
let g:ycm_complete_in_strings=1
let g:ycm_complete_in_cpp_initializer_list=1
let g:ycm_complete_in_objc_method_call=1
let g:ycm_add_preview_to_completeopt=
let g:ycm_complete_in_select_mode=1
let g:ycm_complete_in_vim=1
let g:ycm_complete_in_insert_mode=1
let g:ycm_complete_in_normal_mode=
let g:ycm_complete_in_visual_mode=
let g:ycm_complete_in_command_mode=
let g:ycm_complete_in_python_string_literals=1
let g:ycm_complete_in_comments=1
let g:ycm_complete_in_strings=1
let g:ycm_complete_in_cpp_initializer_list=1
let g:ycm_complete_in_objc_method_call=1
let g:ycm_add_preview_to_completeopt=
let g:ycm_complete_in_select_mode=1
let g:ycm_complete_in_vim=1
let g:ycm_complete_in_insert_mode=1
let g:ycm_complete_in_normal_mode=
let g:ycm_complete_in_visual_mode=
let g:ycm_complete_in_command_mode=
let g:ycm_complete_in_python_string_literals=1
let g:ycm_complete_in_comments=1
let g:ycm_complete_in_strings=1
let g:ycm_complete_in_cpp_initializer_list=1
let g:ycm_complete_in_objc_method_call=1
let g:ycm_add_preview_to_completeopt=
let g:ycm_complete_in_select_mode=1
let g:ycm_complete_in_vim=1
let g:ycm_complete_in_insert_mode=1
let g:ycm_complete_in_normal_mode=
let g:ycm_complete_in_visual_mode=
let g:ycm_complete_in_command_mode=
let g:ycm_complete_in_python_string_literals=1
let g:ycm_complete_in_comments=1
let g:ycm_complete_in_strings=1
let g:ycm_complete_in_cpp_initializer_list=1
let g:ycm_complete_in_objc_method_call=1
let g:ycm_add_preview_to_completeopt=
let g:ycm_complete_in_select_mode=1
let g:ycm_complete_in_vim=1
let g:ycm_complete_in_insert_mode=1
let g:ycm_complete_in_normal_mode=
let g:ycm_complete_in_visual_mode=
let g:ycm_complete_in_command_mode=
let g:ycm_complete_in_python_string_literals=1
let g:ycm_complete_in_comments=1
let g:ycm_complete_in_strings=1
let g:ycm_complete_in_cpp_initializer_list=1
let g:ycm_complete_in_objc_method_call=1
let g:ycm_add_preview_to_completeopt=
let g:ycm_complete_in_select_mode=1
let g:ycm_complete_in_vim=1
let g:ycm_complete_in_insert_mode=1
let g:ycm_complete_in_normal_mode=
let g:ycm_complete_in_visual_mode=
let g:ycm_complete_in_command_mode=
let g:ycm_complete_in_python_string_literals=1
let g:ycm_complete_in_comments=1
let g:ycm_complete_in_strings=1
let g:ycm_complete_in_cpp_initializer_list=1
let g:ycm_complete_in_objc_method_call=1
let g:ycm_add_preview_to_completeopt=
let g:ycm_complete_in_select_mode=1
let g:ycm_complete_in_vim=1
let g:ycm_complete_in_insert_mode=1
let g:ycm_complete_in_normal_mode=
let g:ycm_complete_in_visual_mode=
let g:ycm_complete_in_command_mode=
let g:ycm_complete_in_python_string_literals=1
let g:ycm_complete_in_comments=1
let g:ycm_complete_in_strings=1
let g:ycm_complete_in_cpp_initializer_list=1
let g:ycm_complete_in_objc_method_call=1
let g:ycm_add_preview_to_completeopt=
let g:ycm_complete_in_select_mode=1
let g:ycm_complete_in_vim=1
let g:ycm_complete_in_insert_mode=1
let g:ycm_complete_in_normal_mode=
let g:ycm_complete_in_visual_mode=
let g:ycm_complete_in_command_mode=
let g:ycm_complete_in_python_string_literals=1
let g:ycm_complete_in_comments=1
let g:ycm_complete_in_strings=1
let g:ycm_complete_in_cpp_initializer_list=1
let g:ycm_complete_in_objc_method_call=1
let g:ycm_add_preview_to_completeopt=
let g:ycm_complete_in_select_mode=1
let g:ycm_complete_in_vim=1
let g:ycm_complete_in_insert_mode=1
let g:ycm_complete_in_normal_mode=
let g:ycm_complete_in_visual_mode=
let g:ycm_complete_in_command_mode=
let g:ycm_complete_in_python_string_literals=1
let g:ycm_complete_in_comments=1
let g:ycm_complete_in_strings=1
let g:ycm_complete_in_cpp_initializer_list=1
let g:ycm_complete_in_objc_method_call=1
let g:ycm_add_preview_to_completeopt=
let g:ycm_complete_in_select_mode
阅读全文