-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathYouCompleteMe_conf.txt
More file actions
executable file
·23 lines (20 loc) · 1.34 KB
/
YouCompleteMe_conf.txt
File metadata and controls
executable file
·23 lines (20 loc) · 1.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
" 自动补全 YouCompleteMe
" vim上的自动补全插件,注意该插件需要手动编译!!!
" 如果使用Vundle更新了YouCompleteMe,也需要重新编译!!!
let g:ycm_autoclose_preview_window_after_completion=1 " 完成操作之后自动补全窗口不消失
" 默认情况下输入`.`,`->`,`::`之后会触发补全函数和类,但是默认情况下是不补全全局函数的,
" 所以C语言中的printf之类的函数就无法补全。解决办法就是手动调用补全,对应的YCM函数是:
" ycm_key_invoke_completion,将其绑定到快捷键`ctrl+a`:
let g:ycm_key_invoke_completion = '<C-a>' " 默认是<C-Space>,与切换输入法冲突
" let g:ycm_global_ycm_extra_conf = '~/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp/ycm/.ycm_extra_conf.py'
let g:ycm_global_ycm_extra_conf = '~/.ycm_extra_conf.py'
autocmd InsertLeave * if pumvisible() == 0|pclose|endif " 离开插入模式后自动关闭预览窗口
let g:ycm_confirm_extra_conf = 0 " 关闭加载.ycm_extra_conf.py提示
map <leader>g :YcmCompleter GoToDefinitionElseDeclaration<CR> " 使用 \g 作为转到定义的快捷键
" Python with virtualenv support
python3 << EOF
import sys, vim, os
ve_dir = vim.eval('$VIRTUAL_ENV')
ve_dir in sys.path or sys.path.insert(0, ve_dir)
activate_this = os.path.join(os.path.join(ve_dir, 'bin'), 'activate_this.py')
EOF