Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

vim bundle update

  • Loading branch information...
commit 82d49ff48c4e636688879d7ccb8b9cbb05d72e59 1 parent 91fedf7
Gabriel Adomnicai authored

Showing 33 changed files with 3,136 additions and 3,965 deletions. Show diff stats Hide diff stats

  1. +13 13 .gitconfig.view
  2. +1 1  .vim/bundle/neocomplcache/README.md
  3. +870 520 .vim/bundle/neocomplcache/autoload/neocomplcache.vim
  4. +12 4 .vim/bundle/neocomplcache/autoload/neocomplcache/async_cache.vim
  5. +21 18 .vim/bundle/neocomplcache/autoload/neocomplcache/cache.vim
  6. +61 96 .vim/bundle/neocomplcache/autoload/neocomplcache/sources/buffer_complete.vim
  7. +20 24 .vim/bundle/neocomplcache/autoload/neocomplcache/sources/dictionary_complete.vim
  8. +33 18 .vim/bundle/neocomplcache/autoload/neocomplcache/sources/filename_complete.vim
  9. +69 55 .vim/bundle/neocomplcache/autoload/neocomplcache/sources/include_complete.vim
  10. +25 13 .vim/bundle/neocomplcache/autoload/neocomplcache/sources/member_complete.vim
  11. +187 125 .vim/bundle/neocomplcache/autoload/neocomplcache/sources/omni_complete.vim
  12. +16 20 .vim/bundle/neocomplcache/autoload/neocomplcache/sources/syntax_complete.vim
  13. +11 16 .vim/bundle/neocomplcache/autoload/neocomplcache/sources/tags_complete.vim
  14. +5 3 .vim/bundle/neocomplcache/autoload/neocomplcache/sources/vim_complete.vim
  15. +1 0  .vim/bundle/neocomplcache/autoload/neocomplcache/sources/vim_complete/autocmds.dict
  16. +22 11 .vim/bundle/neocomplcache/autoload/neocomplcache/sources/vim_complete/command_args.dict
  17. +19 15 .vim/bundle/neocomplcache/autoload/neocomplcache/sources/vim_complete/features.dict
  18. +49 24 .vim/bundle/neocomplcache/autoload/neocomplcache/sources/vim_complete/helper.vim
  19. +37 11 .vim/bundle/neocomplcache/autoload/neocomplcache/util.vim
  20. +153 0 .vim/bundle/neocomplcache/autoload/vital/_9813ec6.vim
  21. +222 0 .vim/bundle/neocomplcache/autoload/vital/_9813ec6/data/list.vim
  22. +356 0 .vim/bundle/neocomplcache/autoload/vital/_9813ec6/prelude.vim
  23. +88 0 .vim/bundle/neocomplcache/autoload/vital/_9813ec6/system/cache.vim
  24. +3 1 .vim/bundle/neocomplcache/autoload/vital/neocomplcache.vital
  25. +679 2,961 .vim/bundle/neocomplcache/doc/neocomplcache.txt
  26. +18 5 .vim/bundle/neocomplcache/plugin/neocomplcache.vim
  27. +37 0 .vim/bundle/neocomplcache/plugin/neocomplcache/buffer_complete.vim
  28. +25 0 .vim/bundle/neocomplcache/plugin/neocomplcache/dictionary_complete.vim
  29. +24 0 .vim/bundle/neocomplcache/plugin/neocomplcache/include_complete.vim
  30. +25 0 .vim/bundle/neocomplcache/plugin/neocomplcache/syntax_complete.vim
  31. +25 0 .vim/bundle/neocomplcache/plugin/neocomplcache/tags_complete.vim
  32. +0 2  .vim/bundle/snipmate.vim/snippets/javascript.snippets
  33. +9 9 .vimrc.view
26 .gitconfig.view
@@ -18,7 +18,7 @@ setlocal commentstring=;\ %s
18 18 setlocal complete=.,w,b,u,t,i
19 19 setlocal concealcursor=
20 20 setlocal conceallevel=0
21   -setlocal completefunc=neocomplcache#auto_complete
  21 +setlocal completefunc=neocomplcache#manual_complete
22 22 setlocal nocopyindent
23 23 setlocal cryptmethod=
24 24 setlocal nocursorbind
@@ -47,8 +47,8 @@ setlocal formatexpr=
47 47 setlocal formatoptions=croql
48 48 setlocal formatlistpat=^\\s*\\d\\+[\\]:.)}\\t\ ]\\s*
49 49 setlocal grepprg=
50   -setlocal iminsert=2
51   -setlocal imsearch=2
  50 +setlocal iminsert=0
  51 +setlocal imsearch=0
52 52 setlocal include=
53 53 setlocal includeexpr=
54 54 setlocal indentexpr=GetGitconfigIndent()
@@ -58,7 +58,7 @@ setlocal iskeyword=@,48-57,192-255,-
58 58 setlocal keywordprg=
59 59 setlocal linebreak
60 60 setlocal nolisp
61   -setlocal list
  61 +setlocal nolist
62 62 setlocal macmeta
63 63 setlocal makeprg=
64 64 setlocal matchpairs=(:),{:},[:]
@@ -67,7 +67,7 @@ setlocal modifiable
67 67 setlocal nrformats=octal,hex
68 68 setlocal number
69 69 setlocal numberwidth=4
70   -setlocal omnifunc=javascriptcomplete#CompleteJS
  70 +setlocal omnifunc=zencoding#CompleteTag
71 71 setlocal path=
72 72 setlocal nopreserveindent
73 73 setlocal nopreviewwindow
@@ -77,10 +77,10 @@ setlocal norelativenumber
77 77 setlocal norightleft
78 78 setlocal rightleftcmd=search
79 79 setlocal noscrollbind
80   -setlocal shiftwidth=4
  80 +setlocal shiftwidth=2
81 81 setlocal noshortname
82   -setlocal smartindent
83   -setlocal softtabstop=4
  82 +setlocal nosmartindent
  83 +setlocal softtabstop=2
84 84 setlocal nospell
85 85 setlocal spellcapcheck=[.?!]\\_[\\])'\"\ \ ]\\+
86 86 setlocal spellfile=
@@ -92,7 +92,7 @@ setlocal synmaxcol=3000
92 92 if &syntax != 'gitconfig'
93 93 setlocal syntax=gitconfig
94 94 endif
95   -setlocal tabstop=4
  95 +setlocal tabstop=2
96 96 setlocal tags=
97 97 setlocal textwidth=0
98 98 setlocal thesaurus=
@@ -102,13 +102,13 @@ setlocal nowinfixwidth
102 102 setlocal nowrap
103 103 setlocal wrapmargin=0
104 104 silent! normal! zE
105   -let s:l = 17 - ((16 * winheight(0) + 25) / 51)
  105 +let s:l = 1 - ((0 * winheight(0) + 30) / 60)
106 106 if s:l < 1 | let s:l = 1 | endif
107 107 exe s:l
108 108 normal! zt
109   -17
110   -normal! 020l
111   -lcd /gree/MLB
  109 +1
  110 +normal! 0
  111 +lcd /apps/blogmon/lib
112 112 let &so = s:so_save | let &siso = s:siso_save
113 113 doautoall SessionLoadPost
114 114 " vim: set ft=vim :
2  .vim/bundle/neocomplcache/README.md
Source Rendered
@@ -16,7 +16,7 @@ Installation
16 16 (usually ~/.vim/ or Program Files/Vim/vimfiles on Windows).
17 17 * Execute `|:NeoComplCacheEnable|` command or
18 18 `let g:neocomplcache_enable_at_startup = 1`
19   -in your .vimrc.
  19 +in your `.vimrc`. Not in `.gvimrc`(`_gvimrc`)!
20 20
21 21 Caution
22 22 -------
1,390 .vim/bundle/neocomplcache/autoload/neocomplcache.vim
... ... @@ -1,7 +1,7 @@
1 1 "=============================================================================
2 2 " FILE: neocomplcache.vim
3 3 " AUTHOR: Shougo Matsushita <Shougo.Matsu@gmail.com>
4   -" Last Modified: 26 Jul 2012.
  4 +" Last Modified: 07 Oct 2012.
5 5 " License: MIT license {{{
6 6 " Permission is hereby granted, free of charge, to any person obtaining
7 7 " a copy of this software and associated documentation files (the
@@ -22,7 +22,6 @@
22 22 " TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
23 23 " SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24 24 " }}}
25   -" Version: 7.1, for Vim 7.2
26 25 "=============================================================================
27 26
28 27 let s:save_cpo = &cpo
@@ -30,9 +29,34 @@ set cpo&vim
30 29
31 30 scriptencoding utf-8
32 31
  32 +function! s:initialize_variables()"{{{
  33 + let s:is_enabled = 1
  34 + let s:complfunc_sources = {}
  35 + let s:plugin_sources = {}
  36 + let s:ftplugin_sources = {}
  37 + let s:loaded_ftplugin_sources = {}
  38 + let s:sources_lock = {}
  39 + let s:cur_keyword_str = ''
  40 + let s:complete_words = []
  41 + let s:complete_results = {}
  42 + let s:cur_text = ''
  43 + let s:old_cur_text = ''
  44 + let s:moved_cur_text = ''
  45 + let s:changedtick = b:changedtick
  46 + let s:is_text_mode = 0
  47 + let s:within_comment = 0
  48 + let s:skip_next_complete = 0
  49 + let s:is_prefetch = 0
  50 + let s:use_sources = {}
  51 + let s:update_time_save = &updatetime
  52 + let s:filetype_frequencies = {}
  53 + let s:cur_keyword_pos = -1
  54 + let s:loaded_all_sources = 0
  55 +endfunction"}}}
  56 +
33 57 if !exists('s:is_enabled')
  58 + call s:initialize_variables()
34 59 let s:is_enabled = 0
35   - let s:context_filetype = ''
36 60 endif
37 61
38 62 function! neocomplcache#enable() "{{{
@@ -67,441 +91,531 @@ function! neocomplcache#enable() "{{{
67 91 endif
68 92 "}}}
69 93
70   - " Initialize"{{{
71   - let s:is_enabled = 1
72   - let s:complfunc_sources = {}
73   - let s:plugin_sources = {}
74   - let s:ftplugin_sources = {}
75   - let s:loaded_ftplugin_sources = {}
76   - let s:complete_lock = {}
77   - let s:sources_lock = {}
78   - let s:auto_completion_length = {}
79   - let s:cur_keyword_str = ''
80   - let s:complete_words = []
81   - let s:complete_results = {}
82   - let s:cur_text = ''
83   - let s:old_cur_text = ''
84   - let s:moved_cur_text = ''
85   - let s:changedtick = b:changedtick
86   - let s:context_filetype = ''
87   - let s:is_text_mode = 0
88   - let s:within_comment = 0
89   - let s:skip_next_complete = 0
90   - let s:is_prefetch = 0
91   - let s:use_sources = {}
92   - let s:update_time_save = &updatetime
93   - let s:filetype_frequencies = {}
94   - let s:cur_keyword_pos = -1
95   - "}}}
96   -
97   - " Initialize sources table."{{{
98   - " Search autoload.
99   - for file in split(globpath(&runtimepath, 'autoload/neocomplcache/sources/*.vim'), '\n')
100   - let source_name = fnamemodify(file, ':t:r')
101   - if !has_key(s:plugin_sources, source_name)
102   - \ && neocomplcache#is_source_enabled(source_name)
103   - let source = call('neocomplcache#sources#' . source_name . '#define', [])
104   - if empty(source)
105   - " Ignore.
106   - elseif source.kind ==# 'complfunc'
107   - let s:complfunc_sources[source_name] = source
108   - elseif source.kind ==# 'ftplugin'
109   - let s:ftplugin_sources[source_name] = source
110   -
111   - " Clear loaded flag.
112   - let s:ftplugin_sources[source_name].loaded = 0
113   - elseif source.kind ==# 'plugin'
114   - \ && neocomplcache#is_source_enabled('keyword_complete')
115   - let s:plugin_sources[source_name] = source
116   - endif
117   - endif
118   - endfor
119   - "}}}
  94 + call s:initialize_variables()
120 95
121 96 " Initialize keyword patterns."{{{
122   - if !exists('g:neocomplcache_keyword_patterns')
123   - let g:neocomplcache_keyword_patterns = {}
124   - endif
125   - call neocomplcache#set_dictionary_helper(g:neocomplcache_keyword_patterns,
126   - \'default',
  97 + call neocomplcache#util#set_default(
  98 + \ 'g:neocomplcache_keyword_patterns', {})
  99 + call neocomplcache#util#set_default_dictionary(
  100 + \'g:neocomplcache_keyword_patterns',
  101 + \'_',
127 102 \'\k\+')
128   - call neocomplcache#set_dictionary_helper(g:neocomplcache_keyword_patterns,
  103 + call neocomplcache#util#set_default_dictionary(
  104 + \'g:neocomplcache_keyword_patterns',
129 105 \'lisp,scheme,clojure,int-gosh,int-clisp,int-clj',
130 106 \'[[:alpha:]+*/@$_=.!?-][[:alnum:]+*/@$_:=.!?-]*')
131   - call neocomplcache#set_dictionary_helper(g:neocomplcache_keyword_patterns,
  107 + call neocomplcache#util#set_default_dictionary(
  108 + \'g:neocomplcache_keyword_patterns',
132 109 \'ruby,int-irb',
133 110 \'^=\%(b\%[egin]\|e\%[nd]\)\|\%(@@\|[:$@]\)\h\w*\|\h\w*\%(::\w*\)*[!?]\?')
134   - call neocomplcache#set_dictionary_helper(g:neocomplcache_keyword_patterns,
  111 + call neocomplcache#util#set_default_dictionary(
  112 + \'g:neocomplcache_keyword_patterns',
135 113 \'php,int-php',
136   - \'</\?\%(\h[[:alnum:]_-]*\s*\)\?\%(/\?>\)\?\|\$\h\w*\|\h\w*\%(\%(\\\|::\)\w*\)*')
137   - call neocomplcache#set_dictionary_helper(g:neocomplcache_keyword_patterns,
  114 + \'</\?\%(\h[[:alnum:]_-]*\s*\)\?\%(/\?>\)\?'.
  115 + \'\|\$\h\w*\|\h\w*\%(\%(\\\|::\)\w*\)*')
  116 + call neocomplcache#util#set_default_dictionary(
  117 + \'g:neocomplcache_keyword_patterns',
138 118 \'perl,int-perlsh',
139 119 \'<\h\w*>\?\|[$@%&*]\h\w*\|\h\w*\%(::\w*\)*')
140   - call neocomplcache#set_dictionary_helper(g:neocomplcache_keyword_patterns,
  120 + call neocomplcache#util#set_default_dictionary(
  121 + \'g:neocomplcache_keyword_patterns',
141 122 \'perl6,int-perl6',
142   - \'<\h\w*>\?\|[$@%&][!.*?]\?\h[[:alnum:]_-]*\|\h[[:alnum:]_-]*\%(::[[:alnum:]_-]*\)*')
143   - call neocomplcache#set_dictionary_helper(g:neocomplcache_keyword_patterns,
  123 + \'<\h\w*>\?\|[$@%&][!.*?]\?\h[[:alnum:]_-]*'.
  124 + \'\|\h[[:alnum:]_-]*\%(::[[:alnum:]_-]*\)*')
  125 + call neocomplcache#util#set_default_dictionary(
  126 + \'g:neocomplcache_keyword_patterns',
144 127 \'pir',
145 128 \'[$@%.=]\?\h\w*')
146   - call neocomplcache#set_dictionary_helper(g:neocomplcache_keyword_patterns,
  129 + call neocomplcache#util#set_default_dictionary(
  130 + \'g:neocomplcache_keyword_patterns',
147 131 \'pasm',
148 132 \'[=]\?\h\w*')
149   - call neocomplcache#set_dictionary_helper(g:neocomplcache_keyword_patterns,
  133 + call neocomplcache#util#set_default_dictionary(
  134 + \'g:neocomplcache_keyword_patterns',
150 135 \'vim,help',
151   - \'-\h[[:alnum:]-]*=\?\|\c\[:\%(\h\w*:\]\)\?\|&\h[[:alnum:]_:]*\|'
152   - \'<SID>\%(\h\w*\)\?\|<Plug>([^)]*)\?\|<\h[[:alnum:]_-]*>\?\|\h[[:alnum:]_:#]*!\?\|$\h\w*')
153   - call neocomplcache#set_dictionary_helper(g:neocomplcache_keyword_patterns,
  136 + \'-\h[[:alnum:]-]*=\?\|\c\[:\%(\h\w*:\]\)\?\|&\h[[:alnum:]_:]*\|'.
  137 + \'<SID>\%(\h\w*\)\?\|<Plug>([^)]*)\?'.
  138 + \'\|<\h[[:alnum:]_-]*>\?\|\h[[:alnum:]_:#]*!\?\|$\h\w*')
  139 + call neocomplcache#util#set_default_dictionary(
  140 + \'g:neocomplcache_keyword_patterns',
154 141 \'tex',
155   - \'\\\a{\a\{1,2}}\|\\[[:alpha:]@][[:alnum:]@]*\%({\%([[:alnum:]:_]\+\*\?}\?\)\?\)\?\|\a[[:alnum:]:_]*\*\?')
156   - call neocomplcache#set_dictionary_helper(g:neocomplcache_keyword_patterns,
  142 + \'\\\a{\a\{1,2}}\|\\[[:alpha:]@][[:alnum:]@]*'.
  143 + \'\%({\%([[:alnum:]:_]\+\*\?}\?\)\?\)\?\|\a[[:alnum:]:_]*\*\?')
  144 + call neocomplcache#util#set_default_dictionary(
  145 + \'g:neocomplcache_keyword_patterns',
157 146 \'sh,zsh,int-zsh,int-bash,int-sh',
158   - \'\$\w\+\|[[:alpha:]_.-][[:alnum:]_.-]*')
159   - call neocomplcache#set_dictionary_helper(g:neocomplcache_keyword_patterns,
  147 + \'[[:alpha:]_.-][[:alnum:]_.-]*')
  148 + call neocomplcache#util#set_default_dictionary(
  149 + \'g:neocomplcache_keyword_patterns',
160 150 \'vimshell',
161 151 \'\$\$\?\w*\|[[:alpha:]_.\\/~-][[:alnum:]_.\\/~-]*\|\d\+\%(\.\d\+\)\+')
162   - call neocomplcache#set_dictionary_helper(g:neocomplcache_keyword_patterns,
  152 + call neocomplcache#util#set_default_dictionary(
  153 + \'g:neocomplcache_keyword_patterns',
163 154 \'ps1,int-powershell',
164 155 \'\[\h\%([[:alnum:]_.]*\]::\)\?\|[$%@.]\?[[:alpha:]_.:-][[:alnum:]_.:-]*')
165   - call neocomplcache#set_dictionary_helper(g:neocomplcache_keyword_patterns,
  156 + call neocomplcache#util#set_default_dictionary(
  157 + \'g:neocomplcache_keyword_patterns',
166 158 \'c',
167 159 \'^\s*#\s*\h\w*\|\h\w*')
168   - call neocomplcache#set_dictionary_helper(g:neocomplcache_keyword_patterns,
  160 + call neocomplcache#util#set_default_dictionary(
  161 + \'g:neocomplcache_keyword_patterns',
169 162 \'cpp',
170 163 \'^\s*#\s*\h\w*\|\h\w*\%(::\w*\)*')
171   - call neocomplcache#set_dictionary_helper(g:neocomplcache_keyword_patterns,
  164 + call neocomplcache#util#set_default_dictionary(
  165 + \'g:neocomplcache_keyword_patterns',
172 166 \'objc',
173 167 \'^\s*#\s*\h\w*\|\h\w*\|@\h\w*')
174   - call neocomplcache#set_dictionary_helper(g:neocomplcache_keyword_patterns,
  168 + call neocomplcache#util#set_default_dictionary(
  169 + \'g:neocomplcache_keyword_patterns',
175 170 \'objcpp',
176 171 \'^\s*#\s*\h\w*\|\h\w*\%(::\w*\)*\|@\h\w*')
177   - call neocomplcache#set_dictionary_helper(g:neocomplcache_keyword_patterns,
  172 + call neocomplcache#util#set_default_dictionary(
  173 + \'g:neocomplcache_keyword_patterns',
178 174 \'objj',
179 175 \'\h\w*\|@\h\w*')
180   - call neocomplcache#set_dictionary_helper(g:neocomplcache_keyword_patterns,
  176 + call neocomplcache#util#set_default_dictionary(
  177 + \'g:neocomplcache_keyword_patterns',
181 178 \'d',
182 179 \'\h\w*')
183   - call neocomplcache#set_dictionary_helper(g:neocomplcache_keyword_patterns,
  180 + call neocomplcache#util#set_default_dictionary(
  181 + \'g:neocomplcache_keyword_patterns',
184 182 \'python,int-python,int-ipython',
185 183 \'[@]\?\h\w*')
186   - call neocomplcache#set_dictionary_helper(g:neocomplcache_keyword_patterns,
  184 + call neocomplcache#util#set_default_dictionary(
  185 + \'g:neocomplcache_keyword_patterns',
187 186 \'cs',
188 187 \'\h\w*')
189   - call neocomplcache#set_dictionary_helper(g:neocomplcache_keyword_patterns,
  188 + call neocomplcache#util#set_default_dictionary(
  189 + \'g:neocomplcache_keyword_patterns',
190 190 \'java',
191 191 \'[@]\?\h\w*')
192   - call neocomplcache#set_dictionary_helper(g:neocomplcache_keyword_patterns,
  192 + call neocomplcache#util#set_default_dictionary(
  193 + \'g:neocomplcache_keyword_patterns',
193 194 \'javascript,actionscript,int-js,int-kjs,int-rhino',
194 195 \'\h\w*')
195   - call neocomplcache#set_dictionary_helper(g:neocomplcache_keyword_patterns,
  196 + call neocomplcache#util#set_default_dictionary(
  197 + \'g:neocomplcache_keyword_patterns',
196 198 \'coffee,int-coffee',
197 199 \'[@]\?\h\w*')
198   - call neocomplcache#set_dictionary_helper(g:neocomplcache_keyword_patterns,
  200 + call neocomplcache#util#set_default_dictionary(
  201 + \'g:neocomplcache_keyword_patterns',
199 202 \'awk',
200 203 \'\h\w*')
201   - call neocomplcache#set_dictionary_helper(g:neocomplcache_keyword_patterns,
  204 + call neocomplcache#util#set_default_dictionary(
  205 + \'g:neocomplcache_keyword_patterns',
202 206 \'haskell,int-ghci',
203 207 \'\%(\u\w*\.\)\+[[:alnum:]_'']*\|[[:alpha:]_''][[:alnum:]_'']*')
204   - call neocomplcache#set_dictionary_helper(g:neocomplcache_keyword_patterns,
  208 + call neocomplcache#util#set_default_dictionary(
  209 + \'g:neocomplcache_keyword_patterns',
205 210 \'ml,ocaml,int-ocaml,int-sml,int-smlsharp',
206 211 \'[''`#.]\?\h[[:alnum:]_'']*')
207   - call neocomplcache#set_dictionary_helper(g:neocomplcache_keyword_patterns,
  212 + call neocomplcache#util#set_default_dictionary(
  213 + \'g:neocomplcache_keyword_patterns',
208 214 \'erlang,int-erl',
209 215 \'^\s*-\h\w*\|\%(\h\w*:\)*\h\w\|\h[[:alnum:]_@]*')
210   - call neocomplcache#set_dictionary_helper(g:neocomplcache_keyword_patterns,
  216 + call neocomplcache#util#set_default_dictionary(
  217 + \'g:neocomplcache_keyword_patterns',
211 218 \'html,xhtml,xml,markdown,eruby',
212   - \'</\?\%([[:alnum:]_:-]\+\s*\)\?\%(/\?>\)\?\|&\h\%(\w*;\)\?\|\h[[:alnum:]_-]*="\%([^"]*"\?\)\?\|\h[[:alnum:]_:-]*')
213   - call neocomplcache#set_dictionary_helper(g:neocomplcache_keyword_patterns,
214   - \'css,stylus',
  219 + \'</\?\%([[:alnum:]_:-]\+\s*\)\?\%(/\?>\)\?\|&\h\%(\w*;\)\?'.
  220 + \'\|\h[[:alnum:]_-]*="\%([^"]*"\?\)\?\|\h[[:alnum:]_:-]*')
  221 + call neocomplcache#util#set_default_dictionary(
  222 + \'g:neocomplcache_keyword_patterns',
  223 + \'css,stylus,scss',
215 224 \'[@#.]\?[[:alpha:]_:-][[:alnum:]_:-]*')
216   - call neocomplcache#set_dictionary_helper(g:neocomplcache_keyword_patterns,
  225 + call neocomplcache#util#set_default_dictionary(
  226 + \'g:neocomplcache_keyword_patterns',
217 227 \'tags',
218 228 \'^[^!][^/[:blank:]]*')
219   - call neocomplcache#set_dictionary_helper(g:neocomplcache_keyword_patterns,
  229 + call neocomplcache#util#set_default_dictionary(
  230 + \'g:neocomplcache_keyword_patterns',
220 231 \'pic',
221 232 \'^\s*#\h\w*\|\h\w*')
222   - call neocomplcache#set_dictionary_helper(g:neocomplcache_keyword_patterns,
  233 + call neocomplcache#util#set_default_dictionary(
  234 + \'g:neocomplcache_keyword_patterns',
223 235 \'arm',
224 236 \'\h\w*')
225   - call neocomplcache#set_dictionary_helper(g:neocomplcache_keyword_patterns,
  237 + call neocomplcache#util#set_default_dictionary(
  238 + \'g:neocomplcache_keyword_patterns',
226 239 \'asmh8300',
227 240 \'[[:alpha:]_.][[:alnum:]_.]*')
228   - call neocomplcache#set_dictionary_helper(g:neocomplcache_keyword_patterns,
  241 + call neocomplcache#util#set_default_dictionary(
  242 + \'g:neocomplcache_keyword_patterns',
229 243 \'masm',
230 244 \'\.\h\w*\|[[:alpha:]_@?$][[:alnum:]_@?$]*\|\h\w*:\h\w*')
231   - call neocomplcache#set_dictionary_helper(g:neocomplcache_keyword_patterns,
  245 + call neocomplcache#util#set_default_dictionary(
  246 + \'g:neocomplcache_keyword_patterns',
232 247 \'nasm',
233 248 \'^\s*\[\h\w*\|[%.]\?\h\w*\|\%(\.\.@\?\|%[%$!]\)\%(\h\w*\)\?\|\h\w*:\h\w*')
234   - call neocomplcache#set_dictionary_helper(g:neocomplcache_keyword_patterns,
  249 + call neocomplcache#util#set_default_dictionary(
  250 + \'g:neocomplcache_keyword_patterns',
235 251 \'asm',
236 252 \'[%$.]\?\h\w*\%(\$\h\w*\)\?')
237   - call neocomplcache#set_dictionary_helper(g:neocomplcache_keyword_patterns,
  253 + call neocomplcache#util#set_default_dictionary(
  254 + \'g:neocomplcache_keyword_patterns',
238 255 \'gas',
239 256 \'[$.]\?\h\w*')
240   - call neocomplcache#set_dictionary_helper(g:neocomplcache_keyword_patterns,
  257 + call neocomplcache#util#set_default_dictionary(
  258 + \'g:neocomplcache_keyword_patterns',
241 259 \'gdb,int-gdb',
242 260 \'$\h\w*\|[[:alnum:]:._-]\+')
243   - call neocomplcache#set_dictionary_helper(g:neocomplcache_keyword_patterns,
  261 + call neocomplcache#util#set_default_dictionary(
  262 + \'g:neocomplcache_keyword_patterns',
244 263 \'make',
245 264 \'[[:alpha:]_.-][[:alnum:]_.-]*')
246   - call neocomplcache#set_dictionary_helper(g:neocomplcache_keyword_patterns,
  265 + call neocomplcache#util#set_default_dictionary(
  266 + \'g:neocomplcache_keyword_patterns',
247 267 \'scala,int-scala',
248 268 \'\h\w*')
249   - call neocomplcache#set_dictionary_helper(g:neocomplcache_keyword_patterns,
  269 + call neocomplcache#util#set_default_dictionary(
  270 + \'g:neocomplcache_keyword_patterns',
250 271 \'int-termtter',
251 272 \'\h[[:alnum:]_/-]*\|\$\a\+\|#\h\w*')
252   - call neocomplcache#set_dictionary_helper(g:neocomplcache_keyword_patterns,
  273 + call neocomplcache#util#set_default_dictionary(
  274 + \'g:neocomplcache_keyword_patterns',
253 275 \'int-earthquake',
254 276 \'[:#$]\h\w*\|\h[[:alnum:]_/-]*')
255   - call neocomplcache#set_dictionary_helper(g:neocomplcache_keyword_patterns,
  277 + call neocomplcache#util#set_default_dictionary(
  278 + \'g:neocomplcache_keyword_patterns',
256 279 \'dosbatch,int-cmdproxy',
257 280 \'\$\w+\|[[:alpha:]_./-][[:alnum:]_.-]*')
258   - call neocomplcache#set_dictionary_helper(g:neocomplcache_keyword_patterns,
  281 + call neocomplcache#util#set_default_dictionary(
  282 + \'g:neocomplcache_keyword_patterns',
259 283 \'vb',
260 284 \'\h\w*\|#\h\w*')
261   - call neocomplcache#set_dictionary_helper(g:neocomplcache_keyword_patterns,
  285 + call neocomplcache#util#set_default_dictionary(
  286 + \'g:neocomplcache_keyword_patterns',
262 287 \'lua',
263 288 \'\h\w*')
264   - call neocomplcache#set_dictionary_helper(g:neocomplcache_keyword_patterns,
  289 + call neocomplcache#util#set_default_dictionary(
  290 + \'g:neocomplcache_keyword_patterns',
265 291 \ 'zimbu',
266 292 \'\h\w*')
267   - call neocomplcache#set_dictionary_helper(g:neocomplcache_keyword_patterns,
  293 + call neocomplcache#util#set_default_dictionary(
  294 + \'g:neocomplcache_keyword_patterns',
268 295 \'konoha',
269 296 \'[*$@%]\h\w*\|\h\w*')
270   - call neocomplcache#set_dictionary_helper(g:neocomplcache_keyword_patterns,
  297 + call neocomplcache#util#set_default_dictionary(
  298 + \'g:neocomplcache_keyword_patterns',
271 299 \'cobol',
272 300 \'\a[[:alnum:]-]*')
273   - call neocomplcache#set_dictionary_helper(g:neocomplcache_keyword_patterns,
  301 + call neocomplcache#util#set_default_dictionary(
  302 + \'g:neocomplcache_keyword_patterns',
274 303 \'coq',
275 304 \'\h[[:alnum:]_'']*')
276   - call neocomplcache#set_dictionary_helper(g:neocomplcache_keyword_patterns,
  305 + call neocomplcache#util#set_default_dictionary(
  306 + \'g:neocomplcache_keyword_patterns',
277 307 \'tcl',
278 308 \'[.-]\h\w*\|\h\w*')
279   - call neocomplcache#set_dictionary_helper(g:neocomplcache_keyword_patterns,
  309 + call neocomplcache#util#set_default_dictionary(
  310 + \'g:neocomplcache_keyword_patterns',
280 311 \'nyaos,int-nyaos',
281 312 \'\h\w*')
282 313 "}}}
283 314
284 315 " Initialize next keyword patterns."{{{
285   - if !exists('g:neocomplcache_next_keyword_patterns')
286   - let g:neocomplcache_next_keyword_patterns = {}
287   - endif
288   - call neocomplcache#set_dictionary_helper(g:neocomplcache_next_keyword_patterns, 'perl',
  316 + call neocomplcache#util#set_default(
  317 + \ 'g:neocomplcache_next_keyword_patterns', {})
  318 + call neocomplcache#util#set_default_dictionary(
  319 + \'g:neocomplcache_next_keyword_patterns', 'perl',
289 320 \'\h\w*>')
290   - call neocomplcache#set_dictionary_helper(g:neocomplcache_next_keyword_patterns, 'perl6',
  321 + call neocomplcache#util#set_default_dictionary(
  322 + \'g:neocomplcache_next_keyword_patterns', 'perl6',
291 323 \'\h\w*>')
292   - call neocomplcache#set_dictionary_helper(g:neocomplcache_next_keyword_patterns, 'vim,help',
  324 + call neocomplcache#util#set_default_dictionary(
  325 + \'g:neocomplcache_next_keyword_patterns', 'vim,help',
293 326 \'\w*()\?\|\w*:\]\|[[:alnum:]_-]*[)>=]')
294   - call neocomplcache#set_dictionary_helper(g:neocomplcache_next_keyword_patterns, 'python',
  327 + call neocomplcache#util#set_default_dictionary(
  328 + \'g:neocomplcache_next_keyword_patterns', 'python',
295 329 \'\w*()\?')
296   - call neocomplcache#set_dictionary_helper(g:neocomplcache_next_keyword_patterns, 'tex',
  330 + call neocomplcache#util#set_default_dictionary(
  331 + \'g:neocomplcache_next_keyword_patterns', 'tex',
297 332 \'[[:alnum:]:_]\+[*[{}]')
298   - call neocomplcache#set_dictionary_helper(g:neocomplcache_next_keyword_patterns, 'html,xhtml,xml,mkd',
  333 + call neocomplcache#util#set_default_dictionary(
  334 + \'g:neocomplcache_next_keyword_patterns', 'html,xhtml,xml,mkd',
299 335 \'[[:alnum:]_:-]*>\|[^"]*"')
300 336 "}}}
301 337
302 338 " Initialize same file type lists."{{{
303   - if !exists('g:neocomplcache_same_filetype_lists')
304   - let g:neocomplcache_same_filetype_lists = {}
305   - endif
306   - call neocomplcache#set_dictionary_helper(g:neocomplcache_same_filetype_lists,
  339 + call neocomplcache#util#set_default(
  340 + \ 'g:neocomplcache_same_filetype_lists', {})
  341 + call neocomplcache#util#set_default_dictionary(
  342 + \ 'g:neocomplcache_same_filetype_lists',
307 343 \ 'c', 'cpp')
308   - call neocomplcache#set_dictionary_helper(g:neocomplcache_same_filetype_lists,
  344 + call neocomplcache#util#set_default_dictionary(
  345 + \ 'g:neocomplcache_same_filetype_lists',
309 346 \ 'cpp', 'c')
310   - call neocomplcache#set_dictionary_helper(g:neocomplcache_same_filetype_lists,
  347 + call neocomplcache#util#set_default_dictionary(
  348 + \ 'g:neocomplcache_same_filetype_lists',
311 349 \ 'erb', 'ruby,html,xhtml')
312   - call neocomplcache#set_dictionary_helper(g:neocomplcache_same_filetype_lists,
  350 + call neocomplcache#util#set_default_dictionary(
  351 + \ 'g:neocomplcache_same_filetype_lists',
313 352 \ 'html,xml', 'xhtml')
314   - call neocomplcache#set_dictionary_helper(g:neocomplcache_same_filetype_lists,
  353 + call neocomplcache#util#set_default_dictionary(
  354 + \ 'g:neocomplcache_same_filetype_lists',
315 355 \ 'html,xhtml', 'css,stylus')
316   - call neocomplcache#set_dictionary_helper(g:neocomplcache_same_filetype_lists,
  356 + call neocomplcache#util#set_default_dictionary(
  357 + \ 'g:neocomplcache_same_filetype_lists',
  358 + \ 'css', 'scss')
  359 + call neocomplcache#util#set_default_dictionary(
  360 + \ 'g:neocomplcache_same_filetype_lists',
  361 + \ 'scss', 'css')
  362 + call neocomplcache#util#set_default_dictionary(
  363 + \ 'g:neocomplcache_same_filetype_lists',
317 364 \ 'stylus', 'css')
318   - call neocomplcache#set_dictionary_helper(g:neocomplcache_same_filetype_lists,
  365 + call neocomplcache#util#set_default_dictionary(
  366 + \ 'g:neocomplcache_same_filetype_lists',
319 367 \ 'xhtml', 'html,xml')
320   - call neocomplcache#set_dictionary_helper(g:neocomplcache_same_filetype_lists,
  368 + call neocomplcache#util#set_default_dictionary(
  369 + \ 'g:neocomplcache_same_filetype_lists',
321 370 \ 'help', 'vim')
322   - call neocomplcache#set_dictionary_helper(g:neocomplcache_same_filetype_lists,
  371 + call neocomplcache#util#set_default_dictionary(
  372 + \ 'g:neocomplcache_same_filetype_lists',
323 373 \ 'tex', 'bib,plaintex')
324   - call neocomplcache#set_dictionary_helper(g:neocomplcache_same_filetype_lists,
  374 + call neocomplcache#util#set_default_dictionary(
  375 + \ 'g:neocomplcache_same_filetype_lists',
325 376 \ 'plaintex', 'bib,tex')
326   - call neocomplcache#set_dictionary_helper(g:neocomplcache_same_filetype_lists,
  377 + call neocomplcache#util#set_default_dictionary(
  378 + \ 'g:neocomplcache_same_filetype_lists',
327 379 \ 'lingr-say', 'lingr-messages,lingr-members')
328 380
329 381 " Interactive filetypes.
330   - call neocomplcache#set_dictionary_helper(g:neocomplcache_same_filetype_lists,
  382 + call neocomplcache#util#set_default_dictionary(
  383 + \ 'g:neocomplcache_same_filetype_lists',
331 384 \ 'int-irb', 'ruby')
332   - call neocomplcache#set_dictionary_helper(g:neocomplcache_same_filetype_lists,
  385 + call neocomplcache#util#set_default_dictionary(
  386 + \ 'g:neocomplcache_same_filetype_lists',
333 387 \ 'int-ghci,int-hugs', 'haskell')
334   - call neocomplcache#set_dictionary_helper(g:neocomplcache_same_filetype_lists,
  388 + call neocomplcache#util#set_default_dictionary(
  389 + \ 'g:neocomplcache_same_filetype_lists',
335 390 \ 'int-python,int-ipython', 'python')
336   - call neocomplcache#set_dictionary_helper(g:neocomplcache_same_filetype_lists,
  391 + call neocomplcache#util#set_default_dictionary(
  392 + \ 'g:neocomplcache_same_filetype_lists',
337 393 \ 'int-gosh', 'scheme')
338   - call neocomplcache#set_dictionary_helper(g:neocomplcache_same_filetype_lists,
  394 + call neocomplcache#util#set_default_dictionary(
  395 + \ 'g:neocomplcache_same_filetype_lists',
339 396 \ 'int-clisp', 'lisp')
340   - call neocomplcache#set_dictionary_helper(g:neocomplcache_same_filetype_lists,
  397 + call neocomplcache#util#set_default_dictionary(
  398 + \ 'g:neocomplcache_same_filetype_lists',
341 399 \ 'int-erl', 'erlang')
342   - call neocomplcache#set_dictionary_helper(g:neocomplcache_same_filetype_lists,
  400 + call neocomplcache#util#set_default_dictionary(
  401 + \ 'g:neocomplcache_same_filetype_lists',
343 402 \ 'int-zsh', 'zsh')
344   - call neocomplcache#set_dictionary_helper(g:neocomplcache_same_filetype_lists,
  403 + call neocomplcache#util#set_default_dictionary(
  404 + \ 'g:neocomplcache_same_filetype_lists',
345 405 \ 'int-bash', 'bash')
346   - call neocomplcache#set_dictionary_helper(g:neocomplcache_same_filetype_lists,
  406 + call neocomplcache#util#set_default_dictionary(
  407 + \ 'g:neocomplcache_same_filetype_lists',
347 408 \ 'int-sh', 'sh')
348   - call neocomplcache#set_dictionary_helper(g:neocomplcache_same_filetype_lists,
  409 + call neocomplcache#util#set_default_dictionary(
  410 + \ 'g:neocomplcache_same_filetype_lists',
349 411 \ 'int-cmdproxy', 'dosbatch')
350   - call neocomplcache#set_dictionary_helper(g:neocomplcache_same_filetype_lists,
  412 + call neocomplcache#util#set_default_dictionary(
  413 + \ 'g:neocomplcache_same_filetype_lists',
351 414 \ 'int-powershell', 'powershell')
352   - call neocomplcache#set_dictionary_helper(g:neocomplcache_same_filetype_lists,
  415 + call neocomplcache#util#set_default_dictionary(
  416 + \ 'g:neocomplcache_same_filetype_lists',
353 417 \ 'int-perlsh', 'perl')
354   - call neocomplcache#set_dictionary_helper(g:neocomplcache_same_filetype_lists,
  418 + call neocomplcache#util#set_default_dictionary(
  419 + \ 'g:neocomplcache_same_filetype_lists',
355 420 \ 'int-perl6', 'perl6')
356   - call neocomplcache#set_dictionary_helper(g:neocomplcache_same_filetype_lists,
  421 + call neocomplcache#util#set_default_dictionary(
  422 + \ 'g:neocomplcache_same_filetype_lists',
357 423 \ 'int-ocaml', 'ocaml')
358   - call neocomplcache#set_dictionary_helper(g:neocomplcache_same_filetype_lists,
  424 + call neocomplcache#util#set_default_dictionary(
  425 + \ 'g:neocomplcache_same_filetype_lists',
359 426 \ 'int-clj', 'clojure')
360   - call neocomplcache#set_dictionary_helper(g:neocomplcache_same_filetype_lists,
  427 + call neocomplcache#util#set_default_dictionary(
  428 + \ 'g:neocomplcache_same_filetype_lists',
361 429 \ 'int-sml,int-smlsharp', 'sml')
362   - call neocomplcache#set_dictionary_helper(g:neocomplcache_same_filetype_lists,
  430 + call neocomplcache#util#set_default_dictionary(
  431 + \ 'g:neocomplcache_same_filetype_lists',
363 432 \ 'int-js,int-kjs,int-rhino', 'javascript')
364   - call neocomplcache#set_dictionary_helper(g:neocomplcache_same_filetype_lists,
  433 + call neocomplcache#util#set_default_dictionary(
  434 + \ 'g:neocomplcache_same_filetype_lists',
365 435 \ 'int-coffee', 'coffee')
366   - call neocomplcache#set_dictionary_helper(g:neocomplcache_same_filetype_lists,
  436 + call neocomplcache#util#set_default_dictionary(
  437 + \ 'g:neocomplcache_same_filetype_lists',
367 438 \ 'int-gdb', 'gdb')
368   - call neocomplcache#set_dictionary_helper(g:neocomplcache_same_filetype_lists,
  439 + call neocomplcache#util#set_default_dictionary(
  440 + \ 'g:neocomplcache_same_filetype_lists',
369 441 \ 'int-scala', 'scala')
370   - call neocomplcache#set_dictionary_helper(g:neocomplcache_same_filetype_lists,
  442 + call neocomplcache#util#set_default_dictionary(
  443 + \ 'g:neocomplcache_same_filetype_lists',
371 444 \ 'int-nyaos', 'nyaos')
372   - call neocomplcache#set_dictionary_helper(g:neocomplcache_same_filetype_lists,
  445 + call neocomplcache#util#set_default_dictionary(
  446 + \ 'g:neocomplcache_same_filetype_lists',
373 447 \ 'int-php', 'php')
374 448 "}}}
375 449
376 450 " Initialize context filetype lists."{{{
377   - if exists('g:neocomplcache_filetype_include_lists')
378   - let g:neocomplcache_context_filetype_lists =
379   - \ g:neocomplcache_filetype_include_lists
380   - endif
381   - if !exists('g:neocomplcache_context_filetype_lists')
382   - let g:neocomplcache_context_filetype_lists = {}
383   - endif
384   - call neocomplcache#set_dictionary_helper(g:neocomplcache_context_filetype_lists,
  451 + call neocomplcache#util#set_default(
  452 + \ 'g:neocomplcache_context_filetype_lists', {})
  453 + call neocomplcache#util#set_default_dictionary(
  454 + \ 'g:neocomplcache_context_filetype_lists',
385 455 \ 'c,cpp', [
386   - \ {'filetype' : 'masm', 'start' : '_*asm_*\s\+\h\w*', 'end' : '$'},
387   - \ {'filetype' : 'masm', 'start' : '_*asm_*\s*\%(\n\s*\)\?{', 'end' : '}'},
388   - \ {'filetype' : 'gas', 'start' : '_*asm_*\s*\%(_*volatile_*\s*\)\?(', 'end' : ');'},
  456 + \ {'filetype' : 'masm',
  457 + \ 'start' : '_*asm_*\s\+\h\w*', 'end' : '$'},
  458 + \ {'filetype' : 'masm',
  459 + \ 'start' : '_*asm_*\s*\%(\n\s*\)\?{', 'end' : '}'},
  460 + \ {'filetype' : 'gas',
  461 + \ 'start' : '_*asm_*\s*\%(_*volatile_*\s*\)\?(', 'end' : ');'},
389 462 \])
390   - call neocomplcache#set_dictionary_helper(g:neocomplcache_context_filetype_lists,
  463 + call neocomplcache#util#set_default_dictionary(
  464 + \ 'g:neocomplcache_context_filetype_lists',
391 465 \ 'd', [
392   - \ {'filetype' : 'masm', 'start' : 'asm\s*\%(\n\s*\)\?{', 'end' : '}'},
  466 + \ {'filetype' : 'masm',
  467 + \ 'start' : 'asm\s*\%(\n\s*\)\?{', 'end' : '}'},
393 468 \])
394   - call neocomplcache#set_dictionary_helper(g:neocomplcache_context_filetype_lists,
  469 + call neocomplcache#util#set_default_dictionary(
  470 + \ 'g:neocomplcache_context_filetype_lists',
395 471 \ 'perl6', [
396 472 \ {'filetype' : 'pir', 'start' : 'Q:PIR\s*{', 'end' : '}'},
397 473 \])
398   - call neocomplcache#set_dictionary_helper(g:neocomplcache_context_filetype_lists,
  474 + call neocomplcache#util#set_default_dictionary(
  475 + \ 'g:neocomplcache_context_filetype_lists',
399 476 \ 'vimshell', [
400   - \ {'filetype' : 'vim', 'start' : 'vexe \([''"]\)', 'end' : '\\\@<!\1'},
  477 + \ {'filetype' : 'vim',
  478 + \ 'start' : 'vexe \([''"]\)', 'end' : '\\\@<!\1'},
401 479 \ {'filetype' : 'vim', 'start' : ' :\w*', 'end' : '\n'},
402 480 \ {'filetype' : 'vim', 'start' : ' vexe\s\+', 'end' : '\n'},
403 481 \])
404   - call neocomplcache#set_dictionary_helper(g:neocomplcache_context_filetype_lists,
  482 + call neocomplcache#util#set_default_dictionary(
  483 + \ 'g:neocomplcache_context_filetype_lists',
405 484 \ 'eruby', [
406 485 \ {'filetype' : 'ruby', 'start' : '<%[=#]\?', 'end' : '%>'},
407 486 \])
408   - call neocomplcache#set_dictionary_helper(g:neocomplcache_context_filetype_lists,
  487 + call neocomplcache#util#set_default_dictionary(
  488 + \ 'g:neocomplcache_context_filetype_lists',
409 489 \ 'vim', [
410   - \ {'filetype' : 'python', 'start' : '^\s*python3\? <<\s*\(\h\w*\)', 'end' : '^\1'},
411   - \ {'filetype' : 'ruby', 'start' : '^\s*ruby <<\s*\(\h\w*\)', 'end' : '^\1'},
  490 + \ {'filetype' : 'python',
  491 + \ 'start' : '^\s*python3\? <<\s*\(\h\w*\)', 'end' : '^\1'},
  492 + \ {'filetype' : 'ruby',
  493 + \ 'start' : '^\s*ruby <<\s*\(\h\w*\)', 'end' : '^\1'},
412 494 \])
413   - call neocomplcache#set_dictionary_helper(g:neocomplcache_context_filetype_lists,
  495 + call neocomplcache#util#set_default_dictionary(
  496 + \ 'g:neocomplcache_context_filetype_lists',
414 497 \ 'html,xhtml', [
415   - \ {'filetype' : 'javascript', 'start' : '<script type="text/javascript">', 'end' : '</script>'},
416   - \ {'filetype' : 'css', 'start' : '<style type="text/css">', 'end' : '</style>'},
  498 + \ {'filetype' : 'javascript', 'start' :
  499 + \'<script\%( [^>]*\)\? type="text/javascript"\%( [^>]*\)\?>',
  500 + \ 'end' : '</script>'},
  501 + \ {'filetype' : 'coffee', 'start' :
  502 + \'<script\%( [^>]*\)\? type="text/coffeescript"\%( [^>]*\)\?>',
  503 + \ 'end' : '</script>'},
  504 + \ {'filetype' : 'css', 'start' :
  505 + \'<script\%( [^>]*\)\? type="text/css"\%( [^>]*\)\?>',
  506 + \ 'end' : '</style>'},
417 507 \])
418   - call neocomplcache#set_dictionary_helper(g:neocomplcache_context_filetype_lists,
  508 + call neocomplcache#util#set_default_dictionary(
  509 + \ 'g:neocomplcache_context_filetype_lists',
419 510 \ 'python', [
420   - \ {'filetype' : 'vim', 'start' : 'vim.command\s*(\([''"]\)', 'end' : '\\\@<!\1\s*)'},
421   - \ {'filetype' : 'vim', 'start' : 'vim.eval\s*(\([''"]\)', 'end' : '\\\@<!\1\s*)'},
  511 + \ {'filetype' : 'vim',
  512 + \ 'start' : 'vim.command\s*(\([''"]\)', 'end' : '\\\@<!\1\s*)'},
  513 + \ {'filetype' : 'vim',
  514 + \ 'start' : 'vim.eval\s*(\([''"]\)', 'end' : '\\\@<!\1\s*)'},
422 515 \])
423   - call neocomplcache#set_dictionary_helper(g:neocomplcache_context_filetype_lists,
  516 + call neocomplcache#util#set_default_dictionary(
  517 + \ 'g:neocomplcache_context_filetype_lists',
424 518 \ 'help', [
425 519 \ {'filetype' : 'vim', 'start' : '^>', 'end' : '^<'},
426 520 \])
427   - call neocomplcache#set_dictionary_helper(g:neocomplcache_context_filetype_lists,
  521 + call neocomplcache#util#set_default_dictionary(
  522 + \ 'g:neocomplcache_context_filetype_lists',
428 523 \ 'nyaos,int-nyaos', [
429   - \ {'filetype' : 'lua', 'start' : '\<lua_e\s\+\(["'']\)', 'end' : '^\1'},
  524 + \ {'filetype' : 'lua',
  525 + \ 'start' : '\<lua_e\s\+\(["'']\)', 'end' : '^\1'},
430 526 \])
431 527 "}}}
432 528
433 529 " Initialize delimiter patterns."{{{
434   - if !exists('g:neocomplcache_delimiter_patterns')
435   - let g:neocomplcache_delimiter_patterns = {}
436   - endif
437   - call neocomplcache#set_dictionary_helper(g:neocomplcache_delimiter_patterns,
  530 + call neocomplcache#util#set_default(
  531 + \ 'g:neocomplcache_delimiter_patterns', {})
  532 + call neocomplcache#util#set_default_dictionary(
  533 + \ 'g:neocomplcache_delimiter_patterns',
438 534 \ 'vim,help', ['#'])
439   - call neocomplcache#set_dictionary_helper(g:neocomplcache_delimiter_patterns,
  535 + call neocomplcache#util#set_default_dictionary(
  536 + \ 'g:neocomplcache_delimiter_patterns',
440 537 \ 'erlang,lisp,int-clisp', [':'])
441   - call neocomplcache#set_dictionary_helper(g:neocomplcache_delimiter_patterns,
  538 + call neocomplcache#util#set_default_dictionary(
  539 + \ 'g:neocomplcache_delimiter_patterns',
442 540 \ 'lisp,int-clisp', ['/', ':'])
443   - call neocomplcache#set_dictionary_helper(g:neocomplcache_delimiter_patterns,
  541 + call neocomplcache#util#set_default_dictionary(
  542 + \ 'g:neocomplcache_delimiter_patterns',
444 543 \ 'clojure,int-clj', ['/', '\.'])
445   - call neocomplcache#set_dictionary_helper(g:neocomplcache_delimiter_patterns,
  544 + call neocomplcache#util#set_default_dictionary(
  545 + \ 'g:neocomplcache_delimiter_patterns',
446 546 \ 'perl,cpp', ['::'])
447   - call neocomplcache#set_dictionary_helper(g:neocomplcache_delimiter_patterns,
  547 + call neocomplcache#util#set_default_dictionary(
  548 + \ 'g:neocomplcache_delimiter_patterns',
448 549 \ 'php', ['\', '::'])
449   - call neocomplcache#set_dictionary_helper(g:neocomplcache_delimiter_patterns,
450   - \ 'java,d,javascript,actionscript,ruby,eruby,haskell,int-ghci,coffee,zimbu,konoha',
  550 + call neocomplcache#util#set_default_dictionary(
  551 + \ 'g:neocomplcache_delimiter_patterns',
  552 + \ 'java,d,javascript,actionscript,'.
  553 + \ 'ruby,eruby,haskell,int-ghci,coffee,zimbu,konoha',
451 554 \ ['\.'])
452   - call neocomplcache#set_dictionary_helper(g:neocomplcache_delimiter_patterns,
  555 + call neocomplcache#util#set_default_dictionary(
  556 + \ 'g:neocomplcache_delimiter_patterns',
453 557 \ 'lua', ['\.', ':'])
454   - call neocomplcache#set_dictionary_helper(g:neocomplcache_delimiter_patterns,
  558 + call neocomplcache#util#set_default_dictionary(
  559 + \ 'g:neocomplcache_delimiter_patterns',
455 560 \ 'perl6', ['\.', '::'])
456 561 "}}}
457 562
458 563 " Initialize ctags arguments."{{{
459   - if !exists('g:neocomplcache_ctags_arguments_list')
460   - let g:neocomplcache_ctags_arguments_list = {}
461   - endif
462   - call neocomplcache#set_dictionary_helper(
463   - \ g:neocomplcache_ctags_arguments_list, 'default', '')
464   - call neocomplcache#set_dictionary_helper(
465   - \ g:neocomplcache_ctags_arguments_list, 'vim',
466   - \"--extra=fq --fields=afmiKlnsStz --regex-vim='/function!? ([a-z#:_0-9A-Z]+)/\\1/function/'")
  564 + call neocomplcache#util#set_default(
  565 + \ 'g:neocomplcache_ctags_arguments_list', {})
  566 + call neocomplcache#util#set_default_dictionary(
  567 + \ 'g:neocomplcache_ctags_arguments_list',
  568 + \ '_', '')
  569 + call neocomplcache#util#set_default_dictionary(
  570 + \ 'g:neocomplcache_ctags_arguments_list', 'vim',
  571 + \ '--extra=fq --fields=afmiKlnsStz ' .
  572 + \ "--regex-vim='/function!? ([a-z#:_0-9A-Z]+)/\\1/function/'")
467 573 if neocomplcache#util#is_mac()
468   - call neocomplcache#set_dictionary_helper(
469   - \ g:neocomplcache_ctags_arguments_list, 'c',
470   - \'--c-kinds=+p --fields=+iaS --extra=+q -I__DARWIN_ALIAS,__DARWIN_ALIAS_C,__DARWIN_ALIAS_I,__DARWIN_INODE64
  574 + call neocomplcache#util#set_default_dictionary(
  575 + \ 'g:neocomplcache_ctags_arguments_list', 'c',
  576 + \ '--c-kinds=+p --fields=+iaS --extra=+q
  577 + \ -I__DARWIN_ALIAS,__DARWIN_ALIAS_C,__DARWIN_ALIAS_I,__DARWIN_INODE64
471 578 \ -I__DARWIN_1050,__DARWIN_1050ALIAS,__DARWIN_1050ALIAS_C,__DARWIN_1050ALIAS_I,__DARWIN_1050INODE64
472 579 \ -I__DARWIN_EXTSN,__DARWIN_EXTSN_C
473 580 \ -I__DARWIN_LDBL_COMPAT,__DARWIN_LDBL_COMPAT2')
474 581 else
475   - call neocomplcache#set_dictionary_helper(
476   - \ g:neocomplcache_ctags_arguments_list, 'c',
477   - \'-R --sort=1 --c-kinds=+p --fields=+iaS --extra=+q -I __wur')
478   - endif
479   - call neocomplcache#set_dictionary_helper(
480   - \ g:neocomplcache_ctags_arguments_list, 'cpp',
481   - \'-R --sort=1 --c++-kinds=+p --fields=+iaS --extra=+q -I __wur --language-force=C++')
  582 + call neocomplcache#util#set_default_dictionary(
  583 + \ 'g:neocomplcache_ctags_arguments_list', 'c',
  584 + \ '-R --sort=1 --c-kinds=+p --fields=+iaS --extra=+q -I __wur')
  585 + endif
  586 + call neocomplcache#util#set_default_dictionary(
  587 + \ 'g:neocomplcache_ctags_arguments_list', 'cpp',
  588 + \ '-R --sort=1 --c++-kinds=+p --fields=+iaS
  589 + \ --extra=+q -I __wur --language-force=C++')
482 590 "}}}
483 591
484 592 " Initialize text mode filetypes."{{{
485   - if !exists('g:neocomplcache_text_mode_filetypes')
486   - let g:neocomplcache_text_mode_filetypes = {}
487   - endif
488   - call neocomplcache#set_dictionary_helper(
489   - \ g:neocomplcache_text_mode_filetypes,
  593 + call neocomplcache#util#set_default(
  594 + \ 'g:neocomplcache_text_mode_filetypes', {})
  595 + call neocomplcache#util#set_default_dictionary(
  596 + \ 'g:neocomplcache_text_mode_filetypes',
490 597 \ 'text,help,tex,gitcommit,vcs-commit', 1)
491 598 "}}}
492 599
493 600 " Initialize tags filter patterns."{{{
494   - if !exists('g:neocomplcache_tags_filter_patterns')
495   - let g:neocomplcache_tags_filter_patterns = {}
496   - endif
497   - call neocomplcache#set_dictionary_helper(g:neocomplcache_tags_filter_patterns, 'c,cpp',
  601 + call neocomplcache#util#set_default(
  602 + \ 'g:neocomplcache_tags_filter_patterns', {})
  603 + call neocomplcache#util#set_default_dictionary(
  604 + \'g:neocomplcache_tags_filter_patterns', 'c,cpp',
498 605 \'v:val.word !~ ''^[~_]''')
499 606 "}}}
500 607
  608 + " Initialize force omni completion pattern."{{{
  609 + call neocomplcache#util#set_default(
  610 + \ 'g:neocomplcache_force_omni_patterns', {})
  611 + call neocomplcache#util#set_default_dictionary(
  612 + \'g:neocomplcache_force_omni_patterns', 'objc',
  613 + \'\h\w\+\|[^.[:digit:] *\t]\%(\.\|->\)')
  614 + "}}}
  615 +
501 616 " Initialize ignore composite filetypes
502   - if !exists('g:neocomplcache_ignore_composite_filetype_lists')
503   - let g:neocomplcache_ignore_composite_filetype_lists = {}
504   - endif
  617 + call neocomplcache#util#set_default(
  618 + \ 'g:neocomplcache_ignore_composite_filetype_lists', {})
505 619
506 620 " Add commands."{{{
507 621 command! -nargs=? Neco call s:display_neco(<q-args>)
@@ -526,28 +640,16 @@ function! neocomplcache#enable() "{{{
526 640 let &completefunc = 'neocomplcache#manual_complete'
527 641 let &l:completefunc = 'neocomplcache#manual_complete'
528 642
529   - " Set options.
530   - set completeopt-=menu
531   - set completeopt+=menuone
532   -
533 643 " For auto complete keymappings.
534 644 inoremap <expr><silent> <Plug>(neocomplcache_start_unite_complete)
535 645 \ unite#sources#neocomplcache#start_complete()
536 646 inoremap <expr><silent> <Plug>(neocomplcache_start_unite_quick_match)
537 647 \ unite#sources#neocomplcache#start_quick_match()
538   - inoremap <expr><silent> <Plug>(neocomplcache_start_unite_snippet)
539   - \ unite#sources#snippet#start_complete()
540 648 inoremap <silent> <Plug>(neocomplcache_start_auto_complete)
541 649 \ <C-x><C-u><C-r>=neocomplcache#popup_post()<CR>
542 650 inoremap <silent> <Plug>(neocomplcache_start_omni_complete)
543   - \ <C-x><C-o><C-r>=neocomplcache#popup_post()<CR>
544   -
545   - " Initialize.
546   - for source in values(neocomplcache#available_complfuncs())
547   - if has_key(source, 'initialize')
548   - call source.initialize()
549   - endif
550   - endfor
  651 + \ <C-x><C-o><C-p>
  652 + " \ <C-x><C-o><C-r>=neocomplcache#popup_post()<CR>
551 653 endfunction"}}}
552 654
553 655 function! neocomplcache#disable()"{{{
@@ -570,27 +672,34 @@ function! neocomplcache#disable()"{{{
570 672 delcommand Neco
571 673 delcommand NeoComplCacheAutoCompletionLength
572 674
573   - for source in values(neocomplcache#available_complfuncs())
574   - if has_key(source, 'finalize')
575   - call source.finalize()
576   - endif
577   - endfor
578   - for source in values(neocomplcache#available_ftplugins())
579   - if source.loaded
580   - if has_key(source, 'finalize')
581   - call source.finalize()
582   - endif
  675 + for source in values(neocomplcache#available_sources())
  676 + if !has_key(source, 'finalize') || !source.loaded
  677 + continue
583 678 endif
  679 +
  680 + try
  681 + call source.finalize()
  682 + catch
  683 + call neocomplcache#print_error(v:throwpoint)
  684 + call neocomplcache#print_error(v:exception)
  685 + call neocomplcache#print_error(
  686 + \ 'Error occured in source''s finalize()!')
  687 + call neocomplcache#print_error(
  688 + \ 'Source name is ' . source.name)
  689 + endtry
584 690 endfor
585 691 endfunction"}}}
586 692
587 693 function! neocomplcache#manual_complete(findstart, base)"{{{
588 694 if a:findstart
  695 + let cur_text = s:get_cur_text()
589 696 if !neocomplcache#is_enabled()
  697 + \ || neocomplcache#is_omni_complete(cur_text)
590 698 let s:cur_keyword_str = ''
591 699 let s:complete_words = []
592 700 let s:is_prefetch = 0
593 701 let &l:completefunc = 'neocomplcache#manual_complete'
  702 +
594 703 return (g:neocomplcache_enable_prefetch
595 704 \ || g:neocomplcache_enable_insert_char_pre) ?
596 705 \ -1 : -3
@@ -601,7 +710,7 @@ function! neocomplcache#manual_complete(findstart, base)"{{{
601 710 " Use prefetch results.
602 711 else
603 712 let s:complete_results =
604   - \ neocomplcache#get_complete_results(s:get_cur_text())
  713 + \ neocomplcache#get_complete_results(cur_text)
605 714 endif
606 715 let cur_keyword_pos =
607 716 \ neocomplcache#get_cur_keyword_pos(s:complete_results)
@@ -617,24 +726,26 @@ function! neocomplcache#manual_complete(findstart, base)"{{{
617 726 endif
618 727
619 728 return cur_keyword_pos
620   - endif
621   -
622   - let cur_keyword_pos = neocomplcache#get_cur_keyword_pos(s:complete_results)
623   - let s:complete_words = neocomplcache#get_complete_words(
  729 + else
  730 + let cur_keyword_pos = neocomplcache#get_cur_keyword_pos(s:complete_results)
  731 + let s:complete_words = neocomplcache#get_complete_words(
624 732 \ s:complete_results, cur_keyword_pos, a:base)
625   - let s:cur_keyword_str = a:base
626   - let s:is_prefetch = 0
  733 + let s:cur_keyword_str = a:base
  734 + let s:is_prefetch = 0
627 735
628   - if v:version > 703 || v:version == 703 && has('patch418')
629   - let dict = { 'words' : s:complete_words }
  736 + if v:version > 703 || v:version == 703 && has('patch418')
  737 + let dict = { 'words' : s:complete_words }
630 738
631   - if g:neocomplcache_enable_cursor_hold_i
632   - " Note: Vim Still have broken register-. problem.
633   - let dict.refresh = 'always'
  739 + if len(s:complete_words) >= g:neocomplcache_max_list
  740 + \ && (g:neocomplcache_enable_cursor_hold_i
  741 + \ || v:version > 703 || v:version == 703 && has('patch561'))
  742 + " Note: If Vim is less than 7.3.561, it have broken register "." problem.
  743 + let dict.refresh = 'always'
  744 + endif
  745 + return dict
  746 + else
  747 + return s:complete_words
634 748 endif
635   - return dict
636   - else
637   - return s:complete_words
638 749 endif
639 750 endfunction"}}}
640 751
@@ -649,7 +760,8 @@ function! neocomplcache#sources_manual_complete(findstart, base)"{{{
649 760 " Get cur_keyword_pos.
650 761 let complete_results = neocomplcache#get_complete_results(
651 762 \ s:get_cur_text(), s:use_sources)
652   - let s:cur_keyword_pos = neocomplcache#get_cur_keyword_pos(complete_results)
  763 + let s:cur_keyword_pos =
  764 + \ neocomplcache#get_cur_keyword_pos(complete_results)
653 765
654 766 if s:cur_keyword_pos < 0
655 767 let s:cur_keyword_str = ''
@@ -738,11 +850,7 @@ function! s:do_auto_complete(event)"{{{
738 850 " Prevent infinity loop.
739 851 if cur_text == ''
740 852 \ || cur_text == s:old_cur_text
741   - \ || (neocomplcache#is_eskk_enabled() &&
742   - \ !neocomplcache#is_eskk_convertion(cur_text))
743   - \ || (!neocomplcache#is_eskk_enabled() &&