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

Add omni patterns for c&cpp struct

close #499
This commit is contained in:
wsdjeg 2017-05-06 20:48:06 +08:00
parent 7e9742a171
commit cdc903627b

View File

@ -1,17 +1,25 @@
let g:neocomplete#data_directory= get(g:, 'neocomplete#data_directory', '~/.cache/neocomplete') let g:neocomplete#data_directory= get(g:, 'neocomplete#data_directory',
\ '~/.cache/neocomplete')
let g:acp_enableAtStartup = get(g:, 'acp_enableAtStartup', 0) let g:acp_enableAtStartup = get(g:, 'acp_enableAtStartup', 0)
let g:neocomplete#enable_at_startup = get(g:, 'neocomplete#enable_at_startup', 1) let g:neocomplete#enable_at_startup =
\ get(g:, 'neocomplete#enable_at_startup', 1)
" Use smartcase. " Use smartcase.
let g:neocomplete#enable_smart_case = get(g:, 'neocomplete#enable_smart_case', 1) let g:neocomplete#enable_smart_case =
let g:neocomplete#enable_camel_case = get(g:, 'neocomplete#enable_camel_case', 1) \ get(g:, 'neocomplete#enable_smart_case', 1)
let g:neocomplete#enable_camel_case =
\ get(g:, 'neocomplete#enable_camel_case', 1)
"let g:neocomplete#enable_ignore_case = 1 "let g:neocomplete#enable_ignore_case = 1
let g:neocomplete#enable_fuzzy_completion = get(g:, 'neocomplete#enable_fuzzy_completion', 1) let g:neocomplete#enable_fuzzy_completion =
\ get(g:, 'neocomplete#enable_fuzzy_completion', 1)
" Set minimum syntax keyword length. " Set minimum syntax keyword length.
let g:neocomplete#sources#syntax#min_keyword_length = get(g:, 'neocomplete#sources#syntax#min_keyword_length', 3) let g:neocomplete#sources#syntax#min_keyword_length =
let g:neocomplete#lock_buffer_name_pattern = get(g:, 'neocomplete#lock_buffer_name_pattern', '\*ku\*') \ get(g:, 'neocomplete#sources#syntax#min_keyword_length', 3)
let g:neocomplete#lock_buffer_name_pattern =
\ get(g:, 'neocomplete#lock_buffer_name_pattern', '\*ku\*')
" Define dictionary. " Define dictionary.
let g:neocomplete#sources#dictionary#dictionaries = get(g:, 'neocomplete#sources#dictionary#dictionaries', { let g:neocomplete#sources#dictionary#dictionaries =
\ get(g:, 'neocomplete#sources#dictionary#dictionaries', {
\ 'default' : '', \ 'default' : '',
\ 'vimshell' : $CACHE.'/vimshell/command-history', \ 'vimshell' : $CACHE.'/vimshell/command-history',
\ 'java' : '~/.vim/dict/java.dict', \ 'java' : '~/.vim/dict/java.dict',
@ -19,13 +27,15 @@ let g:neocomplete#sources#dictionary#dictionaries = get(g:, 'neocomplete#sources
\ 'scala' : '~/.vim/dict/scala.dict', \ 'scala' : '~/.vim/dict/scala.dict',
\ }) \ })
let g:neocomplete#enable_auto_delimiter = get(g:, 'neocomplete#enable_auto_delimiter', 1) let g:neocomplete#enable_auto_delimiter =
\ get(g:, 'neocomplete#enable_auto_delimiter', 1)
" Define keyword. " Define keyword.
if !exists('g:neocomplete#keyword_patterns') if !exists('g:neocomplete#keyword_patterns')
let g:neocomplete#keyword_patterns = {} let g:neocomplete#keyword_patterns = {}
endif endif
let g:neocomplete#keyword_patterns._ = get(g:neocomplete#keyword_patterns, '_', '\h\k*(\?') let g:neocomplete#keyword_patterns._ =
\ get(g:neocomplete#keyword_patterns, '_', '\h\k*(\?')
" AutoComplPop like behavior. " AutoComplPop like behavior.
let g:neocomplete#enable_auto_select = 0 let g:neocomplete#enable_auto_select = 0
@ -34,9 +44,21 @@ if !exists('g:neocomplete#sources#omni#input_patterns')
let g:neocomplete#sources#omni#input_patterns = {} let g:neocomplete#sources#omni#input_patterns = {}
endif endif
let g:neocomplete#sources#omni#input_patterns.perl = get(g:neocomplete#sources#omni#input_patterns, 'perl', '\h\w*->\h\w*\|\h\w*::') let g:neocomplete#sources#omni#input_patterns.perl =
let g:neocomplete#sources#omni#input_patterns.java = get(g:neocomplete#sources#omni#input_patterns, 'java','[^. \t0-9]\.\w*') \ get(g:neocomplete#sources#omni#input_patterns, 'perl',
let g:neocomplete#sources#omni#input_patterns.lua = get(g:neocomplete#sources#omni#input_patterns, 'lua','[^. \t0-9]\.\w*') \ '\h\w*->\h\w*\|\h\w*::')
let g:neocomplete#sources#omni#input_patterns.java =
\ get(g:neocomplete#sources#omni#input_patterns, 'java',
\ '[^. \t0-9]\.\w*')
let g:neocomplete#sources#omni#input_patterns.lua =
\ get(g:neocomplete#sources#omni#input_patterns, 'lua',
\ '[^. \t0-9]\.\w*')
let g:neocomplete#sources#omni#input_patterns.c =
\ get(g:neocomplete#sources#omni#input_patterns, 'c',
\ '[^.[:digit:] *\t]\%(\.\|->\)')
let g:neocomplete#sources#omni#input_patterns.cpp =
\ get(g:neocomplete#sources#omni#input_patterns, 'cpp',
\ '[^.[:digit:] *\t]\%(\.\|->\)\|\h\w*::')
if !exists('g:neocomplete#force_omni_input_patterns') if !exists('g:neocomplete#force_omni_input_patterns')
let g:neocomplete#force_omni_input_patterns = {} let g:neocomplete#force_omni_input_patterns = {}
endif endif
@ -47,4 +69,4 @@ inoremap <expr><BS> neocomplete#smart_close_popup()."\<C-h>"
inoremap <expr><C-y> neocomplete#close_popup() inoremap <expr><C-y> neocomplete#close_popup()
inoremap <expr><C-e> neocomplete#cancel_popup() inoremap <expr><C-e> neocomplete#cancel_popup()
" vim:set et sw=2: " vim:set et sw=2 cc=80: