1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-01-23 13:10:04 +08:00

Fix ycm config

This commit is contained in:
wsdjeg 2017-12-05 08:54:32 +08:00
parent cafdeffbff
commit d3931cd673

View File

@ -1,24 +1,39 @@
"let g:ycm_global_ycm_extra_conf = '~/.ycm_extra_conf.py' "let g:ycm_global_ycm_extra_conf = '~/.ycm_extra_conf.py'
"let g:ycm_confirm_extra_conf = 0 "let g:ycm_confirm_extra_conf = 0
let g:ycm_collect_identifiers_from_tags_files = 1 let g:ycm_collect_identifiers_from_tags_files =
let g:ycm_collect_identifiers_from_comments_and_strings = 1 \ get(g:, 'ycm_collect_identifiers_from_tags_files', 1)
let g:ycm_key_list_select_completion = ['<C-TAB>', '<Down>'] let g:ycm_collect_identifiers_from_comments_and_strings =
let g:ycm_key_list_previous_completion = ['<C-S-TAB>','<Up>'] \ get(g:, 'ycm_collect_identifiers_from_comments_and_strings', 1)
let g:ycm_seed_identifiers_with_syntax = 1 let g:ycm_key_list_select_completion =
let g:ycm_key_invoke_completion = '<leader><tab>' \ get(g:, 'ycm_key_list_select_completion', ['<C-TAB>', '<Down>'])
let g:ycm_semantic_triggers = { let g:ycm_key_list_previous_completion =
\ 'c' : ['->', '.'], \ get(g:, 'ycm_key_list_previous_completion', ['<C-S-TAB>','<Up>'])
\ 'objc' : ['->', '.'], let g:ycm_seed_identifiers_with_syntax =
\ 'ocaml' : ['.', '#'], \ get(g:, 'ycm_seed_identifiers_with_syntax', 1)
\ 'cpp,objcpp' : ['->', '.', '::'], let g:ycm_key_invoke_completion =
\ 'perl' : ['->'], \ get(g:, 'ycm_key_invoke_completion', '<leader><tab>')
\ 'php' : ['->', '::'],
\ 'cs,javascript,d,python,perl6,scala,vb,elixir,go' : ['.'], let g:ycm_semantic_triggers = get(g:, 'ycm_semantic_triggers', {})
\ 'java,jsp' : ['.'],
\ 'vim' : ['re![_a-zA-Z]+[_\w]*\.'], function! s:set_ft_triggers(ft, expr, override) abort
\ 'ruby' : ['.', '::'], if a:override
\ 'lua' : ['.', ':'], let g:ycm_semantic_triggers[a:ft] = a:expr
\ 'erlang' : [':'], elseif !has_key(g:ycm_semantic_triggers, a:ft)
\ 'sh' : ['re![\w-]{2}', '/', '-'], let g:ycm_semantic_triggers[a:ft] = a:expr
\ 'zsh' : ['re![\w-]{2}', '/', '-'], endif
\ } endfunction
call s:set_ft_triggers('c', ['->', '.'], 0)
call s:set_ft_triggers('objc', ['->', '.'], 0)
call s:set_ft_triggers('ocaml', ['.', '#'], 0)
call s:set_ft_triggers('cpp,objcpp', ['->', '.', '::'], 0)
call s:set_ft_triggers('perl', ['->'], 0)
call s:set_ft_triggers('php', ['->', '::'], 0)
call s:set_ft_triggers('cs,javascript,d,python,perl6,scala,vb,elixir,go', ['.'], 0)
call s:set_ft_triggers('java,jsp', ['.'], 0)
call s:set_ft_triggers('vim', ['re![_a-zA-Z]+[_\w]*\.'], 0)
call s:set_ft_triggers('ruby', ['.', '::'], 0)
call s:set_ft_triggers('lua', ['.', ':'], 0)
call s:set_ft_triggers('erlang', [':'], 0)
call s:set_ft_triggers('sh', ['re![\w-]{2}', '/', '-'], 0)
call s:set_ft_triggers('zsh', ['re![\w-]{2}', '/', '-'], 0)