-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathyoucompleteme.vim
55 lines (42 loc) · 1.71 KB
/
youcompleteme.vim
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
augroup youcompleteme_commands
autocmd!
" python related configurations
autocmd FileType python nnoremap <buffer> <Leader>dc :YcmCompleter GetDoc<CR>
autocmd FileType python nnoremap <buffer> <Leader>fu :YcmCompleter GoToReferences<CR>
autocmd FileType python nnoremap <buffer> gd :YcmCompleter GoTo<CR>
" rename for javascript and typescript
autocmd filetype ts nmap <F2> :YcmCompleter Rename<F12>
augroup END
" use user defined python instead of the default python
if exists("$vim_ycm_server_python_interpreter")
let g:ycm_server_python_interpreter = $vim_ycm_server_python_interpreter
endif
" If you want :UltiSnipsEdit to split your window.
let g:UltiSnipsEditSplit="vertical"
" YouCompleteMe black list
let g:ycm_filetype_blacklist = {
\ 'tagbar' : 1,
\ 'qf' : 1,
\ 'notes' : 1,
\ 'unite' : 1,
\ 'text' : 1,
\ 'vimwiki' : 1,
\ 'gitcommit' : 1,
\}
" YouCompleteMe conflict with ultisnips 'tab'
let g:ycm_key_list_select_completion = ['<c-n>', '<Down>']
let g:ycm_key_list_previous_completion = ['<c-p>', '<Up>']
" For the shotkey conflict with ultisnips
let g:UltiSnipsExpandTrigger="<tab>"
let g:UltiSnipsJumpForwardTrigger="<c-k>"
let g:UltiSnipsJumpBackwardTrigger="<c-j>"
" list all available snip
nnoremap <Leader><tab> :call UltiSnips#ListSnippets()<CR>
" For ultisnip to create snip in correct directory
let g:UltiSnipsSnippetDirectories = [$HOME . '/.vim/UltiSnips', 'UltiSnips']
" g:ultisnips_python_style
let g:ultisnips_python_style="sphinx"
let g:ycm_always_populate_location_list = 1
nnoremap <silent> gd :YcmCompleter GoTo<CR>
nnoremap <silent> <F12> :YcmCompleter GoToImplementation<CR>
nnoremap <silent> gr :YcmCompleter GoToReferences<CR>