diff --git a/config/plugins/LeaderF.vim b/config/plugins/LeaderF.vim index 5c5d3ead1..ef4ce8619 100644 --- a/config/plugins/LeaderF.vim +++ b/config/plugins/LeaderF.vim @@ -1,3 +1,3 @@ scriptencoding utf-8 -let g:Lf_StlSeparator = { 'left': '', 'right': '' } -let g:Lf_StlColorscheme = 'spacevim' +let g:Lf_StlSeparator = get(g:, 'Lf_StlSeparator', { 'left': '', 'right': '' }) +let g:Lf_StlColorscheme = get(g:, 'Lf_StlColorscheme', 'spacevim') diff --git a/config/plugins/ag.vim b/config/plugins/ag.vim index 3d2acd902..d553df052 100644 --- a/config/plugins/ag.vim +++ b/config/plugins/ag.vim @@ -1,2 +1,2 @@ -let g:ag_prg='ag --vimgrep' -let g:ag_working_path_mode='r' +let g:ag_prg= get(g:, 'ag_prg', 'ag --vimgrep') +let g:ag_working_path_mode= get(g:, 'ag_working_path_mode', 'r') diff --git a/config/plugins/denite.vim b/config/plugins/denite.vim index 11ed09bb8..04974ece4 100644 --- a/config/plugins/denite.vim +++ b/config/plugins/denite.vim @@ -4,7 +4,8 @@ let s:sys = SpaceVim#api#import('system') " denite option -let s:denite_options = {'default' : { +let s:denite_options = get(g:, 'denite_options', { + \ 'default' : { \ 'winheight' : 15, \ 'mode' : 'insert', \ 'quit' : 'true', @@ -13,7 +14,7 @@ let s:denite_options = {'default' : { \ 'direction': 'rightbelow', \ 'statusline' : 'false', \ 'prompt' : '➭', - \ }} + \ }}) function! s:profile(opts) abort for fname in keys(a:opts) diff --git a/config/plugins/deoplete.vim b/config/plugins/deoplete.vim index b3d5a76f6..c2c168846 100644 --- a/config/plugins/deoplete.vim +++ b/config/plugins/deoplete.vim @@ -1,70 +1,70 @@ " deoplete options -let g:deoplete#enable_at_startup = 1 -let g:deoplete#enable_ignore_case = 1 -let g:deoplete#enable_smart_case = 1 -let g:deoplete#enable_camel_case = 1 -let g:deoplete#enable_refresh_always = 1 -let g:deoplete#max_abbr_width = 0 -let g:deoplete#max_menu_width = 0 +let g:deoplete#enable_at_startup = get(g:, 'deoplete#enable_at_startup', 1) +let g:deoplete#enable_ignore_case = get(g:, 'deoplete#enable_ignore_case', 1) +let g:deoplete#enable_smart_case = get(g:, 'deoplete#enable_smart_case', 1) +let g:deoplete#enable_camel_case = get(g:, 'deoplete#enable_camel_case', 1) +let g:deoplete#enable_refresh_always = get(g:, 'deoplete#enable_refresh_always', 1) +let g:deoplete#max_abbr_width = get(g:, 'deoplete#max_abbr_width', 0) +let g:deoplete#max_menu_width = get(g:, 'deoplete#max_menu_width', 0) " init deoplet option dict let g:deoplete#ignore_sources = get(g:,'deoplete#ignore_sources',{}) let g:deoplete#omni#input_patterns = get(g:,'deoplete#omni#input_patterns',{}) let g:deoplete#omni_patterns = get(g:, 'deoplete#omni_patterns', {}) " java && jsp -let g:deoplete#omni#input_patterns.java = [ +let g:deoplete#omni#input_patterns.java = get(g:, 'deoplete#omni#input_patterns', [ \'[^. \t0-9]\.\w*', \'[^. \t0-9]\->\w*', \'[^. \t0-9]\::\w*', - \] -let g:deoplete#omni#input_patterns.jsp = ['[^. \t0-9]\.\w*'] + \]) +let g:deoplete#omni#input_patterns.jsp = get(g:, 'deoplete#omni#input_patterns', ['[^. \t0-9]\.\w*']) if g:spacevim_enable_javacomplete2_py - let g:deoplete#ignore_sources.java = ['omni'] + let g:deoplete#ignore_sources.java = get(g:, 'deoplete#ignore_sources', ['omni']) call deoplete#custom#set('javacomplete2', 'mark', '') else - let g:deoplete#ignore_sources.java = ['javacomplete2'] + let g:deoplete#ignore_sources.java = get(g:, 'deoplete#ignore_sources', ['javacomplete2']) call deoplete#custom#set('omni', 'mark', '') endif " go -let g:deoplete#ignore_sources.go = ['omni'] +let g:deoplete#ignore_sources.go = get(g:, 'deoplete#ignore_sources', ['omni']) call deoplete#custom#set('go', 'mark', '') call deoplete#custom#set('go', 'rank', 9999) " perl -let g:deoplete#omni#input_patterns.perl = [ +let g:deoplete#omni#input_patterns.perl = get(g:, 'deoplete#omni#input_patterns', [ \'[^. \t0-9]\.\w*', \'[^. \t0-9]\->\w*', \'[^. \t0-9]\::\w*', - \] + \]) " javascript -let g:deoplete#omni#input_patterns.javascript = ['[^. \t0-9]\.\w*'] +let g:deoplete#omni#input_patterns.javascript = get(g:, 'deoplete#omni#input_patterns', ['[^. \t0-9]\.\w*']) " php -let g:deoplete#omni#input_patterns.php = [ +let g:deoplete#omni#input_patterns.php = get(g:, 'deoplete#omni#input_patterns', [ \'[^. \t0-9]\.\w*', \'[^. \t0-9]\->\w*', \'[^. \t0-9]\::\w*', - \] -let g:deoplete#ignore_sources.php = ['omni', 'around', 'member'] + \]) +let g:deoplete#ignore_sources.php = get(g:, 'deoplete#ignore_sources', ['omni', 'around', 'member']) call deoplete#custom#set('phpcd', 'mark', '') call deoplete#custom#set('phpcd', 'input_pattern', '\w*|[^. \t]->\w*|\w*::\w*') " lua -let g:deoplete#omni_patterns.lua = '.' +let g:deoplete#omni_patterns.lua = get(g:, 'deoplete#omni_patterns', '.') " c c++ call deoplete#custom#set('clang2', 'mark', '') -let g:deoplete#ignore_sources.c = ['omni'] +let g:deoplete#ignore_sources.c = get(g:, 'deoplete#ignore_sources', ['omni']) " rust -let g:deoplete#ignore_sources.rust = ['omni'] +let g:deoplete#ignore_sources.rust = get(g:, 'deoplete#ignore_sources', ['omni']) call deoplete#custom#set('racer', 'mark', '') " public settings call deoplete#custom#set('_', 'matchers', ['matcher_full_fuzzy']) -let g:deoplete#ignore_sources._ = ['around'] +let g:deoplete#ignore_sources._ = get(g:, 'deoplete#ignore_sources', ['around']) inoremap deoplete#mappings#smart_close_popup()."\" inoremap deoplete#mappings#smart_close_popup()."\" set isfname-== diff --git a/config/plugins/gruvbox.vim b/config/plugins/gruvbox.vim index 90bf52df2..e94235348 100644 --- a/config/plugins/gruvbox.vim +++ b/config/plugins/gruvbox.vim @@ -1 +1 @@ -let g:gruvbox_italic = 0 +let g:gruvbox_italic = get(g:, 'gruvbox_italic', 0) diff --git a/config/plugins/java_getset.vim b/config/plugins/java_getset.vim index e938d5fe4..082013f13 100644 --- a/config/plugins/java_getset.vim +++ b/config/plugins/java_getset.vim @@ -1,5 +1,5 @@ -let g:java_getset_disable_map = 1 -let g:javagetset_setterTemplate = +let g:java_getset_disable_map = get(g:, 'java_getset_disable_map', 1) +let g:javagetset_setterTemplate = get(g:, 'javagetset_setterTemplate', \ "/**\n" . \ " * Set %varname%.\n" . \ " *\n" . @@ -7,8 +7,8 @@ let g:javagetset_setterTemplate = \ " */\n" . \ "%modifiers% void %funcname%(%type% %varname%){\n" . \ " this.%varname% = %varname%;\n" . - \ "}" -let g:javagetset_getterTemplate = + \ "}") +let g:javagetset_getterTemplate = get(g:, 'javagetset_getterTemplate', \ "/**\n" . \ " * Get %varname%.\n" . \ " *\n" . @@ -16,6 +16,6 @@ let g:javagetset_getterTemplate = \ " */\n" . \ "%modifiers% %type% %funcname%(){\n" . \ " return %varname%;\n" . - \ "}" + \ "}") " vim:set et sw=2: diff --git a/config/plugins/neocomplcache.vim b/config/plugins/neocomplcache.vim index 810c641ec..1ee77b82c 100644 --- a/config/plugins/neocomplcache.vim +++ b/config/plugins/neocomplcache.vim @@ -1,41 +1,41 @@ "--------------------------------------------------------------------------- " neocomplache.vim " -let g:neocomplcache_enable_at_startup = 1 +let g:neocomplcache_enable_at_startup = get(g:, 'neocomplcache_enable_at_startup', 1) " Use smartcase -let g:neocomplcache_enable_smart_case = 1 +let g:neocomplcache_enable_smart_case = get(g:, 'neocomplcache_enable_smart_case', 1) " Use camel case completion. -let g:neocomplcache_enable_camel_case_completion = 1 +let g:neocomplcache_enable_camel_case_completion = get(g:, 'neocomplcache_enable_camel_case_completion', 1) " Use underbar completion. -let g:neocomplcache_enable_underbar_completion = 1 +let g:neocomplcache_enable_underbar_completion = get(g:, 'neocomplcache_enable_underbar_completion', 1) " Use fuzzy completion. -let g:neocomplcache_enable_fuzzy_completion = 1 +let g:neocomplcache_enable_fuzzy_completion = get(g:, 'neocomplcache_enable_fuzzy_completion', 1) " Set minimum syntax keyword length. -let g:neocomplcache_min_syntax_length = 3 +let g:neocomplcache_min_syntax_length = get(g:, 'neocomplcache_min_syntax_length', 3) " Set auto completion length. -let g:neocomplcache_auto_completion_start_length = 2 +let g:neocomplcache_auto_completion_start_length = get(g:, 'neocomplcache_auto_completion_start_length', 2) " Set manual completion length. -let g:neocomplcache_manual_completion_start_length = 0 +let g:neocomplcache_manual_completion_start_length = get(g:, 'neocomplcache_manual_completion_start_length', 0) " Set minimum keyword length. -let g:neocomplcache_min_keyword_length = 3 +let g:neocomplcache_min_keyword_length = get(g:, 'neocomplcache_min_keyword_length', 3) " let g:neocomplcache_enable_cursor_hold_i = v:version > 703 || " \ v:version == 703 && has('patch289') -let g:neocomplcache_enable_cursor_hold_i = 0 -let g:neocomplcache_cursor_hold_i_time = 300 -let g:neocomplcache_enable_insert_char_pre = 1 -let g:neocomplcache_enable_prefetch = 1 -let g:neocomplcache_skip_auto_completion_time = '0.6' +let g:neocomplcache_enable_cursor_hold_i = get(g:, 'neocomplcache_enable_cursor_hold_i', 0) +let g:neocomplcache_cursor_hold_i_time = get(g:, 'neocomplcache_cursor_hold_i_time', 300) +let g:neocomplcache_enable_insert_char_pre = get(g:, 'neocomplcache_enable_insert_char_pre', 1) +let g:neocomplcache_enable_prefetch = get(g:, 'neocomplcache_enable_prefetch', 1) +let g:neocomplcache_skip_auto_completion_time = get(g:, 'neocomplcache_skip_auto_completion_time', '0.6') " For auto select. -let g:neocomplcache_enable_auto_select = 0 +let g:neocomplcache_enable_auto_select = get(g:, 'neocomplcache_enable_auto_select', 0) -let g:neocomplcache_enable_auto_delimiter = 1 -let g:neocomplcache_disable_auto_select_buffer_name_pattern = - \ '\[Command Line\]' +let g:neocomplcache_enable_auto_delimiter = get(g:, 'neocomplcache_enable_auto_delimiter', 1) +let g:neocomplcache_disable_auto_select_buffer_name_pattern = get(g:, 'neocomplcache_disable_auto_select_buffer_name_pattern', + \ '\[Command Line\]') "let g:neocomplcache_disable_auto_complete = 0 -let g:neocomplcache_max_list = 100 -let g:neocomplcache_force_overwrite_completefunc = 1 +let g:neocomplcache_max_list = get(g:, 'neocomplcache_max_list', 100) +let g:neocomplcache_force_overwrite_completefunc = get(g:, 'neocomplcache_force_overwrite_completefunc', 1) if !exists('g:neocomplcache_omni_patterns') let g:neocomplcache_omni_patterns = {} endif @@ -45,21 +45,24 @@ endif if !exists('g:neocomplcache_force_omni_patterns') let g:neocomplcache_force_omni_patterns = {} endif -let g:neocomplcache_enable_auto_close_preview = 1 -" let g:neocomplcache_force_omni_patterns.ruby = '[^. *\t]\.\w*\|\h\w*::' -let g:neocomplcache_omni_patterns.ruby = '[^. *\t]\.\w*\|\h\w*::' -let g:neocomplcache_omni_patterns.java = '[^. *\t]\.\w*\|\h\w*::' -let g:neocomplcache_force_omni_patterns.java = '[^. *\t]\.\w*\|\h\w*::' +let g:neocomplcache_enable_auto_close_preview = get(g:, 'neocomplcache_enable_auto_close_preview', 1) +" let g:neocomplcache_force_omni_patterns.ruby = get(g:, ': ,[^. *\t]\.\w*\|\h\w*::') +let g:neocomplcache_omni_patterns.ruby = get(g:, 'neocomplcache_omni_patterns', + \ '[^. *\t]\.\w*\|\h\w*::') +let g:neocomplcache_omni_patterns.java = get(g:, 'neocomplcache_omni_patterns', + \ '[^. *\t]\.\w*\|\h\w*::') +let g:neocomplcache_force_omni_patterns.java = get(g:, 'neocomplcache_force_omni_patterns', + \ '[^. *\t]\.\w*\|\h\w*::') " For clang_complete. -let g:neocomplcache_force_overwrite_completefunc = 1 -let g:neocomplcache_force_omni_patterns.c = - \ '[^.[:digit:] *\t]\%(\.\|->\)' -let g:neocomplcache_force_omni_patterns.cpp = - \ '[^.[:digit:] *\t]\%(\.\|->\)\|\h\w*::' -let g:clang_complete_auto = 0 -let g:clang_auto_select = 0 -let g:clang_use_library = 1 +let g:neocomplcache_force_overwrite_completefunc = get(g:, 'neocomplcache_force_overwrite_completefunc', 1) +let g:neocomplcache_force_omni_patterns.c = get(g:, 'neocomplcache_force_omni_patterns', + \ '[^.[:digit:] *\t]\%(\.\|->\)') +let g:neocomplcache_force_omni_patterns.cpp = get(g:, 'neocomplcache_force_omni_patterns', + \ '[^.[:digit:] *\t]\%(\.\|->\)\|\h\w*::') +let g:clang_complete_auto = get(g:, 'clang_complete_auto', 0) +let g:clang_auto_select = get(g:, 'clang_auto_select', 0) +let g:clang_use_library = get(g:, 'clang_use_library', 1) " Define keyword pattern. if !exists('g:neocomplcache_keyword_patterns') @@ -67,9 +70,9 @@ if !exists('g:neocomplcache_keyword_patterns') endif let g:neocomplcache_keyword_patterns['default'] = '[0-9a-zA-Z:#_]\+' let g:neocomplcache_keyword_patterns.perl = '\h\w*->\h\w*\|\h\w*::' -let g:neocomplete#enable_multibyte_completion = 1 +let g:neocomplete#enable_multibyte_completion = get(g:, 'neocomplete#enable_multibyte_completion', 1) -let g:neocomplcache_vim_completefuncs = { +let g:neocomplcache_vim_completefuncs = get(g:, 'neocomplcache_vim_completefuncs', { \ 'Ref' : 'ref#complete', \ 'Unite' : 'unite#complete_source', \ 'VimShellExecute' : @@ -81,6 +84,6 @@ let g:neocomplcache_vim_completefuncs = { \ 'VimShell' : 'vimshell#complete', \ 'VimFiler' : 'vimfiler#complete', \ 'Vinarise' : 'vinarise#complete', - \} + \}) " vim:set et sw=2: diff --git a/config/plugins/neocomplete.vim b/config/plugins/neocomplete.vim index 391ba4a1d..1c6922a03 100644 --- a/config/plugins/neocomplete.vim +++ b/config/plugins/neocomplete.vim @@ -1,25 +1,25 @@ -let g:neocomplete#data_directory='~/.cache/neocomplete' -let g:acp_enableAtStartup = 0 -let g:neocomplete#enable_at_startup = 1 +let g:neocomplete#data_directory= get(g:, 'neocomplete#data_directory','~/.cache/neocomplete') +let g:acp_enableAtStartup = get(g:, 'acp_enableAtStartup', 0) +let g:neocomplete#enable_at_startup = get(g:, 'neocomplete#enable_at_startup', 1) " Use smartcase. -let g:neocomplete#enable_smart_case = 1 -let g:neocomplete#enable_camel_case = 1 +let g:neocomplete#enable_smart_case = 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_fuzzy_completion = 1 +let g:neocomplete#enable_fuzzy_completion = get(g:, 'neocomplete#enable_fuzzy_completion', 1) " Set minimum syntax keyword length. -let g:neocomplete#sources#syntax#min_keyword_length = 3 -let g:neocomplete#lock_buffer_name_pattern = '\*ku\*' +let g:neocomplete#sources#syntax#min_keyword_length = 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. -let g:neocomplete#sources#dictionary#dictionaries = { +let g:neocomplete#sources#dictionary#dictionaries = get(g:, 'neocomplete#sources#dictionary#dictionaries', { \ 'default' : '', \ 'vimshell' : $CACHE.'/vimshell/command-history', \ 'java' : '~/.vim/dict/java.dict', \ 'ruby' : '~/.vim/dict/ruby.dict', \ 'scala' : '~/.vim/dict/scala.dict', - \ } + \ }) -let g:neocomplete#enable_auto_delimiter = 1 +let g:neocomplete#enable_auto_delimiter = get(g:, 'neocomplete#enable_auto_delimiter', 1) " Define keyword. if !exists('g:neocomplete#keyword_patterns') diff --git a/config/plugins/neomake.vim b/config/plugins/neomake.vim index c951d2982..8a5ab9592 100644 --- a/config/plugins/neomake.vim +++ b/config/plugins/neomake.vim @@ -3,12 +3,12 @@ scriptencoding utf-8 let g:neomake_open_list = get(g:, 'neomake_open_list', 2) let g:neomake_verbose = get(g:, 'neomake_verbose', 0) let g:neomake_java_javac_delete_output = get(g:, 'neomake_java_javac_delete_output', 0) -let g:neomake_error_sign = { +let g:neomake_error_sign = get(g:, 'neomake_error_sign', { \ 'text': get(g:, 'spacevim_error_symbol', '✖'), \ 'texthl': (g:spacevim_colorscheme ==# 'gruvbox' ? 'GruvboxRedSign' : 'error'), - \ } -let g:neomake_warning_sign = { + \ }) +let g:neomake_warning_sign = get(g:, 'neomake_warning_sign', { \ 'text': get(g:,'spacevim_warning_symbol', '➤'), \ 'texthl': (g:spacevim_colorscheme ==# 'gruvbox' ? 'GruvboxYellowSign' : 'todo'), - \ } + \ }) " vim:set et sw=2: diff --git a/config/plugins/neosnippet.vim b/config/plugins/neosnippet.vim index bd90d701d..a191075fd 100644 --- a/config/plugins/neosnippet.vim +++ b/config/plugins/neosnippet.vim @@ -10,9 +10,12 @@ endif if g:spacevim_force_global_config == 0 let g:neosnippet#snippets_directory = [getcwd() . '/.Spacevim.d/snippets'] + g:neosnippet#snippets_directory endif -let g:neosnippet#enable_snipmate_compatibility=1 -let g:neosnippet#enable_complete_done = 1 -let g:neosnippet#completed_pairs= {} +let g:neosnippet#enable_snipmate_compatibility = get(g:, 'neosnippet#enable_snipmate_compatibility', 1) +let g:neosnippet#enable_complete_done = get(g:, 'neosnippet#enable_complete_done', 1) + +if !exists('g:neosnippet#completed_pairs') + let g:neosnippet#completed_pairs = {} +endif let g:neosnippet#completed_pairs.java = {'(' : ')'} if g:neosnippet#enable_complete_done let g:neopairs#enable = 0 diff --git a/config/plugins/open-brower.vim b/config/plugins/open-brower.vim index e8eca5454..d465a0dcc 100644 --- a/config/plugins/open-brower.vim +++ b/config/plugins/open-brower.vim @@ -1,6 +1,6 @@ "for open-browser {{{ " This is my setting. -let g:netrw_nogx = 1 " disable netrw's gx mapping. +let g:netrw_nogx = get(g:, 'netrw_nogx', 1) " disable netrw's gx mapping. "nmap gx (openbrowser-smart-search) "vmap gx (openbrowser-smart-search) "" Open URI under cursor. diff --git a/config/plugins/syntastic.vim b/config/plugins/syntastic.vim index 4b205fecf..565001b6f 100644 --- a/config/plugins/syntastic.vim +++ b/config/plugins/syntastic.vim @@ -2,19 +2,19 @@ scriptencoding utf-8 if !filereadable('pom.xml') && !filereadable('build.gradle') && isdirectory('bin') let g:syntastic_java_javac_options = '-d bin' endif -let g:syntastic_java_javac_config_file_enabled = 1 -let g:syntastic_java_javac_delete_output = 0 -let g:syntastic_always_populate_loc_list = 1 -let g:syntastic_auto_loc_list = 1 -let g:syntastic_check_on_open = 0 -let g:syntastic_check_on_wq = 0 +let g:syntastic_java_javac_config_file_enabled = get(g:, 'syntastic_java_javac_config_file_enabled', 1) +let g:syntastic_java_javac_delete_output = get(g:, 'syntastic_java_javac_delete_output', 0) +let g:syntastic_always_populate_loc_list = get(g:, 'syntastic_always_populate_loc_list', 1) +let g:syntastic_auto_loc_list = get(g:, 'syntastic_auto_loc_list', 1) +let g:syntastic_check_on_open = get(g:, 'syntastic_check_on_open', 0) +let g:syntastic_check_on_wq = get(g:, 'syntastic_check_on_wq', 0) let g:syntastic_error_symbol = get(g:, 'spacevim_error_symbol', '✖') let g:syntastic_warning_symbol = get(g:, 'spacevim_warning_symbol', '➤') -let g:syntastic_vimlint_options = { +let g:syntastic_vimlint_options = get(g:, 'syntastic_vimlint_options', { \'EVL102': 1 , \'EVL103': 1 , \'EVL205': 1 , \'EVL105': 1 , - \} + \}) " vim:set et sw=2: diff --git a/config/plugins/tagbar.vim b/config/plugins/tagbar.vim index 8721bc171..e6847c340 100644 --- a/config/plugins/tagbar.vim +++ b/config/plugins/tagbar.vim @@ -1,4 +1,4 @@ -let g:tagbar_width = g:spacevim_sidebar_width -let g:tagbar_left = 1 -let g:tagbar_sort = 0 -let g:tagbar_compact = 1 +let g:tagbar_width = get(g:, 'tagbar_width', g:spacevim_sidebar_width) +let g:tagbar_left = get(g:, 'tagbar_left', 1) +let g:tagbar_sort = get(g:, 'tagbar_sort', 0) +let g:tagbar_compact = get(g:, 'tagbar_compact', 1) diff --git a/config/plugins/taglist.vim b/config/plugins/taglist.vim index 06e1bb22c..48ff918ac 100644 --- a/config/plugins/taglist.vim +++ b/config/plugins/taglist.vim @@ -1,13 +1,13 @@ scriptencoding utf-8 if !executable('ctags') - let g:Tlist_Ctags_Cmd = '/usr/bin/ctags' "设置ctags执行路径 + let g:Tlist_Ctags_Cmd = get(g:, 'Tlist_Ctags_Cmd', '/usr/bin/ctags') "设置ctags执行路径 endif -let g:Tlist_Auto_Update=1 -let g:Tlist_Auto_Open =0 -let g:Tlist_Use_Right_Window=1 -let g:Tlist_Show_One_File=0 -let g:Tlist_File_Fold_Auto_Close=1 -let g:Tlist_Exit_OnlyWindow=1 -let g:Tlist_Show_Menu=1 +let g:Tlist_Auto_Update = get(g:, 'Tlist_Auto_Update', 1) +let g:Tlist_Auto_Open = get(g:, 'Tlist_Auto_Open', 0) +let g:Tlist_Use_Right_Window = get(g:, 'Tlist_Use_Right_Window', 1) +let g:Tlist_Show_One_File = get(g:, 'Tlist_Show_One_File', 0) +let g:Tlist_File_Fold_Auto_Close = get(g:, 'Tlist_File_Fold_Auto_Close', 1) +let g:Tlist_Exit_OnlyWindow = get(g:, 'Tlist_Exit_OnlyWindow', 1) +let g:Tlist_Show_Menu = get(g:, 'Tlist_Show_Menu', 1) " vim:set et sw=2: diff --git a/config/plugins/unite-gtags.vim b/config/plugins/unite-gtags.vim index ede3598e6..727780912 100644 --- a/config/plugins/unite-gtags.vim +++ b/config/plugins/unite-gtags.vim @@ -4,8 +4,8 @@ nnoremap gr :execute 'Unite -auto-preview -start-insert -no-split gtags nnoremap gg :execute 'Unite -auto-preview -start-insert -no-split gtags/grep' "nnoremap gp :execute 'Unite -auto-preview -start-insert -no-split gtags/completion' vnoremap gd :execute 'Unite -auto-preview -start-insert -no-split gtags/def:'.GetVisualSelection() -let g:unite_source_gtags_project_config = { +let g:unite_source_gtags_project_config = get(g:, 'unite_source_gtags_project_config', { \ '_': { 'treelize': 0 } - \ } + \ }) " vim:set et sw=2: diff --git a/config/plugins/unite-radio.vim b/config/plugins/unite-radio.vim index 136021cf2..830cf17fd 100644 --- a/config/plugins/unite-radio.vim +++ b/config/plugins/unite-radio.vim @@ -1 +1 @@ -let g:unite_source_radio_play_cmd='mpv' +let g:unite_source_radio_play_cmd= get(g:, 'unite_source_radio_play_cmd', 'mpv') diff --git a/config/plugins/unite.vim b/config/plugins/unite.vim index eb2d1472d..47e8e44ef 100644 --- a/config/plugins/unite.vim +++ b/config/plugins/unite.vim @@ -23,20 +23,20 @@ call unite#custom#profile('default', 'context', { call unite#custom#profile('source/neobundle/update', 'context', { \ 'start_insert' : 0, \ }) -let g:unite_source_codesearch_ignore_case = 1 -let g:unite_source_buffer_time_format = '(%m-%d-%Y %H:%M:%S) ' -let g:unite_source_file_mru_time_format = '(%m-%d-%Y %H:%M:%S) ' -let g:unite_source_directory_mru_time_format = '(%m-%d-%Y %H:%M:%S) ' -let g:unite_source_directory_mru_limit = 80 -let g:unite_source_file_rec_max_depth = 6 -let g:unite_enable_ignore_case = 1 -let g:unite_enable_smart_case = 1 -let g:unite_data_directory='~/.cache/unite' +let g:unite_source_codesearch_ignore_case = get(g:, 'unite_source_codesearch_ignore_case', 1) +let g:unite_source_buffer_time_format = get(g:, 'unite_source_buffer_time_format', '(%m-%d-%Y %H:%M:%S) ') +let g:unite_source_file_mru_time_format = get(g:, 'unite_source_file_mru_time_format', '(%m-%d-%Y %H:%M:%S) ') +let g:unite_source_directory_mru_time_format = get(g:, 'unite_source_directory_mru_time_format', '(%m-%d-%Y %H:%M:%S) ') +let g:unite_source_directory_mru_limit = get(g:, 'unite_source_directory_mru_limit', 80) +let g:unite_source_file_rec_max_depth = get(g:, 'unite_source_file_rec_max_depth', 6) +let g:unite_enable_ignore_case = get(g:, 'unite_enable_ignore_case', 1) +let g:unite_enable_smart_case = get(g:, 'unite_enable_smart_case', 1) +let g:unite_data_directory = get(g:, 'unite_data_directory','~/.cache/unite') "let g:unite_enable_start_insert=1 -let g:unite_source_history_yank_enable=1 -let g:unite_split_rule = 'botright' -let g:unite_winheight=25 -let g:unite_source_grep_default_opts = '-iRHn' +let g:unite_source_history_yank_enable = get(g:, 'unite_source_history_yank_enable', 1) +let g:unite_split_rule = get(g:, 'unite_split_rule', 'botright') +let g:unite_winheight = get(g:, 'unite_winheight', 25) +let g:unite_source_grep_default_opts = get(g:, 'unite_source_grep_default_opts', '-iRHn' \ . " --exclude='tags'" \ . " --exclude='cscope*'" \ . " --exclude='*.svn*'" @@ -46,13 +46,13 @@ let g:unite_source_grep_default_opts = '-iRHn' \ . " --exclude-dir='CVS'" \ . " --exclude-dir='.svn'" \ . " --exclude-dir='.git'" - \ . " --exclude-dir='node_modules'" -let g:unite_launch_apps = [ + \ . " --exclude-dir='node_modules'") +let g:unite_launch_apps = get(g:, 'unite_launch_apps', [ \ 'rake', \ 'make', \ 'git pull', - \ 'git push'] -let g:unite_source_menu_menus = get(g:,'unite_source_menu_menus',{}) + \ 'git push']) +let g:unite_source_menu_menus = get(g:, 'unite_source_menu_menus', {}) let g:unite_source_menu_menus.git = { \ 'description' : ' gestionar repositorios git \ ⌘ [espacio]g', @@ -135,52 +135,52 @@ let g:unite_source_menu_menus.StatusCodeDefinitions.command_candidates = [ \['➤ 505 HTTP Version Not Supported ', 'echo "HTTP Version Not Supported"'], \] nnoremap sc :Unite -silent -winheight=17 -start-insert menu:StatusCodeDefinitions -let g:unite_source_grep_max_candidates = 200 +let g:unite_source_grep_max_candidates = get(g:, 'unite_source_grep_max_candidates', 200) if executable('hw') " Use hw (highway) " https://github.com/tkengo/highway - let g:unite_source_grep_command = 'hw' - let g:unite_source_grep_default_opts = '--no-group --no-color' - let g:unite_source_grep_recursive_opt = '' + let g:unite_source_grep_command = get(g:, 'unite_source_grep_command', 'hw') + let g:unite_source_grep_default_opts = get(g:, 'unite_source_grep_default_opts', '--no-group --no-color') + let g:unite_source_grep_recursive_opt = get(g:, 'unite_source_grep_recursive_opt', '') elseif executable('ag') " Use ag (the silver searcher) " https://github.com/ggreer/the_silver_searcher - let g:unite_source_grep_command = 'ag' - let g:unite_source_grep_default_opts = + let g:unite_source_grep_command = get(g:, 'unite_source_grep_command', 'ag') + let g:unite_source_grep_default_opts = get(g:, 'unite_source_grep_default_opts', \ '-i --line-numbers --nocolor --nogroup --hidden --ignore ' . - \ '''.hg'' --ignore ''.svn'' --ignore ''.git'' --ignore ''.bzr''' - let g:unite_source_grep_recursive_opt = '' + \ '''.hg'' --ignore ''.svn'' --ignore ''.git'' --ignore ''.bzr''') + let g:unite_source_grep_recursive_opt = get(g:, 'unite_source_grep_recursive_opt', '') elseif executable('pt') " Use pt (the platinum searcher) " https://github.com/monochromegane/the_platinum_searcher - let g:unite_source_grep_command = 'pt' - let g:unite_source_grep_default_opts = '--nogroup --nocolor' - let g:unite_source_grep_recursive_opt = '' + let g:unite_source_grep_command = get(g:, 'unite_source_grep_command', 'pt') + let g:unite_source_grep_default_opts = get(g:, 'unite_source_grep_default_opts', '--nogroup --nocolor') + let g:unite_source_grep_recursive_opt = get(g:, 'unite_source_grep_recursive_opt', '') elseif executable('ack-grep') " Use ack " http://beyondgrep.com/ - let g:unite_source_grep_command = 'ack-grep' - let g:unite_source_grep_default_opts = - \ '-i --no-heading --no-color -k -H' - let g:unite_source_grep_recursive_opt = '' + let g:unite_source_grep_command = get(g:, 'unite_source_grep_command', 'ack-grep') + let g:unite_source_grep_default_opts = get(g:, 'unite_source_grep_default_opts', + \ '-i --no-heading --no-color -k -H') + let g:unite_source_grep_recursive_opt = get(g:, 'unite_source_grep_recursive_opt', '') elseif executable('ack') - let g:unite_source_grep_command = 'ack' - let g:unite_source_grep_default_opts = '-i --no-heading --no-color -k -H' - let g:unite_source_grep_recursive_opt = '' + let g:unite_source_grep_command = get(g:, 'unite_source_grep_command', 'ack') + let g:unite_source_grep_default_opts = get(g:, 'unite_source_grep_default_opts', '-i --no-heading --no-color -k -H') + let g:unite_source_grep_recursive_opt = get(g:, 'unite_source_grep_recursive_opt', '') elseif executable('jvgrep') " Use jvgrep " https://github.com/mattn/jvgrep - let g:unite_source_grep_command = 'jvgrep' - let g:unite_source_grep_default_opts = '-i --exclude ''\.(git|svn|hg|bzr)''' - let g:unite_source_grep_recursive_opt = '-R' + let g:unite_source_grep_command = get(g:, 'unite_source_grep_command', 'jvgrep') + let g:unite_source_grep_default_opts = get(g:, 'unite_source_grep_default_opts', '-i --exclude ''\.(git|svn|hg|bzr)''') + let g:unite_source_grep_recursive_opt = get(g:, 'unite_source_grep_recursive_opt', '-R') elseif executable('beagrep') " Use beagrep " https://github.com/baohaojun/beagrep - let g:unite_source_grep_command = 'beagrep' + let g:unite_source_grep_command = get(g:, 'unite_source_grep_command', 'beagrep') endif -let g:unite_source_rec_async_command = +let g:unite_source_rec_async_command = get(g:, 'unite_source_rec_async_command', \ ['ag', '--follow', '--nocolor', '--nogroup', - \ '--hidden', '-g', ''] + \ '--hidden', '-g', '']) nnoremap ufa :Unite -no-split -buffer-name=Mixed -start-insert file file_mru file_rec buffer nnoremap ufr :Unite -buffer-name=files file_rec/async:! nnoremap ufg :Unite -buffer-name=git-repo file_rec/git