Browse Source

第一个版本vim

huangchengwu 5 years ago
commit
6d6f1a7d64
82 changed files with 14851 additions and 0 deletions
  1. 6 0
      README.md
  2. 329 0
      autoload/neocomplete.vim
  3. 276 0
      autoload/neocomplete/async_cache.vim
  4. 298 0
      autoload/neocomplete/cache.vim
  5. 100 0
      autoload/neocomplete/commands.vim
  6. 352 0
      autoload/neocomplete/complete.vim
  7. 67 0
      autoload/neocomplete/context_filetype.vim
  8. 54 0
      autoload/neocomplete/custom.vim
  9. 48 0
      autoload/neocomplete/filters.vim
  10. 66 0
      autoload/neocomplete/filters/converter_abbr.vim
  11. 53 0
      autoload/neocomplete/filters/converter_add_paren.vim
  12. 80 0
      autoload/neocomplete/filters/converter_case.vim
  13. 114 0
      autoload/neocomplete/filters/converter_delimiter.vim
  14. 49 0
      autoload/neocomplete/filters/converter_disable_abbr.vim
  15. 50 0
      autoload/neocomplete/filters/converter_remove_last_paren.vim
  16. 122 0
      autoload/neocomplete/filters/converter_remove_overlap.vim
  17. 89 0
      autoload/neocomplete/filters/matcher_fuzzy.vim
  18. 72 0
      autoload/neocomplete/filters/matcher_head.vim
  19. 63 0
      autoload/neocomplete/filters/matcher_length.vim
  20. 45 0
      autoload/neocomplete/filters/matcher_nothing.vim
  21. 50 0
      autoload/neocomplete/filters/sorter_filename.vim
  22. 53 0
      autoload/neocomplete/filters/sorter_length.vim
  23. 74 0
      autoload/neocomplete/filters/sorter_rank.vim
  24. 49 0
      autoload/neocomplete/filters/sorter_word.vim
  25. 351 0
      autoload/neocomplete/handler.vim
  26. 357 0
      autoload/neocomplete/helper.vim
  27. 656 0
      autoload/neocomplete/init.vim
  28. 269 0
      autoload/neocomplete/mappings.vim
  29. 400 0
      autoload/neocomplete/sources/buffer.vim
  30. 150 0
      autoload/neocomplete/sources/dictionary.vim
  31. 159 0
      autoload/neocomplete/sources/file.vim
  32. 277 0
      autoload/neocomplete/sources/member.vim
  33. 294 0
      autoload/neocomplete/sources/omni.vim
  34. 120 0
      autoload/neocomplete/sources/tag.vim
  35. 264 0
      autoload/neocomplete/util.vim
  36. 67 0
      autoload/neocomplete/variables.vim
  37. 144 0
      autoload/unite/sources/neocomplete.vim
  38. 12 0
      autoload/vital.vim
  39. 5 0
      autoload/vital/_neocomplete.vim
  40. 457 0
      autoload/vital/_neocomplete/Data/List.vim
  41. 633 0
      autoload/vital/_neocomplete/Data/String.vim
  42. 430 0
      autoload/vital/_neocomplete/Prelude.vim
  43. 181 0
      autoload/vital/_neocomplete/Process.vim
  44. 101 0
      autoload/vital/_neocomplete/System/Cache/Deprecated.vim
  45. 339 0
      autoload/vital/neocomplete.vim
  46. 8 0
      autoload/vital/neocomplete.vital
  47. 1 0
      bundle/Vundle.vim
  48. 1 0
      bundle/ctrlp.vim
  49. 2113 0
      bundle/ctrlp/autoload/ctrlp.vim
  50. 140 0
      bundle/ctrlp/autoload/ctrlp/bookmarkdir.vim
  51. 261 0
      bundle/ctrlp/autoload/ctrlp/buffertag.vim
  52. 95 0
      bundle/ctrlp/autoload/ctrlp/changes.vim
  53. 93 0
      bundle/ctrlp/autoload/ctrlp/dir.vim
  54. 62 0
      bundle/ctrlp/autoload/ctrlp/line.vim
  55. 83 0
      bundle/ctrlp/autoload/ctrlp/mixed.vim
  56. 148 0
      bundle/ctrlp/autoload/ctrlp/mrufiles.vim
  57. 59 0
      bundle/ctrlp/autoload/ctrlp/quickfix.vim
  58. 59 0
      bundle/ctrlp/autoload/ctrlp/rtscript.vim
  59. 128 0
      bundle/ctrlp/autoload/ctrlp/tag.vim
  60. 154 0
      bundle/ctrlp/autoload/ctrlp/undo.vim
  61. 120 0
      bundle/ctrlp/autoload/ctrlp/utils.vim
  62. 1406 0
      bundle/ctrlp/doc/ctrlp.txt
  63. 69 0
      bundle/ctrlp/plugin/ctrlp.vim
  64. 8 0
      bundle/ctrlp/readme.md
  65. 1 0
      bundle/neocomplete
  66. 1 0
      bundle/nerdtree
  67. 1 0
      bundle/pydiction
  68. 3 0
      bundle/self_vim/1.py
  69. 30 0
      bundle/self_vim/srech.sh
  70. 19 0
      bundle/self_vim/srech.vim
  71. 1 0
      bundle/self_vim/test.sh
  72. 1 0
      bundle/tabular
  73. 1 0
      bundle/vim-colors-solarized
  74. 276 0
      colors/molokai.vim
  75. 1117 0
      colors/solarized.vim
  76. 8 0
      install.sh
  77. 63 0
      plugin/neocomplete.vim
  78. 24 0
      plugin/neocomplete/buffer.vim
  79. 24 0
      plugin/neocomplete/dictionary.vim
  80. 24 0
      plugin/neocomplete/member.vim
  81. 24 0
      plugin/neocomplete/tag.vim
  82. BIN
      v8.1.1835

+ 6 - 0
README.md

@@ -0,0 +1,6 @@
+vim编辑器
+支持python自动补齐
+支持搜索
+支持启动
+支持go补齐
+支持自定义脚本编写

+ 329 - 0
autoload/neocomplete.vim

@@ -0,0 +1,329 @@
+"=============================================================================
+" FILE: neocomplete.vim
+" AUTHOR:  Shougo Matsushita <Shougo.Matsu@gmail.com>
+" License: MIT license  {{{
+"     Permission is hereby granted, free of charge, to any person obtaining
+"     a copy of this software and associated documentation files (the
+"     "Software"), to deal in the Software without restriction, including
+"     without limitation the rights to use, copy, modify, merge, publish,
+"     distribute, sublicense, and/or sell copies of the Software, and to
+"     permit persons to whom the Software is furnished to do so, subject to
+"     the following conditions:
+"
+"     The above copyright notice and this permission notice shall be included
+"     in all copies or substantial portions of the Software.
+"
+"     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+"     OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+"     MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+"     IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+"     CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+"     TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+"     SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+" }}}
+"=============================================================================
+
+if !exists('g:loaded_neocomplete')
+  runtime! plugin/neocomplete.vim
+endif
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+" Global options definition. "{{{
+let g:neocomplete#max_list =
+      \ get(g:, 'neocomplete#max_list', 100)
+let g:neocomplete#max_keyword_width =
+      \ get(g:, 'neocomplete#max_keyword_width', 80)
+let g:neocomplete#auto_completion_start_length =
+      \ get(g:, 'neocomplete#auto_completion_start_length', 2)
+let g:neocomplete#manual_completion_start_length =
+      \ get(g:, 'neocomplete#manual_completion_start_length', 0)
+let g:neocomplete#min_keyword_length =
+      \ get(g:, 'neocomplete#min_keyword_length', 4)
+let g:neocomplete#enable_ignore_case =
+      \ get(g:, 'neocomplete#enable_ignore_case', &ignorecase)
+let g:neocomplete#enable_smart_case =
+      \ get(g:, 'neocomplete#enable_smart_case', &infercase)
+let g:neocomplete#enable_camel_case =
+      \ get(g:, 'neocomplete#enable_camel_case', 0)
+let g:neocomplete#disable_auto_complete =
+      \ get(g:, 'neocomplete#disable_auto_complete', 0)
+let g:neocomplete#enable_fuzzy_completion =
+      \ get(g:, 'neocomplete#enable_fuzzy_completion', 1)
+let g:neocomplete#auto_complete_delay =
+      \ get(g:, 'neocomplete#auto_complete_delay', 50)
+let g:neocomplete#enable_auto_select =
+      \ get(g:, 'neocomplete#enable_auto_select', 0)
+let g:neocomplete#enable_auto_delimiter =
+      \ get(g:, 'neocomplete#enable_auto_delimiter', 0)
+let g:neocomplete#lock_buffer_name_pattern =
+      \ get(g:, 'neocomplete#lock_buffer_name_pattern', '')
+let g:neocomplete#lock_iminsert =
+      \ get(g:, 'neocomplete#lock_iminsert', 0)
+let g:neocomplete#enable_multibyte_completion =
+      \ get(g:, 'neocomplete#enable_multibyte_completion', 0)
+let g:neocomplete#release_cache_time =
+      \ get(g:, 'neocomplete#release_cache_time', 900)
+let g:neocomplete#skip_auto_completion_time =
+      \ get(g:, 'neocomplete#skip_auto_completion_time', '0.3')
+let g:neocomplete#enable_auto_close_preview =
+      \ get(g:, 'neocomplete#enable_auto_close_preview', 0)
+let g:neocomplete#enable_refresh_always =
+      \ get(g:, 'neocomplete#enable_refresh_always', 0)
+let g:neocomplete#fallback_mappings =
+      \ get(g:, 'neocomplete#fallback_mappings', [])
+let g:neocomplete#sources =
+      \ get(g:, 'neocomplete#sources', {})
+let g:neocomplete#keyword_patterns =
+      \ get(g:, 'neocomplete#keyword_patterns', {})
+let g:neocomplete#delimiter_patterns =
+      \ get(g:, 'neocomplete#delimiter_patterns', {})
+let g:neocomplete#text_mode_filetypes =
+      \ get(g:, 'neocomplete#text_mode_filetypes', {})
+let g:neocomplete#tags_filter_patterns =
+      \ get(g:, 'neocomplete#tags_filter_patterns', {})
+let g:neocomplete#force_omni_input_patterns =
+      \ get(g:, 'neocomplete#force_omni_input_patterns', {})
+let g:neocomplete#ignore_source_files =
+      \ get(g:, 'neocomplete#ignore_source_files', [])
+"}}}
+
+function! neocomplete#initialize() abort "{{{
+  return neocomplete#init#enable()
+endfunction"}}}
+
+function! neocomplete#get_current_neocomplete() abort "{{{
+  if !exists('b:neocomplete')
+    call neocomplete#init#_current_neocomplete()
+  endif
+
+  return b:neocomplete
+endfunction"}}}
+function! neocomplete#get_context() abort "{{{
+  return neocomplete#get_current_neocomplete().context
+endfunction"}}}
+
+" Source helper. "{{{
+function! neocomplete#define_source(source) abort "{{{
+  let sources = neocomplete#variables#get_sources()
+  for source in neocomplete#util#convert2list(a:source)
+    let source = neocomplete#init#_source(source)
+    if !source.disabled
+      let sources[source.name] = source
+    endif
+  endfor
+endfunction"}}}
+function! neocomplete#define_filter(filter) abort "{{{
+  let filters = neocomplete#variables#get_filters()
+  for filter in neocomplete#util#convert2list(a:filter)
+    let filters[filter.name] = neocomplete#init#_filter(filter)
+  endfor
+endfunction"}}}
+function! neocomplete#available_sources() abort "{{{
+  return copy(neocomplete#variables#get_sources())
+endfunction"}}}
+function! neocomplete#custom_source(source_name, option_name, value) abort "{{{
+  return neocomplete#custom#source(a:source_name, a:option_name, a:value)
+endfunction"}}}
+
+function! neocomplete#dup_filter(list) abort "{{{
+  return neocomplete#util#dup_filter(a:list)
+endfunction"}}}
+
+function! neocomplete#system(...) abort "{{{
+  return call('neocomplete#util#system', a:000)
+endfunction"}}}
+function! neocomplete#has_vimproc() abort "{{{
+  return neocomplete#util#has_vimproc()
+endfunction"}}}
+
+function! neocomplete#get_cur_text(...) abort "{{{
+  " Return cached text.
+  let neocomplete = neocomplete#get_current_neocomplete()
+  return (a:0 == 0 && mode() ==# 'i' &&
+        \  neocomplete.cur_text != '') ?
+        \ neocomplete.cur_text : neocomplete#helper#get_cur_text()
+endfunction"}}}
+function! neocomplete#get_keyword_pattern(...) abort "{{{
+  let filetype = a:0 != 0? a:1 : neocomplete#get_context_filetype()
+  if a:0 < 2
+    return neocomplete#helper#unite_patterns(
+          \ g:neocomplete#keyword_patterns, filetype)
+  endif
+
+  let source = neocomplete#variables#get_source(a:2)
+  if !has_key(source, 'neocomplete__keyword_patterns')
+    let source.neocomplete__keyword_patterns = {}
+  endif
+  if !has_key(source.neocomplete__keyword_patterns, filetype)
+    let source.neocomplete__keyword_patterns[filetype] =
+          \ neocomplete#helper#unite_patterns(
+          \         source.keyword_patterns, filetype)
+  endif
+
+  return source.neocomplete__keyword_patterns[filetype]
+endfunction"}}}
+function! neocomplete#get_keyword_pattern_end(...) abort "{{{
+  return '\%('.call('neocomplete#get_keyword_pattern', a:000).'\m\)$'
+endfunction"}}}
+function! neocomplete#match_word(...) abort "{{{
+  return call('neocomplete#helper#match_word', a:000)
+endfunction"}}}
+function! neocomplete#is_enabled() abort "{{{
+  return neocomplete#init#is_enabled()
+endfunction"}}}
+function! neocomplete#is_locked(...) abort "{{{
+  return neocomplete#is_cache_disabled() || &paste
+        \ || (&t_Co != '' && &t_Co < 8)
+        \ || g:neocomplete#disable_auto_complete
+endfunction"}}}
+function! neocomplete#is_cache_disabled() abort "{{{
+  let ignore_filetypes = ['fuf', 'ku']
+  let bufnr = a:0 > 0 ? a:1 : bufnr('%')
+  return !neocomplete#is_enabled()
+        \ || index(ignore_filetypes, &filetype) >= 0
+        \ || neocomplete#get_current_neocomplete().lock
+        \ || (g:neocomplete#lock_buffer_name_pattern != '' &&
+        \   bufname(bufnr) =~ g:neocomplete#lock_buffer_name_pattern)
+endfunction"}}}
+function! neocomplete#is_auto_select() abort "{{{
+  return g:neocomplete#enable_auto_select
+endfunction"}}}
+function! neocomplete#is_auto_complete() abort "{{{
+  let neocomplete = neocomplete#get_current_neocomplete()
+  return neocomplete.is_auto_complete
+endfunction"}}}
+function! neocomplete#is_eskk_enabled() abort "{{{
+  return exists('*eskk#is_enabled') && eskk#is_enabled()
+endfunction"}}}
+function! neocomplete#is_multibyte_input(cur_text) abort "{{{
+  return (exists('b:skk_on') && b:skk_on)
+        \   || (!g:neocomplete#enable_multibyte_completion
+        \         && char2nr(split(a:cur_text, '\zs')[-1]) > 0x80)
+endfunction"}}}
+function! neocomplete#is_text_mode() abort "{{{
+  let neocomplete = neocomplete#get_current_neocomplete()
+  let filetypes = g:neocomplete#text_mode_filetypes
+  return get(filetypes, neocomplete.context_filetype, 0)
+        \ || get(filetypes, '_', 0)
+endfunction"}}}
+function! neocomplete#is_windows() abort "{{{
+  return neocomplete#util#is_windows()
+endfunction"}}}
+function! neocomplete#is_prefetch() abort "{{{
+  return 1
+endfunction"}}}
+function! neocomplete#exists_echodoc() abort "{{{
+  return exists('g:loaded_echodoc') && g:loaded_echodoc
+endfunction"}}}
+function! neocomplete#within_comment() abort "{{{
+  return neocomplete#get_current_neocomplete().within_comment
+endfunction"}}}
+function! neocomplete#print_error(string) abort "{{{
+  echohl Error | echomsg '[neocomplete] ' . a:string | echohl None
+endfunction"}}}
+function! neocomplete#print_warning(string) abort "{{{
+  echohl WarningMsg | echomsg '[neocomplete] ' . a:string | echohl None
+endfunction"}}}
+function! neocomplete#head_match(checkstr, headstr) abort "{{{
+  let checkstr = &ignorecase ?
+        \ tolower(a:checkstr) : a:checkstr
+  let headstr = &ignorecase ?
+        \ tolower(a:headstr) : a:headstr
+  return stridx(checkstr, headstr) == 0
+endfunction"}}}
+function! neocomplete#get_source_filetypes(filetype) abort "{{{
+  return neocomplete#helper#get_source_filetypes(a:filetype)
+endfunction"}}}
+function! neocomplete#escape_match(str) abort "{{{
+  return escape(a:str, '~"*\.^$[]')
+endfunction"}}}
+function! neocomplete#get_context_filetype(...) abort "{{{
+  let neocomplete = exists('b:neocomplete') ?
+        \ b:neocomplete : neocomplete#get_current_neocomplete()
+
+  if a:0 != 0 || mode() !=# 'i' ||
+        \ neocomplete.context_filetype == ''
+    call neocomplete#context_filetype#set()
+  endif
+
+  return neocomplete.context_filetype
+endfunction"}}}
+function! neocomplete#print_debug(expr) abort "{{{
+  if g:neocomplete#enable_debug
+    echomsg string(a:expr)
+  endif
+endfunction"}}}
+function! neocomplete#get_data_directory() abort "{{{
+  let g:neocomplete#data_directory =
+        \ get(g:, 'neocomplete#data_directory',
+        \  ($XDG_CACHE_HOME != '' ?
+        \   $XDG_CACHE_HOME . '/neocomplete' : '~/.cache/neocomplete'))
+  let directory = neocomplete#util#substitute_path_separator(
+        \ neocomplete#util#expand(g:neocomplete#data_directory))
+  if !isdirectory(directory)
+    if neocomplete#util#is_sudo()
+      call neocomplete#print_error(printf(
+            \ 'Cannot create Directory "%s" in sudo session.', directory))
+    else
+      call mkdir(directory, 'p')
+    endif
+  endif
+
+  return directory
+endfunction"}}}
+function! neocomplete#complete_check() abort "{{{
+  return neocomplete#helper#complete_check()
+endfunction"}}}
+function! neocomplete#skip_next_complete() abort "{{{
+  let neocomplete = neocomplete#get_current_neocomplete()
+  let neocomplete.skip_next_complete = 1
+endfunction"}}}
+function! neocomplete#get_default_matchers() abort "{{{
+  return map(copy(neocomplete#get_current_neocomplete().default_matchers),
+        \ 'v:val.name')
+endfunction"}}}
+function! neocomplete#set_default_matchers(matchers) abort "{{{
+  let neocomplete = neocomplete#get_current_neocomplete()
+  let neocomplete.default_matchers = neocomplete#init#_filters(
+        \ neocomplete#util#convert2list(a:matchers))
+endfunction"}}}
+
+function! neocomplete#set_dictionary_helper(variable, keys, value) abort "{{{
+  return neocomplete#util#set_dictionary_helper(
+        \ a:variable, a:keys, a:value)
+endfunction"}}}
+function! neocomplete#disable_default_dictionary(variable) abort "{{{
+  return neocomplete#util#disable_default_dictionary(a:variable)
+endfunction"}}}
+function! neocomplete#filetype_complete(arglead, cmdline, cursorpos) abort "{{{
+  return neocomplete#helper#filetype_complete(a:arglead, a:cmdline, a:cursorpos)
+endfunction"}}}
+"}}}
+
+" Key mapping functions. "{{{
+function! neocomplete#smart_close_popup() abort
+  return neocomplete#mappings#smart_close_popup()
+endfunction
+function! neocomplete#close_popup() abort
+  return neocomplete#mappings#close_popup()
+endfunction
+function! neocomplete#cancel_popup() abort
+  return neocomplete#mappings#cancel_popup()
+endfunction
+function! neocomplete#undo_completion() abort
+  return neocomplete#mappings#undo_completion()
+endfunction
+function! neocomplete#complete_common_string() abort
+  return neocomplete#mappings#complete_common_string()
+endfunction
+function! neocomplete#start_manual_complete(...) abort
+  return call('neocomplete#mappings#start_manual_complete', a:000)
+endfunction
+"}}}
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: foldmethod=marker

+ 276 - 0
autoload/neocomplete/async_cache.vim

@@ -0,0 +1,276 @@
+"=============================================================================
+" FILE: async_cache.vim
+" AUTHOR: Shougo Matsushita <Shougo.Matsu@gmail.com>
+" License: MIT license  {{{
+"     Permission is hereby granted, free of charge, to any person obtaining
+"     a copy of this software and associated documentation files (the
+"     "Software"), to deal in the Software without restriction, including
+"     without limitation the rights to use, copy, modify, merge, publish,
+"     distribute, sublicense, and/or sell copies of the Software, and to
+"     permit persons to whom the Software is furnished to do so, subject to
+"     the following condition
+"
+"     The above copyright notice and this permission notice shall be included
+"     in all copies or substantial portions of the Software.
+"
+"     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+"     OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+"     MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+"     IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+"     CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+"     TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+"     SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+" }}}
+"=============================================================================
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! s:main(argv) abort "{{{
+  " args: funcname, outputname filename pattern_file_name mark minlen fileencoding
+  let [funcname, outputname, filename, pattern_file_name, mark, minlen, fileencoding]
+        \ = a:argv
+
+  if funcname ==# 'load_from_file'
+    let keyword_list = s:load_from_file(
+          \ filename, pattern_file_name, mark, minlen, fileencoding, 1)
+
+    let string = '{' . escape(string(keyword_list)[1 : -2], '\\') . '}'
+  else
+    let keyword_list = s:load_from_tags(
+          \ filename, pattern_file_name, mark, minlen, fileencoding)
+    let string = string(keyword_list)
+  endif
+
+  if empty(keyword_list)
+    return
+  endif
+
+  " For neocomplete.
+  " Output cache.
+  call writefile([string], outputname)
+endfunction"}}}
+
+function! s:load_from_file(filename, pattern_file_name, mark, minlen, fileencoding, is_string) abort "{{{
+  if !filereadable(a:filename)
+    " File not found.
+    return []
+  endif
+
+  let lines = readfile(a:filename)
+  if a:fileencoding !=# &encoding
+    let lines = map(lines, 's:iconv(v:val, a:fileencoding, &encoding)')
+  endif
+
+  let pattern = get(readfile(a:pattern_file_name), 0, '\h\w*')
+  let pattern2 = '^\%('.pattern.'\m\)'
+  let keyword_list = []
+  let dup_check = {}
+
+  for line in lines "{{{
+    let match = match(line, pattern)
+    while match >= 0 "{{{
+      let match_str = matchstr(line, pattern2, match)
+
+      if !has_key(dup_check, match_str) && len(match_str) >= a:minlen
+        " Append list.
+        call add(keyword_list, match_str)
+        let dup_check[match_str] = 1
+      endif
+
+      if match_str == ''
+        break
+      endif
+
+      let match += len(match_str)
+
+      let match = match(line, pattern, match)
+    endwhile"}}}
+  endfor"}}}
+
+  if !a:is_string
+    call map(keyword_list, "{'word' : match_str}")
+  endif
+
+  return keyword_list
+endfunction"}}}
+
+function! s:load_from_tags(filename, pattern_file_name, mark, minlen, fileencoding) abort "{{{
+  let keyword_lists = []
+  let dup_check = {}
+
+  let [tags_file_name, filter_pattern] =
+        \ readfile(a:pattern_file_name)[1 : 2]
+  if tags_file_name !=# '$dummy$'
+    " Check output.
+    let tags_list = []
+
+    let i = 0
+    while i < 2
+      if filereadable(tags_file_name)
+        " Use filename.
+        let tags_list = map(readfile(tags_file_name),
+              \ 's:iconv(v:val, a:fileencoding, &encoding)')
+        break
+      endif
+
+      sleep 500m
+      let i += 1
+    endwhile
+  else
+    if !filereadable(a:filename)
+      return []
+    endif
+
+    " Use filename.
+    let tags_list = map(readfile(a:filename),
+          \ 's:iconv(v:val, a:fileencoding, &encoding)')
+  endif
+
+  if empty(tags_list)
+    return s:load_from_file(a:filename, a:pattern_file_name,
+          \ a:mark, a:minlen, a:fileencoding, 0)
+  endif
+
+  for line in tags_list
+    let tag = split(substitute(line, "\<CR>", '', 'g'), '\t', 1)
+
+    " Add keywords.
+    if line =~ '^!' || len(tag) < 3 || len(tag[0]) < a:minlen
+          \ || has_key(dup_check, tag[0])
+      continue
+    endif
+
+    let opt = join(tag[2:], "\<TAB>")
+    let cmd = matchstr(opt, '.*/;"')
+
+    let option = {
+          \ 'cmd' : substitute(substitute(substitute(cmd,
+          \'^\%([/?]\^\?\)\?\s*\|\%(\$\?[/?]\)\?;"$', '', 'g'),
+          \ '\\\\', '\\', 'g'), '\\/', '/', 'g'),
+          \ 'kind' : ''
+          \}
+    if option.cmd =~ '\d\+'
+      let option.cmd = tag[0]
+    endif
+
+    for opt in split(opt[len(cmd):], '\t', 1)
+      let key = matchstr(opt, '^\h\w*\ze:')
+      if key == ''
+        let option['kind'] = opt
+      else
+        let option[key] = matchstr(opt, '^\h\w*:\zs.*')
+      endif
+    endfor
+
+    if has_key(option, 'file')
+          \ || (has_key(option, 'access') && option.access != 'public')
+      continue
+    endif
+
+    let abbr = has_key(option, 'signature')? tag[0] . option.signature :
+          \ (option['kind'] == 'd' || option['cmd'] == '') ?
+          \ tag[0] : option['cmd']
+    let abbr = substitute(abbr, '\s\+', ' ', 'g')
+    " Substitute "namespace foobar" to "foobar <namespace>".
+    let abbr = substitute(abbr,
+          \'^\(namespace\|class\|struct\|enum\|union\)\s\+\(.*\)$',
+          \'\2 <\1>', '')
+    " Substitute typedef.
+    let abbr = substitute(abbr,
+          \'^typedef\s\+\(.*\)\s\+\(\h\w*\%(::\w*\)*\);\?$',
+          \'\2 <typedef \1>', 'g')
+    " Substitute extends and implements.
+    let abbr = substitute(abbr,
+          \'\<\%(extends\|implements\)\s\+\S\+\>', '', '')
+    " Substitute marker.
+    let abbr = substitute(abbr, '"\s*{{{', '', '')
+
+    let keyword = {
+          \ 'word' : tag[0], 'abbr' : abbr, 'menu' : '',
+          \ 'kind' : option['kind'],
+          \ }
+    if has_key(option, 'struct')
+      let keyword.menu = option.struct
+    elseif has_key(option, 'class')
+      let keyword.menu = option.class
+    elseif has_key(option, 'enum')
+      let keyword.menu = option.enum
+    elseif has_key(option, 'union')
+      let keyword.menu = option.union
+    endif
+
+    call add(keyword_lists, keyword)
+    let dup_check[tag[0]] = 1
+  endfor"}}}
+
+  if filter_pattern != ''
+    call filter(keyword_lists, filter_pattern)
+  endif
+
+  return keyword_lists
+endfunction"}}}
+
+function! s:truncate(str, width) abort "{{{
+  " Original function is from mattn.
+  " http://github.com/mattn/googlereader-vim/tree/master
+
+  if a:str =~# '^[\x00-\x7f]*$'
+    return len(a:str) < a:width ?
+          \ printf('%-'.a:width.'s', a:str) : strpart(a:str, 0, a:width)
+  endif
+
+  let ret = a:str
+  let width = strdisplaywidth(a:str)
+  if width > a:width
+    let ret = s:strwidthpart(ret, a:width)
+    let width = strdisplaywidth(ret)
+  endif
+
+  if width < a:width
+    let ret .= repeat(' ', a:width - width)
+  endif
+
+  return ret
+endfunction"}}}
+
+function! s:strwidthpart(str, width) abort "{{{
+  let ret = a:str
+  let width = strdisplaywidth(a:str)
+  while width > a:width
+    let char = matchstr(ret, '.$')
+    let ret = ret[: -1 - len(char)]
+    let width -= strwidth(char)
+  endwhile
+
+  return ret
+endfunction"}}}
+
+function! s:iconv(expr, from, to) abort
+  if a:from == '' || a:to == '' || a:from ==? a:to
+    return a:expr
+  endif
+  let result = iconv(a:expr, a:from, a:to)
+  return result != '' ? result : a:expr
+endfunction
+
+if argc() == 7 &&
+      \ (argv(0) ==# 'load_from_file' || argv(0) ==# 'load_from_tags')
+  try
+    call s:main(argv())
+  catch
+    call writefile([v:throwpoint, v:exception],
+          \     fnamemodify(argv(1), ':h:h').'/async_error_log')
+  endtry
+
+  qall!
+else
+  function! neocomplete#async_cache#main(argv) abort "{{{
+    call s:main(a:argv)
+  endfunction"}}}
+endif
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: foldmethod=marker

+ 298 - 0
autoload/neocomplete/cache.vim

@@ -0,0 +1,298 @@
+"=============================================================================
+" FILE: cache.vim
+" AUTHOR: Shougo Matsushita <Shougo.Matsu@gmail.com>
+" License: MIT license  {{{
+"     Permission is hereby granted, free of charge, to any person obtaining
+"     a copy of this software and associated documentation files (the
+"     "Software"), to deal in the Software without restriction, including
+"     without limitation the rights to use, copy, modify, merge, publish,
+"     distribute, sublicense, and/or sell copies of the Software, and to
+"     permit persons to whom the Software is furnished to do so, subject to
+"     the following conditionneocomplete#cache#
+"
+"     The above copyright notice and this permission notice shall be included
+"     in all copies or substantial portions of the Software.
+"
+"     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+"     OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+"     MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+"     IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+"     CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+"     TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+"     SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+" }}}
+"=============================================================================
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+let s:Cache = neocomplete#util#get_vital().import('System.Cache.Deprecated')
+
+" Cache loader.
+function! neocomplete#cache#load_from_cache(cache_dir, filename, ...) abort "{{{
+  let is_string = get(a:000, 0, 0)
+
+  try
+    " Note: For neocomplete.
+    let list = []
+
+    if is_string
+      lua << EOF
+do
+  local ret = vim.eval('list')
+  local list = {}
+  for line in io.lines(vim.eval(
+      'neocomplete#cache#encode_name(a:cache_dir, a:filename)')) do
+    list = (loadstring) and loadstring('return ' .. line)()
+                        or  load('return ' .. line)()
+  end
+
+  for i = 1, #list do
+    ret:add(list[i])
+  end
+end
+EOF
+    else
+      let list = eval(get(neocomplete#cache#readfile(
+            \ a:cache_dir, a:filename), 0, '[]'))
+    endif
+
+    if !empty(list) && is_string && type(list[0]) != type('')
+      " Type check.
+      throw 'Type error'
+    endif
+
+    return list
+  catch
+    " echomsg string(v:errmsg)
+    " echomsg string(v:exception)
+
+    " Delete old cache file.
+    let cache_name =
+          \ neocomplete#cache#encode_name(a:cache_dir, a:filename)
+    if filereadable(cache_name)
+      call delete(cache_name)
+    endif
+
+    return []
+  endtry
+endfunction"}}}
+
+" New cache loader.
+function! neocomplete#cache#check_cache(cache_dir, key, async_cache_dictionary, keyword_cache, is_string) abort "{{{
+  if !has_key(a:async_cache_dictionary, a:key)
+    return
+  endif
+
+  let cache_list = a:async_cache_dictionary[a:key]
+
+  if !has_key(a:keyword_cache, a:key)
+    let a:keyword_cache[a:key] = []
+  endif
+  for cache in filter(copy(cache_list), 'filereadable(v:val.cachename)')
+    let a:keyword_cache[a:key] += neocomplete#cache#load_from_cache(
+              \ a:cache_dir, cache.filename, a:is_string)
+  endfor
+
+  call filter(cache_list, '!filereadable(v:val.cachename)')
+
+  if empty(cache_list)
+    " Delete from dictionary.
+    call remove(a:async_cache_dictionary, a:key)
+    return
+  endif
+endfunction"}}}
+
+" For buffer source cache loader.
+function! neocomplete#cache#get_cache_list(cache_dir, async_cache_list) abort "{{{
+  let cache_list = a:async_cache_list
+
+  let loaded_keywords = []
+  let loaded = 0
+  for cache in filter(copy(cache_list), 'filereadable(v:val.cachename)')
+    let loaded = 1
+    let loaded_keywords = neocomplete#cache#load_from_cache(
+              \ a:cache_dir, cache.filename, 1)
+  endfor
+
+  call filter(cache_list, '!filereadable(v:val.cachename)')
+
+  return [loaded, loaded_keywords]
+endfunction"}}}
+
+function! neocomplete#cache#save_cache(cache_dir, filename, keyword_list) abort "{{{
+  if neocomplete#util#is_sudo()
+    return
+  endif
+
+  " Output cache.
+  let string = substitute(substitute(substitute(
+        \ string(a:keyword_list), '^[', '{', ''),
+        \  ']$', '}', ''), '\\', '\\\\', 'g')
+  call neocomplete#cache#writefile(
+        \ a:cache_dir, a:filename, [string])
+endfunction"}}}
+
+" Cache helper.
+function! neocomplete#cache#getfilename(cache_dir, filename) abort "{{{
+  let cache_dir = neocomplete#get_data_directory() . '/' . a:cache_dir
+  return s:Cache.getfilename(cache_dir, a:filename)
+endfunction"}}}
+function! neocomplete#cache#filereadable(cache_dir, filename) abort "{{{
+  let cache_dir = neocomplete#get_data_directory() . '/' . a:cache_dir
+  return s:Cache.filereadable(cache_dir, a:filename)
+endfunction"}}}
+function! neocomplete#cache#readfile(cache_dir, filename) abort "{{{
+  let cache_dir = neocomplete#get_data_directory() . '/' . a:cache_dir
+  return s:Cache.readfile(cache_dir, a:filename)
+endfunction"}}}
+function! neocomplete#cache#writefile(cache_dir, filename, list) abort "{{{
+  if neocomplete#util#is_sudo()
+    return
+  endif
+
+  let cache_dir = neocomplete#get_data_directory() . '/' . a:cache_dir
+  return s:Cache.writefile(cache_dir, a:filename, a:list)
+endfunction"}}}
+function! neocomplete#cache#encode_name(cache_dir, filename) abort
+  " Check cache directory.
+  let cache_dir = neocomplete#get_data_directory() . '/' . a:cache_dir
+  return s:Cache.getfilename(cache_dir, a:filename)
+endfunction
+function! neocomplete#cache#check_old_cache(cache_dir, filename) abort "{{{
+  let cache_dir = neocomplete#get_data_directory() . '/' . a:cache_dir
+  return  s:Cache.check_old_cache(cache_dir, a:filename)
+endfunction"}}}
+function! neocomplete#cache#make_directory(directory) abort "{{{
+  let directory =
+        \ neocomplete#get_data_directory() .'/'.a:directory
+  if !isdirectory(directory)
+    if neocomplete#util#is_sudo()
+      call neocomplete#print_error(printf(
+            \ 'Cannot create Directory "%s" in sudo session.', directory))
+    else
+      call mkdir(directory, 'p')
+    endif
+  endif
+endfunction"}}}
+
+let s:sdir = neocomplete#util#substitute_path_separator(
+      \ fnamemodify(expand('<sfile>'), ':p:h'))
+
+function! neocomplete#cache#async_load_from_file(cache_dir, filename, pattern, mark) abort "{{{
+  if !neocomplete#cache#check_old_cache(a:cache_dir, a:filename)
+        \ || neocomplete#util#is_sudo()
+    return neocomplete#cache#encode_name(a:cache_dir, a:filename)
+  endif
+
+  let pattern_file_name =
+        \ neocomplete#cache#encode_name('keyword_patterns', a:filename)
+  let cache_name =
+        \ neocomplete#cache#encode_name(a:cache_dir, a:filename)
+
+  " Create pattern file.
+  call neocomplete#cache#writefile(
+        \ 'keyword_patterns', a:filename, [a:pattern])
+
+  " args: funcname, outputname, filename pattern mark
+  "       minlen maxlen encoding
+  let fileencoding =
+        \ &fileencoding == '' ? &encoding : &fileencoding
+  let argv = [
+        \  'load_from_file', cache_name, a:filename, pattern_file_name, a:mark,
+        \  g:neocomplete#min_keyword_length, fileencoding
+        \ ]
+  return s:async_load(argv, a:cache_dir, a:filename)
+endfunction"}}}
+function! neocomplete#cache#async_load_from_tags(cache_dir, filename, filetype, pattern, mark) abort "{{{
+  if !neocomplete#cache#check_old_cache(a:cache_dir, a:filename)
+        \ || neocomplete#util#is_sudo()
+    return neocomplete#cache#encode_name(a:cache_dir, a:filename)
+  endif
+
+  let cache_name =
+        \ neocomplete#cache#encode_name(a:cache_dir, a:filename)
+  let pattern_file_name =
+        \ neocomplete#cache#encode_name('tags_patterns', a:filename)
+
+  let tags_file_name = '$dummy$'
+
+  let filter_pattern =
+        \ get(g:neocomplete#tags_filter_patterns, a:filetype, '')
+  call neocomplete#cache#writefile('tags_patterns', a:filename,
+        \ [a:pattern, tags_file_name, filter_pattern, a:filetype])
+
+  " args: funcname, outputname, filename
+  "       pattern mark minlen encoding
+  let fileencoding = &fileencoding == '' ? &encoding : &fileencoding
+  let argv = [
+        \  'load_from_tags', cache_name, a:filename, pattern_file_name, a:mark,
+        \  g:neocomplete#min_keyword_length, fileencoding
+        \ ]
+  return s:async_load(argv, a:cache_dir, a:filename)
+endfunction"}}}
+function! s:async_load(argv, cache_dir, filename) abort "{{{
+  let vim_path = s:search_vim_path()
+
+  if vim_path == '' || !executable(vim_path)
+    call neocomplete#async_cache#main(a:argv)
+  else
+    let args = [vim_path, '-u', 'NONE', '-i', 'NONE', '-n',
+          \       '-N', '-S', s:sdir.'/async_cache.vim']
+          \ + a:argv
+    call vimproc#system_bg(args)
+    " call vimproc#system(args)
+    " call system(join(args))
+  endif
+
+  return neocomplete#cache#encode_name(a:cache_dir, a:filename)
+endfunction"}}}
+function! s:search_vim_path() abort "{{{
+  if exists('s:vim_path')
+    return s:vim_path
+  endif
+
+  if !neocomplete#has_vimproc()
+    return ''
+  endif
+
+  let paths = vimproc#get_command_name(v:progname, $PATH, -1)
+  if empty(paths)
+    if has('gui_macvim')
+      " MacVim check.
+      if !executable('/Applications/MacVim.app/Contents/MacOS/Vim')
+        call neocomplete#print_error(
+              \ 'You installed MacVim in not default directory!'.
+              \ ' You must add MacVim installed path in $PATH.')
+        let g:neocomplete#use_vimproc = 0
+        return ''
+      endif
+
+      let s:vim_path = '/Applications/MacVim.app/Contents/MacOS/Vim'
+    else
+      call neocomplete#print_error(
+            \ printf('Vim path : "%s" is not found.'.
+            \        ' You must add "%s" installed path in $PATH.',
+            \        v:progname, v:progname))
+      let g:neocomplete#use_vimproc = 0
+      return ''
+    endif
+  else
+    let base_path = neocomplete#util#substitute_path_separator(
+          \ fnamemodify(paths[0], ':p:h'))
+
+    let s:vim_path = base_path . '/vim'
+
+    if !executable(s:vim_path) && neocomplete#util#is_mac()
+      " Note: Search "Vim" instead of vim.
+      let s:vim_path = base_path. '/Vim'
+    endif
+  endif
+
+  return s:vim_path
+endfunction"}}}
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: foldmethod=marker

+ 100 - 0
autoload/neocomplete/commands.vim

@@ -0,0 +1,100 @@
+"=============================================================================
+" FILE: commands.vim
+" AUTHOR: Shougo Matsushita <Shougo.Matsu@gmail.com>
+" License: MIT license  {{{
+"     Permission is hereby granted, free of charge, to any person obtaining
+"     a copy of this software and associated documentation files (the
+"     "Software"), to deal in the Software without restriction, including
+"     without limitation the rights to use, copy, modify, merge, publish,
+"     distribute, sublicense, and/or sell copies of the Software, and to
+"     permit persons to whom the Software is furnished to do so, subject to
+"     the following conditions:
+"
+"     The above copyright notice and this permission notice shall be included
+"     in all copies or substantial portions of the Software.
+"
+"     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+"     OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+"     MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+"     IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+"     CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+"     TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+"     SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+" }}}
+"=============================================================================
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! neocomplete#commands#_initialize() abort "{{{
+  command! -nargs=1 NeoCompleteAutoCompletionLength
+        \ call s:set_auto_completion_length(<args>)
+endfunction"}}}
+
+function! neocomplete#commands#_toggle_lock() abort "{{{
+  if !neocomplete#is_enabled()
+    call neocomplete#init#enable()
+    return
+  endif
+
+  if neocomplete#get_current_neocomplete().lock
+    echo 'neocomplete is unlocked!'
+    call neocomplete#commands#_unlock()
+  else
+    echo 'neocomplete is locked!'
+    call neocomplete#commands#_lock()
+  endif
+endfunction"}}}
+
+function! neocomplete#commands#_lock() abort "{{{
+  let neocomplete = neocomplete#get_current_neocomplete()
+  let neocomplete.lock = 1
+endfunction"}}}
+
+function! neocomplete#commands#_unlock() abort "{{{
+  let neocomplete = neocomplete#get_current_neocomplete()
+  let neocomplete.lock = 0
+endfunction"}}}
+
+function! neocomplete#commands#_clean() abort "{{{
+  " Delete cache files.
+  let data_directory = neocomplete#get_data_directory()
+  for directory in filter(neocomplete#util#glob(
+        \ data_directory.'/*'), 'isdirectory(v:val)')
+    if has('patch-7.4.1120')
+      call delete(data_directory, 'rf')
+    else
+      for filename in filter(neocomplete#util#glob(directory.'/*'),
+            \ '!isdirectory(v:val)')
+        call delete(filename)
+      endfor
+    endif
+  endfor
+
+  echo 'Cleaned cache files in: ' . data_directory
+endfunction"}}}
+
+function! neocomplete#commands#_set_file_type(filetype) abort "{{{
+  let neocomplete = neocomplete#get_current_neocomplete()
+  let neocomplete.context_filetype = a:filetype
+endfunction"}}}
+
+function! s:rand(max) abort "{{{
+  if !has('reltime')
+    " Same value.
+    return 0
+  endif
+
+  let time = reltime()[1]
+  return (time < 0 ? -time : time)% (a:max + 1)
+endfunction"}}}
+
+function! s:set_auto_completion_length(len) abort "{{{
+  let neocomplete = neocomplete#get_current_neocomplete()
+  let neocomplete.completion_length = a:len
+endfunction"}}}
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: foldmethod=marker

+ 352 - 0
autoload/neocomplete/complete.vim

@@ -0,0 +1,352 @@
+"=============================================================================
+" FILE: complete.vim
+" AUTHOR: Shougo Matsushita <Shougo.Matsu@gmail.com>
+" License: MIT license  {{{
+"     Permission is hereby granted, free of charge, to any person obtaining
+"     a copy of this software and associated documentation files (the
+"     "Software"), to deal in the Software without restriction, including
+"     without limitation the rights to use, copy, modify, merge, publish,
+"     distribute, sublicense, and/or sell copies of the Software, and to
+"     permit persons to whom the Software is furnished to do so, subject to
+"     the following conditions:
+"
+"     The above copyright notice and this permission notice shall be included
+"     in all copies or substantial portions of the Software.
+"
+"     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+"     OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+"     MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+"     IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+"     CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+"     TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+"     SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+" }}}
+"=============================================================================
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! neocomplete#complete#_get_results(cur_text, ...) abort "{{{
+  call neocomplete#print_debug('start get_complete_sources')
+
+  let neocomplete = neocomplete#get_current_neocomplete()
+  let neocomplete.start_time = reltime()
+
+  " Comment check.
+  let neocomplete.within_comment =
+        \ neocomplete#helper#get_syn_name(1) ==# 'Comment'
+
+  let complete_sources = call(
+        \ 'neocomplete#complete#_set_results_pos', [a:cur_text] + a:000)
+  if empty(complete_sources)
+    call neocomplete#print_debug('Skipped.')
+    return []
+  endif
+
+  if neocomplete#is_auto_complete()
+    let complete_pos =
+          \ neocomplete#complete#_get_complete_pos(complete_sources)
+    call neocomplete#complete#_set_previous_position(a:cur_text, complete_pos)
+  endif
+
+  call neocomplete#complete#_set_results_words(complete_sources)
+
+  return filter(copy(complete_sources),
+        \ '!empty(v:val.neocomplete__context.candidates)')
+endfunction"}}}
+
+function! neocomplete#complete#_get_complete_pos(sources) abort "{{{
+  if empty(a:sources)
+    return -1
+  endif
+
+  return min([col('.')] + map(copy(a:sources),
+        \ 'v:val.neocomplete__context.complete_pos'))
+endfunction"}}}
+
+function! neocomplete#complete#_get_words(sources, complete_pos, complete_str) abort "{{{
+  let frequencies = neocomplete#variables#get_frequencies()
+  if exists('*neocomplete#sources#buffer#get_frequencies')
+    let frequencies = extend(copy(
+          \ neocomplete#sources#buffer#get_frequencies()),
+          \ frequencies)
+  endif
+
+  " Append prefix.
+  let candidates = []
+  let len_words = 0
+  for source in sort(filter(deepcopy(a:sources),
+        \ '!empty(v:val.neocomplete__context.candidates)'),
+        \  's:compare_source_rank')
+    let context = source.neocomplete__context
+    let words = type(context.candidates[0]) == type('') ?
+          \ map(copy(context.candidates), "{'word': v:val}") :
+          \ deepcopy(context.candidates)
+    let context.candidates = words
+
+    call neocomplete#helper#call_hook(
+          \ source, 'on_post_filter', {})
+
+    if context.complete_pos > a:complete_pos
+      let prefix = a:complete_str[: context.complete_pos
+            \                            - a:complete_pos - 1]
+
+      " Fix complete position.
+      let context.complete_pos = a:complete_pos
+      let context.complete_str = prefix
+
+      for candidate in words
+        let candidate.word = prefix . candidate.word
+      endfor
+    endif
+
+    lua << EOF
+    do
+      local frequencies = vim.eval('frequencies')
+      local candidates = vim.eval('words')
+      for i = 0, #candidates-1 do
+        if frequencies[candidates[i].word] ~= nil then
+          candidates[i].rank = frequencies[candidates[i].word]
+        end
+      end
+    end
+EOF
+
+    let words = neocomplete#helper#call_filters(
+          \ source.neocomplete__sorters, source, {})
+    if empty(words)
+      continue
+    endif
+
+    let words = neocomplete#helper#call_filters(
+          \ source.neocomplete__converters, source, {})
+
+    if empty(words)
+      continue
+    endif
+
+    if source.max_candidates > 0
+      let words = words[: source.max_candidates -1]
+    endif
+
+    " Set default menu.
+    if get(words[0], 'menu', '') !~ '^\[.*\]'
+      call s:set_default_menu(words, source)
+    endif
+
+    let candidates += words
+    let len_words += len(words)
+
+    if g:neocomplete#max_list > 0
+          \ && len_words > g:neocomplete#max_list
+      break
+    endif
+
+    if neocomplete#complete_check()
+      return []
+    endif
+  endfor
+
+  call filter(candidates, 'v:val.word !=# a:complete_str')
+
+  if g:neocomplete#max_list > 0
+    let candidates = candidates[: g:neocomplete#max_list]
+  endif
+
+  " Check dup and set icase.
+  let icase = g:neocomplete#enable_ignore_case &&
+        \ !((g:neocomplete#enable_smart_case
+        \    || g:neocomplete#enable_camel_case) && a:complete_str =~ '\u')
+  if icase
+    for candidate in candidates
+      let candidate.icase = 1
+    endfor
+  endif
+
+  if neocomplete#complete_check()
+    return []
+  endif
+
+  return candidates
+endfunction"}}}
+function! neocomplete#complete#_set_results_pos(cur_text, ...) abort "{{{
+  " Initialize sources.
+  let neocomplete = neocomplete#get_current_neocomplete()
+
+  let filetype = neocomplete#get_context_filetype()
+  let sources = (a:0 > 0) ? a:1 :
+        \ (filetype ==# neocomplete.sources_filetype) ?
+        \ neocomplete.sources : neocomplete#helper#get_sources_list()
+
+  let pos = winsaveview()
+
+  " Try source completion. "{{{
+  let complete_sources = []
+  for source in filter(values(sources),
+        \ 'neocomplete#helper#is_enabled_source(v:val, filetype)')
+    if !source.loaded
+      call neocomplete#helper#call_hook(source, 'on_init', {})
+      let source.loaded = 1
+    endif
+
+    let context = source.neocomplete__context
+    let context.input = a:cur_text
+    let context.filetype = filetype
+    let context.filetypes = neocomplete#context_filetype#filetypes()
+
+    try
+      let complete_pos = s:use_previous_result(source, context) ?
+            \ context.prev_complete_pos :
+            \ has_key(source, 'get_complete_position') ?
+            \ source.get_complete_position(context) :
+            \ neocomplete#helper#match_word(context.input,
+            \    neocomplete#get_keyword_pattern_end(filetype, source.name))[0]
+    catch
+      call neocomplete#print_error(v:throwpoint)
+      call neocomplete#print_error(v:exception)
+      call neocomplete#print_error(
+            \ 'Error occurred in source''s get_complete_position()!')
+      call neocomplete#print_error(
+            \ 'Source name is ' . source.name)
+      return complete_sources
+    finally
+      if winsaveview() != pos
+        call winrestview(pos)
+      endif
+    endtry
+
+    if complete_pos < 0
+      let context.complete_pos = -1
+      let context.complete_str = ''
+      continue
+    endif
+
+    let complete_str = context.input[complete_pos :]
+    if neocomplete#is_auto_complete() &&
+          \ (source.input_pattern == '' ||
+          \  context.input !~# '\%(' . source.input_pattern.'\m\)$') &&
+          \ len(complete_str) < source.min_pattern_length
+      " Skip.
+      let context.complete_pos = -1
+      let context.complete_str = ''
+      continue
+    endif
+
+    let context.complete_pos = complete_pos
+    let context.complete_str = complete_str
+    call add(complete_sources, source)
+  endfor
+  "}}}
+
+  return complete_sources
+endfunction"}}}
+function! neocomplete#complete#_set_results_words(sources) abort "{{{
+  " Try source completion.
+
+  " Save options.
+  let ignorecase_save = &ignorecase
+  let pos = winsaveview()
+
+  try
+    for source in a:sources
+      if neocomplete#complete_check()
+        return
+      endif
+
+      let context = source.neocomplete__context
+
+      let &ignorecase = (g:neocomplete#enable_smart_case
+            \ || g:neocomplete#enable_camel_case) ?
+            \   context.complete_str !~ '\u'
+            \ : g:neocomplete#enable_ignore_case
+
+      if s:use_previous_result(source, context)
+        " Use previous candidates.
+        let context.candidates = deepcopy(context.prev_candidates)
+      else
+        try
+          let winwidth = winwidth(0)
+          let type_string = type('')
+          let context.candidates = filter(source.gather_candidates(context),
+                \ 'len((type(v:val) == type_string) ?
+                \      v:val : v:val.word) < winwidth')
+        catch
+          call neocomplete#print_error(v:throwpoint)
+          call neocomplete#print_error(v:exception)
+          call neocomplete#print_error(
+                \ 'Source name is ' . source.name)
+          call neocomplete#print_error(
+                \ 'Error occurred in source''s gather_candidates()!')
+
+          return
+        finally
+          if winsaveview() != pos
+            call winrestview(pos)
+          endif
+        endtry
+
+        let context.prev_line = context.input
+        let context.prev_candidates = copy(context.candidates)
+        let context.prev_complete_pos = context.complete_pos
+      endif
+
+      if !empty(context.candidates)
+        let matchers = empty(source.neocomplete__matchers) ?
+              \   neocomplete#get_current_neocomplete().default_matchers
+              \ : source.neocomplete__matchers
+        let context.candidates = neocomplete#helper#call_filters(
+              \ matchers, source, {})
+      endif
+
+      call neocomplete#print_debug(source.name)
+    endfor
+  finally
+    let &ignorecase = ignorecase_save
+  endtry
+endfunction"}}}
+
+function! neocomplete#complete#_check_previous_position(cur_text, complete_pos) abort "{{{
+  let neocomplete = neocomplete#get_current_neocomplete()
+  return a:complete_pos == neocomplete.old_complete_pos
+        \ && line('.') == neocomplete.old_linenr
+        \ && a:cur_text ==# neocomplete.old_cur_text
+endfunction"}}}
+function! neocomplete#complete#_set_previous_position(cur_text, complete_pos) abort "{{{
+  let neocomplete = neocomplete#get_current_neocomplete()
+  let neocomplete.old_complete_pos = a:complete_pos
+  let neocomplete.old_linenr = line('.')
+  let neocomplete.old_cur_text = a:cur_text
+endfunction"}}}
+
+" Source rank order. "{{{
+function! s:compare_source_rank(i1, i2) abort
+  return a:i2.rank - a:i1.rank
+endfunction"}}}
+
+function! s:set_default_menu(words, source) abort "{{{
+  lua << EOF
+  do
+    local candidates = vim.eval('a:words')
+    local mark = vim.eval('a:source.mark') .. ' '
+    for i = 0, #candidates-1 do
+      candidates[i].menu = mark .. (candidates[i].menu ~= nil and
+                           candidates[i].menu or '')
+    end
+  end
+EOF
+endfunction"}}}
+
+function! s:use_previous_result(source, context) abort "{{{
+  let neocomplete = neocomplete#get_current_neocomplete()
+  return !a:source.is_volatile
+        \ && substitute(a:context.input, '\k\+$', '', '')
+        \    ==# substitute(a:context.prev_line, '\k\+$', '', '')
+        \ && stridx(a:context.input, a:context.prev_line) == 0
+        \ && !empty(a:context.prev_candidates)
+        \ && line('.') == neocomplete.old_linenr
+endfunction"}}}
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: foldmethod=marker

+ 67 - 0
autoload/neocomplete/context_filetype.vim

@@ -0,0 +1,67 @@
+"=============================================================================
+" FILE: context_filetype.vim
+" AUTHOR: Shougo Matsushita <Shougo.Matsu@gmail.com>
+" License: MIT license  {{{
+"     Permission is hereby granted, free of charge, to any person obtaining
+"     a copy of this software and associated documentation files (the
+"     "Software"), to deal in the Software without restriction, including
+"     without limitation the rights to use, copy, modify, merge, publish,
+"     distribute, sublicense, and/or sell copies of the Software, and to
+"     permit persons to whom the Software is furnished to do so, subject to
+"     the following conditions:
+"
+"     The above copyright notice and this permission notice shall be included
+"     in all copies or substantial portions of the Software.
+"
+"     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+"     OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+"     MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+"     IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+"     CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+"     TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+"     SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+" }}}
+"=============================================================================
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+" context_filetype.vim installation check.
+if !exists('s:exists_context_filetype')
+  silent! call context_filetype#version()
+  let s:exists_context_filetype = exists('*context_filetype#version')
+endif
+
+function! neocomplete#context_filetype#set() abort "{{{
+  let neocomplete = neocomplete#get_current_neocomplete()
+  let context_filetype =
+        \ s:exists_context_filetype ?
+        \ context_filetype#get_filetype() : &filetype
+  if context_filetype == ''
+    let context_filetype = 'nothing'
+  endif
+  let neocomplete.context_filetype = context_filetype
+  let neocomplete.context_filetypes = s:exists_context_filetype ?
+        \  context_filetype#get_filetypes(context_filetype) :
+        \  [context_filetype] + split(context_filetype, '\.')
+
+  return neocomplete.context_filetype
+endfunction"}}}
+function! neocomplete#context_filetype#get(filetype) abort "{{{
+  let context_filetype =
+        \ s:exists_context_filetype ?
+        \ context_filetype#get_filetype(a:filetype) : a:filetype
+  if context_filetype == ''
+    let context_filetype = 'nothing'
+  endif
+
+  return context_filetype
+endfunction"}}}
+function! neocomplete#context_filetype#filetypes() abort "{{{
+  return copy(neocomplete#get_current_neocomplete().context_filetypes)
+endfunction"}}}
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: foldmethod=marker

+ 54 - 0
autoload/neocomplete/custom.vim

@@ -0,0 +1,54 @@
+"=============================================================================
+" FILE: custom.vim
+" AUTHOR: Shougo Matsushita <Shougo.Matsu@gmail.com>
+" License: MIT license  {{{
+"     Permission is hereby granted, free of charge, to any person obtaining
+"     a copy of this software and associated documentation files (the
+"     "Software"), to deal in the Software without restriction, including
+"     without limitation the rights to use, copy, modify, merge, publish,
+"     distribute, sublicense, and/or sell copies of the Software, and to
+"     permit persons to whom the Software is furnished to do so, subject to
+"     the following conditions:
+"
+"     The above copyright notice and this permission notice shall be included
+"     in all copies or substantial portions of the Software.
+"
+"     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+"     OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+"     MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+"     IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+"     CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+"     TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+"     SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+" }}}
+"=============================================================================
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! neocomplete#custom#get() abort "{{{
+  if !exists('s:custom')
+    let s:custom = {}
+    let s:custom.sources = {}
+    let s:custom.sources._ = {}
+  endif
+
+  return s:custom
+endfunction"}}}
+
+function! neocomplete#custom#source(source_name, option_name, value) abort "{{{
+  let custom_sources = neocomplete#custom#get().sources
+
+  for key in split(a:source_name, '\s*,\s*')
+    if !has_key(custom_sources, key)
+      let custom_sources[key] = {}
+    endif
+
+    let custom_sources[key][a:option_name] = a:value
+  endfor
+endfunction"}}}
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: foldmethod=marker

+ 48 - 0
autoload/neocomplete/filters.vim

@@ -0,0 +1,48 @@
+"=============================================================================
+" FILE: filters.vim
+" AUTHOR: Shougo Matsushita <Shougo.Matsu@gmail.com>
+" License: MIT license  {{{
+"     Permission is hereby granted, free of charge, to any person obtaining
+"     a copy of this software and associated documentation files (the
+"     "Software"), to deal in the Software without restriction, including
+"     without limitation the rights to use, copy, modify, merge, publish,
+"     distribute, sublicense, and/or sell copies of the Software, and to
+"     permit persons to whom the Software is furnished to do so, subject to
+"     the following conditions:
+"
+"     The above copyright notice and this permission notice shall be included
+"     in all copies or substantial portions of the Software.
+"
+"     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+"     OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+"     MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+"     IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+"     CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+"     TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+"     SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+" }}}
+"=============================================================================
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! neocomplete#filters#fuzzy_escape(string) abort "{{{
+  " Escape string for lua regexp.
+  let string = substitute(neocomplete#filters#escape(a:string),
+        \ '\w', '\0.*', 'g')
+  if g:neocomplete#enable_camel_case && string =~ '\u'
+    let string = substitute(string, '\l', '[\0\u\0\E]', 'g')
+  endif
+  return string
+endfunction"}}}
+
+function! neocomplete#filters#escape(string) abort "{{{
+  " Escape string for lua regexp.
+  return substitute(a:string,
+        \ '[%\[\]().*+?^$-]', '%\0', 'g')
+endfunction"}}}
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: foldmethod=marker

+ 66 - 0
autoload/neocomplete/filters/converter_abbr.vim

@@ -0,0 +1,66 @@
+"=============================================================================
+" FILE: converter_abbr.vim
+" AUTHOR:  Shougo Matsushita <Shougo.Matsu@gmail.com>
+" License: MIT license  {{{
+"     Permission is hereby granted, free of charge, to any person obtaining
+"     a copy of this software and associated documentation files (the
+"     "Software"), to deal in the Software without restriction, including
+"     without limitation the rights to use, copy, modify, merge, publish,
+"     distribute, sublicense, and/or sell copies of the Software, and to
+"     permit persons to whom the Software is furnished to do so, subject to
+"     the following conditions:
+"
+"     The above copyright notice and this permission notice shall be included
+"     in all copies or substantial portions of the Software.
+"
+"     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+"     OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+"     MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+"     IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+"     CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+"     TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+"     SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+" }}}
+"=============================================================================
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! neocomplete#filters#converter_abbr#define() abort "{{{
+  return s:converter
+endfunction"}}}
+
+let s:converter = {
+      \ 'name' : 'converter_abbr',
+      \ 'description' : 'abbreviate abbr converter',
+      \}
+
+function! s:converter.filter(context) abort "{{{
+  if g:neocomplete#max_keyword_width < 0
+    return a:context.candidates
+  endif
+
+  lua << EOF
+do
+  local candidates = vim.eval('a:context.candidates')
+  local max = vim.eval('g:neocomplete#max_keyword_width')
+  for i = 0, #candidates-1 do
+    local abbr = candidates[i].abbr == nil and
+      candidates[i].word or candidates[i].abbr
+    if string.len(abbr) > max then
+      vim.command("let a:context.candidates[".. i .."].abbr = neocomplete#util#truncate_smart("..
+              "get(a:context.candidates[".. i .."], 'abbr', " ..
+              "a:context.candidates[".. i .."].word), g:neocomplete#max_keyword_width," ..
+              "g:neocomplete#max_keyword_width/2, '..')")
+    end
+  end
+end
+EOF
+
+  return a:context.candidates
+endfunction"}}}
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: foldmethod=marker

+ 53 - 0
autoload/neocomplete/filters/converter_add_paren.vim

@@ -0,0 +1,53 @@
+"=============================================================================
+" FILE: converter_add_paren.vim
+" AUTHOR:  Shougo Matsushita <Shougo.Matsu@gmail.com>
+" License: MIT license  {{{
+"     Permission is hereby granted, free of charge, to any person obtaining
+"     a copy of this software and associated documentation files (the
+"     "Software"), to deal in the Software without restriction, including
+"     without limitation the rights to use, copy, modify, merge, publish,
+"     distribute, sublicense, and/or sell copies of the Software, and to
+"     permit persons to whom the Software is furnished to do so, subject to
+"     the following conditions:
+"
+"     The above copyright notice and this permission notice shall be included
+"     in all copies or substantial portions of the Software.
+"
+"     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+"     OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+"     MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+"     IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+"     CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+"     TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+"     SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+" }}}
+"=============================================================================
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! neocomplete#filters#converter_add_paren#define() abort "{{{
+  return s:converter
+endfunction"}}}
+
+let s:converter = {
+      \ 'name' : 'converter_add_paren',
+      \ 'description' : 'add parenthesis if needed',
+      \}
+
+function! s:converter.filter(context) abort "{{{
+  for candidate in filter(copy(a:context.candidates), "
+        \ v:val.word !~ '()\\?$' &&
+        \   (get(v:val, 'abbr', '') =~ '(.*)'
+        \ || get(v:val, 'info', '') =~ '(.*)')
+        \ ")
+    let candidate.word .= '('
+  endfor
+
+  return a:context.candidates
+endfunction"}}}
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: foldmethod=marker

+ 80 - 0
autoload/neocomplete/filters/converter_case.vim

@@ -0,0 +1,80 @@
+"=============================================================================
+" FILE: converter_case.vim
+" AUTHOR:  Shougo Matsushita <Shougo.Matsu@gmail.com>
+" License: MIT license  {{{
+"     Permission is hereby granted, free of charge, to any person obtaining
+"     a copy of this software and associated documentation files (the
+"     "Software"), to deal in the Software without restriction, including
+"     without limitation the rights to use, copy, modify, merge, publish,
+"     distribute, sublicense, and/or sell copies of the Software, and to
+"     permit persons to whom the Software is furnished to do so, subject to
+"     the following conditions:
+"
+"     The above copyright notice and this permission notice shall be included
+"     in all copies or substantial portions of the Software.
+"
+"     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+"     OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+"     MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+"     IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+"     CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+"     TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+"     SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+" }}}
+"=============================================================================
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! neocomplete#filters#converter_case#define() abort "{{{
+  return s:converter
+endfunction"}}}
+
+let s:converter = {
+      \ 'name' : 'converter_case',
+      \ 'description' : 'case converter',
+      \}
+
+function! s:converter.filter(context) abort "{{{
+  if !neocomplete#is_text_mode() && !neocomplete#within_comment()
+    return a:context.candidates
+  endif
+
+  if a:context.complete_str =~ '^\l\{3}$'
+    for candidate in s:get_convert_candidates(a:context.candidates)
+      let candidate.word = tolower(candidate.word)
+      if has_key(candidate, 'abbr')
+        let candidate.abbr = tolower(candidate.abbr)
+      endif
+    endfor
+  elseif a:context.complete_str =~ '^\u\{3}$'
+    for candidate in s:get_convert_candidates(a:context.candidates)
+      let candidate.word = toupper(candidate.word)
+      if has_key(candidate, 'abbr')
+        let candidate.abbr = toupper(candidate.abbr)
+      endif
+    endfor
+  elseif a:context.complete_str =~ '^\u\l\+$'
+    for candidate in s:get_convert_candidates(a:context.candidates)
+      let candidate.word = toupper(candidate.word[0]).
+            \ candidate.word[1:]
+      if has_key(candidate, 'abbr')
+        let candidate.abbr = toupper(candidate.abbr[0]).
+              \ tolower(candidate.abbr[1:])
+      endif
+    endfor
+  endif
+
+  return a:context.candidates
+endfunction"}}}
+
+function! s:get_convert_candidates(candidates) abort
+  return filter(copy(a:candidates),
+        \ "get(v:val, 'neocomplete__convertable', 1)
+        \  && v:val.word =~ '^[a-zA-Z0-9_''-]\\+$'")
+endfunction
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: foldmethod=marker

+ 114 - 0
autoload/neocomplete/filters/converter_delimiter.vim

@@ -0,0 +1,114 @@
+"=============================================================================
+" FILE: converter_delimiter.vim
+" AUTHOR:  Shougo Matsushita <Shougo.Matsu@gmail.com>
+" License: MIT license  {{{
+"     Permission is hereby granted, free of charge, to any person obtaining
+"     a copy of this software and associated documentation files (the
+"     "Software"), to deal in the Software without restriction, including
+"     without limitation the rights to use, copy, modify, merge, publish,
+"     distribute, sublicense, and/or sell copies of the Software, and to
+"     permit persons to whom the Software is furnished to do so, subject to
+"     the following conditions:
+"
+"     The above copyright notice and this permission notice shall be included
+"     in all copies or substantial portions of the Software.
+"
+"     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+"     OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+"     MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+"     IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+"     CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+"     TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+"     SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+" }}}
+"=============================================================================
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! neocomplete#filters#converter_delimiter#define() abort "{{{
+  return s:converter
+endfunction"}}}
+
+let s:converter = {
+      \ 'name' : 'converter_delimiter',
+      \ 'description' : 'delimiter converter',
+      \}
+
+" @vimlint(EVL102, 1, l:delim_cnt)
+function! s:converter.filter(context) abort "{{{
+  if g:neocomplete#max_keyword_width < 0
+    return a:context.candidates
+  endif
+
+  " Delimiter check.
+  for delimiter in get(g:neocomplete#delimiter_patterns,
+        \ a:context.filetype, [])
+    " Count match.
+    let delim_cnt = 0
+    let delimiter_vim = neocomplete#util#escape_pattern(delimiter)
+    let matchend = matchend(a:context.complete_str, delimiter_vim)
+    while matchend >= 0
+      let matchend = matchend(a:context.complete_str,
+            \ delimiter_vim, matchend)
+      let delim_cnt += 1
+    endwhile
+
+    lua << EOF
+    do
+      local candidates = vim.eval('a:context.candidates')
+      local pattern = vim.eval('neocomplete#filters#escape(delimiter)')..'.'
+      for i = 0, #candidates-1 do
+        if string.find(candidates[i].word, pattern, 1) ~= nil and (
+            not candidates[i].abbr or
+            string.gsub(candidates[i].word, '%([^)]*%)?', '()')
+              == string.gsub(candidates[i].abbr, '%([^)]*%)?', '()')) then
+          vim.command('call s:process_delimiter(a:context, '..
+            'a:context.candidates['.. i ..
+            '], delimiter_vim, delim_cnt)')
+        end
+      end
+    end
+EOF
+  endfor
+
+  return a:context.candidates
+endfunction"}}}
+" @vimlint(EVL102, 0, l:delim_cnt)
+
+function! s:process_delimiter(context, candidate, delimiter, delim_cnt) abort
+  let candidate = a:candidate
+
+  let split_list = split(candidate.word, a:delimiter.'\ze.', 1)
+  let delimiter_sub = substitute(
+        \ a:delimiter, '\\\(.\)', '\1', 'g')
+  let candidate.abbr = join(
+        \ split(get(candidate, 'abbr', candidate.word),
+        \             a:delimiter.'\ze.', 1)[ : a:delim_cnt],
+        \ delimiter_sub)
+  let candidate.word = join(split_list[ : a:delim_cnt], delimiter_sub)
+
+  if g:neocomplete#max_keyword_width >= 0
+        \ && len(candidate.abbr) > g:neocomplete#max_keyword_width
+    let candidate.abbr = substitute(candidate.abbr,
+          \ '\(\h\)\w*'.a:delimiter, '\1'.delimiter_sub, 'g')
+  endif
+  if a:delim_cnt+1 < len(split_list)
+    let candidate.abbr .= delimiter_sub . '~'
+    let candidate.dup = 0
+
+    if g:neocomplete#enable_auto_delimiter
+      let candidate.word .= delimiter_sub
+    endif
+  endif
+
+  " Clear previous result.
+  let a:context.prev_candidates = []
+  let a:context.prev_complete_pos = -1
+  let a:context.prev_line = ''
+endfunction
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: foldmethod=marker

+ 49 - 0
autoload/neocomplete/filters/converter_disable_abbr.vim

@@ -0,0 +1,49 @@
+"=============================================================================
+" FILE: converter_disable_abbr.vim
+" AUTHOR:  Shougo Matsushita <Shougo.Matsu@gmail.com>
+" License: MIT license  {{{
+"     Permission is hereby granted, free of charge, to any person obtaining
+"     a copy of this software and associated documentation files (the
+"     "Software"), to deal in the Software without restriction, including
+"     without limitation the rights to use, copy, modify, merge, publish,
+"     distribute, sublicense, and/or sell copies of the Software, and to
+"     permit persons to whom the Software is furnished to do so, subject to
+"     the following conditions:
+"
+"     The above copyright notice and this permission notice shall be included
+"     in all copies or substantial portions of the Software.
+"
+"     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+"     OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+"     MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+"     IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+"     CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+"     TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+"     SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+" }}}
+"=============================================================================
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! neocomplete#filters#converter_disable_abbr#define() abort "{{{
+  return s:converter
+endfunction"}}}
+
+let s:converter = {
+      \ 'name' : 'converter_disable_abbr',
+      \ 'description' : 'disable abbr converter',
+      \}
+
+function! s:converter.filter(context) abort "{{{
+  for candidate in a:context.candidates
+    let candidate.abbr = candidate.word
+  endfor
+
+  return a:context.candidates
+endfunction"}}}
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: foldmethod=marker

+ 50 - 0
autoload/neocomplete/filters/converter_remove_last_paren.vim

@@ -0,0 +1,50 @@
+"=============================================================================
+" FILE: converter_remove_last_paren.vim
+" AUTHOR:  Shougo Matsushita <Shougo.Matsu@gmail.com>
+" License: MIT license  {{{
+"     Permission is hereby granted, free of charge, to any person obtaining
+"     a copy of this software and associated documentation files (the
+"     "Software"), to deal in the Software without restriction, including
+"     without limitation the rights to use, copy, modify, merge, publish,
+"     distribute, sublicense, and/or sell copies of the Software, and to
+"     permit persons to whom the Software is furnished to do so, subject to
+"     the following conditions:
+"
+"     The above copyright notice and this permission notice shall be included
+"     in all copies or substantial portions of the Software.
+"
+"     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+"     OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+"     MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+"     IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+"     CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+"     TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+"     SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+" }}}
+"=============================================================================
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! neocomplete#filters#converter_remove_last_paren#define() abort "{{{
+  return s:converter
+endfunction"}}}
+
+let s:converter = {
+      \ 'name' : 'converter_remove_last_paren',
+      \ 'description' : 'remove last parenthesis',
+      \}
+
+function! s:converter.filter(context) abort "{{{
+  for candidate in a:context.candidates
+    let candidate.word =
+          \ substitute(candidate.word, '[\[<({]$', '', '')
+  endfor
+
+  return a:context.candidates
+endfunction"}}}
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: foldmethod=marker

+ 122 - 0
autoload/neocomplete/filters/converter_remove_overlap.vim

@@ -0,0 +1,122 @@
+"=============================================================================
+" FILE: converter_overlap.vim
+" AUTHOR:  Shougo Matsushita <Shougo.Matsu@gmail.com>
+" License: MIT license  {{{
+"     Permission is hereby granted, free of charge, to any person obtaining
+"     a copy of this software and associated documentation files (the
+"     "Software"), to deal in the Software without restriction, including
+"     without limitation the rights to use, copy, modify, merge, publish,
+"     distribute, sublicense, and/or sell copies of the Software, and to
+"     permit persons to whom the Software is furnished to do so, subject to
+"     the following conditions:
+"
+"     The above copyright notice and this permission notice shall be included
+"     in all copies or substantial portions of the Software.
+"
+"     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+"     OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+"     MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+"     IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+"     CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+"     TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+"     SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+" }}}
+"=============================================================================
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! neocomplete#filters#converter_remove_overlap#define() abort "{{{
+  return s:converter
+endfunction"}}}
+
+let s:converter = {
+      \ 'name' : 'converter_remove_overlap',
+      \ 'description' : 'remove overlapped characters',
+      \}
+
+function! s:converter.filter(context) abort "{{{
+  let next = matchstr(getline('.')[
+        \ len(neocomplete#helper#get_cur_text()) :], '^\S\+')
+  if next == ''
+    return a:context.candidates
+  endif
+
+  let candidates = []
+  for candidate in a:context.candidates
+    let overlapped_len = neocomplete#filters#
+          \converter_remove_overlap#length(candidate.word, next)
+
+    if overlapped_len > 0
+      if !has_key(candidate, 'abbr')
+        let candidate.abbr = candidate.word
+      endif
+
+      let candidate.word = candidate.word[: -overlapped_len-1]
+      call add(candidates, candidate)
+    elseif !neocomplete#is_auto_complete()
+      call add(candidates, candidate)
+    endif
+  endfor
+
+  if empty(candidates)
+    return a:context.candidates
+  endif
+
+  let candidates = filter(candidates,
+        \ 'v:val.word !=# a:context.complete_str')
+
+  return candidates
+endfunction"}}}
+
+function! neocomplete#filters#converter_remove_overlap#length(left, right) abort "{{{
+  if a:left == '' || a:right == ''
+    return 0
+  endif
+
+  let ret = 0
+
+  lua << EOF
+do
+  local ret = vim.eval('ret')
+  local left = vim.eval('a:left')
+  local right = vim.eval('a:right')
+  local left_len = string.len(left)
+  local right_len = string.len(right)
+
+  if left_len > right_len then
+    left = string.sub(left, left_len-right_len, left_len)
+  elseif left_len < right_len then
+    right = string.sub(right, 0, left_len)
+  end
+
+  if left == right then
+    ret = math.min(left_len, right_len)
+  else
+    local length = 1
+    left_len = string.len(left)
+    while 1 do
+      local pattern = string.sub(left, left_len-length+1, left_len)
+      local pos = string.find(right, pattern, 1, 1)
+      if pos == nil then
+        break
+      end
+      length = length + pos - 1
+      if string.sub(left, left_len-length+1, left_len) ==
+        string.sub(right, 1, length) then
+        ret = length
+        length = length + 1
+      end
+    end
+  end
+  vim.command('let ret = ' .. ret)
+end
+EOF
+
+  return ret
+endfunction"}}}
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: foldmethod=marker

+ 89 - 0
autoload/neocomplete/filters/matcher_fuzzy.vim

@@ -0,0 +1,89 @@
+"=============================================================================
+" FILE: matcher_fuzzy.vim
+" AUTHOR:  Shougo Matsushita <Shougo.Matsu@gmail.com>
+" License: MIT license  {{{
+"     Permission is hereby granted, free of charge, to any person obtaining
+"     a copy of this software and associated documentation files (the
+"     "Software"), to deal in the Software without restriction, including
+"     without limitation the rights to use, copy, modify, merge, publish,
+"     distribute, sublicense, and/or sell copies of the Software, and to
+"     permit persons to whom the Software is furnished to do so, subject to
+"     the following conditions:
+"
+"     The above copyright notice and this permission notice shall be included
+"     in all copies or substantial portions of the Software.
+"
+"     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+"     OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+"     MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+"     IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+"     CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+"     TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+"     SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+" }}}
+"=============================================================================
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! neocomplete#filters#matcher_fuzzy#define() abort "{{{
+  return s:matcher
+endfunction"}}}
+
+let s:matcher = {
+      \ 'name' : 'matcher_fuzzy',
+      \ 'description' : 'fuzzy matcher',
+      \}
+
+function! s:matcher.filter(context) abort "{{{
+  if len(a:context.complete_str) > 10
+    " Mix fuzzy mode.
+    let len = len(a:context.complete_str)
+    let fuzzy_len = len - len/(1 + len/10)
+    let pattern =
+          \ neocomplete#filters#escape(
+          \     a:context.complete_str[: fuzzy_len-1])  .
+          \ neocomplete#filters#fuzzy_escape(
+          \     a:context.complete_str[fuzzy_len :])
+  else
+    let pattern = neocomplete#filters#fuzzy_escape(
+          \ a:context.complete_str)
+  endif
+
+  " The first letter must be matched.
+  let pattern = '^' . pattern
+
+  lua << EOF
+do
+  local pattern = vim.eval('pattern')
+  local input = vim.eval('a:context.complete_str')
+  local candidates = vim.eval('a:context.candidates')
+  if vim.eval('&ignorecase') ~= 0 then
+    pattern = string.lower(pattern)
+    input = string.lower(input)
+    for i = #candidates-1, 0, -1 do
+      local word = vim.type(candidates[i]) == 'dict' and
+        string.lower(candidates[i].word) or string.lower(candidates[i])
+      if string.find(word, pattern, 1) == nil then
+        candidates[i] = nil
+      end
+    end
+  else
+    for i = #candidates-1, 0, -1 do
+      local word = vim.type(candidates[i]) == 'dict' and
+        candidates[i].word or candidates[i]
+      if string.find(word, pattern, 1) == nil then
+        candidates[i] = nil
+      end
+    end
+  end
+end
+EOF
+
+  return a:context.candidates
+endfunction"}}}
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: foldmethod=marker

+ 72 - 0
autoload/neocomplete/filters/matcher_head.vim

@@ -0,0 +1,72 @@
+"=============================================================================
+" FILE: matcher_head.vim
+" AUTHOR:  Shougo Matsushita <Shougo.Matsu@gmail.com>
+" License: MIT license  {{{
+"     Permission is hereby granted, free of charge, to any person obtaining
+"     a copy of this software and associated documentation files (the
+"     "Software"), to deal in the Software without restriction, including
+"     without limitation the rights to use, copy, modify, merge, publish,
+"     distribute, sublicense, and/or sell copies of the Software, and to
+"     permit persons to whom the Software is furnished to do so, subject to
+"     the following conditions:
+"
+"     The above copyright notice and this permission notice shall be included
+"     in all copies or substantial portions of the Software.
+"
+"     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+"     OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+"     MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+"     IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+"     CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+"     TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+"     SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+" }}}
+"=============================================================================
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! neocomplete#filters#matcher_head#define() abort "{{{
+  return s:matcher
+endfunction"}}}
+
+let s:matcher = {
+      \ 'name' : 'matcher_head',
+      \ 'description' : 'head matcher',
+      \}
+
+function! s:matcher.filter(context) abort "{{{
+  lua << EOF
+do
+  local pattern = vim.eval(
+      "'^' . neocomplete#filters#escape(a:context.complete_str)")
+  local input = vim.eval('a:context.complete_str')
+  local candidates = vim.eval('a:context.candidates')
+  if vim.eval('&ignorecase') ~= 0 then
+    pattern = string.lower(pattern)
+    for i = #candidates-1, 0, -1 do
+      local word = vim.type(candidates[i]) == 'dict' and
+      string.lower(candidates[i].word) or string.lower(candidates[i])
+      if string.find(word, pattern, 1) == nil then
+        candidates[i] = nil
+      end
+    end
+  else
+    for i = #candidates-1, 0, -1 do
+      local word = vim.type(candidates[i]) == 'dict' and
+      candidates[i].word or candidates[i]
+      if string.find(word, pattern, 1) == nil then
+        candidates[i] = nil
+      end
+    end
+  end
+end
+EOF
+
+  return a:context.candidates
+endfunction"}}}
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: foldmethod=marker

+ 63 - 0
autoload/neocomplete/filters/matcher_length.vim

@@ -0,0 +1,63 @@
+"=============================================================================
+" FILE: matcher_length.vim
+" AUTHOR:  Shougo Matsushita <Shougo.Matsu@gmail.com>
+" License: MIT license  {{{
+"     Permission is hereby granted, free of charge, to any person obtaining
+"     a copy of this software and associated documentation files (the
+"     "Software"), to deal in the Software without restriction, including
+"     without limitation the rights to use, copy, modify, merge, publish,
+"     distribute, sublicense, and/or sell copies of the Software, and to
+"     permit persons to whom the Software is furnished to do so, subject to
+"     the following conditions:
+"
+"     The above copyright notice and this permission notice shall be included
+"     in all copies or substantial portions of the Software.
+"
+"     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+"     OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+"     MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+"     IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+"     CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+"     TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+"     SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+" }}}
+"=============================================================================
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! neocomplete#filters#matcher_length#define() abort "{{{
+  return s:matcher
+endfunction"}}}
+
+let s:matcher = {
+      \ 'name' : 'matcher_length',
+      \ 'description' : 'input length matcher',
+      \}
+
+function! s:matcher.filter(context) abort "{{{
+  if empty(a:context.candidates)
+    return []
+  endif
+
+  lua << EOF
+do
+  local candidates = vim.eval('a:context.candidates')
+  local len = string.len(vim.eval('a:context.complete_str'))
+  for i = #candidates-1, 0, -1 do
+    local word = vim.type(candidates[i]) == 'dict' and
+    candidates[i].word or candidates[i]
+    if string.len(word) <= len then
+      candidates[i] = nil
+    end
+  end
+end
+EOF
+
+  return a:context.candidates
+endfunction"}}}
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: foldmethod=marker

+ 45 - 0
autoload/neocomplete/filters/matcher_nothing.vim

@@ -0,0 +1,45 @@
+"=============================================================================
+" FILE: matcher_nothing.vim
+" AUTHOR:  Shougo Matsushita <Shougo.Matsu@gmail.com>
+" License: MIT license  {{{
+"     Permission is hereby granted, free of charge, to any person obtaining
+"     a copy of this software and associated documentation files (the
+"     "Software"), to deal in the Software without restriction, including
+"     without limitation the rights to use, copy, modify, merge, publish,
+"     distribute, sublicense, and/or sell copies of the Software, and to
+"     permit persons to whom the Software is furnished to do so, subject to
+"     the following conditions:
+"
+"     The above copyright notice and this permission notice shall be included
+"     in all copies or substantial portions of the Software.
+"
+"     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+"     OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+"     MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+"     IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+"     CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+"     TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+"     SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+" }}}
+"=============================================================================
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! neocomplete#filters#matcher_nothing#define() abort "{{{
+  return s:matcher
+endfunction"}}}
+
+let s:matcher = {
+      \ 'name' : 'matcher_nothing',
+      \ 'description' : 'input nothing matcher',
+      \}
+
+function! s:matcher.filter(context) abort "{{{
+  return a:context.candidates
+endfunction"}}}
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: foldmethod=marker

+ 50 - 0
autoload/neocomplete/filters/sorter_filename.vim

@@ -0,0 +1,50 @@
+"=============================================================================
+" FILE: sorter_filename.vim
+" AUTHOR:  Shougo Matsushita <Shougo.Matsu@gmail.com>
+" License: MIT license  {{{
+"     Permission is hereby granted, free of charge, to any person obtaining
+"     a copy of this software and associated documentation files (the
+"     "Software"), to deal in the Software without restriction, including
+"     without limitation the rights to use, copy, modify, merge, publish,
+"     distribute, sublicense, and/or sell copies of the Software, and to
+"     permit persons to whom the Software is furnished to do so, subject to
+"     the following conditions:
+"
+"     The above copyright notice and this permission notice shall be included
+"     in all copies or substantial portions of the Software.
+"
+"     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+"     OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+"     MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+"     IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+"     CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+"     TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+"     SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+" }}}
+"=============================================================================
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! neocomplete#filters#sorter_filename#define() abort "{{{
+  return s:sorter
+endfunction"}}}
+
+let s:sorter = {
+      \ 'name' : 'sorter_filename',
+      \ 'description' : 'sort by filename order',
+      \}
+
+function! s:sorter.filter(context) abort "{{{
+  let dir_list = filter(copy(a:context.candidates),
+        \ 'v:val.action__is_directory')
+  let file_list = filter(copy(a:context.candidates),
+        \ '!v:val.action__is_directory')
+  return neocomplete#helper#sort_human(dir_list)
+        \ + neocomplete#helper#sort_human(file_list)
+endfunction"}}}
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: foldmethod=marker

+ 53 - 0
autoload/neocomplete/filters/sorter_length.vim

@@ -0,0 +1,53 @@
+"=============================================================================
+" FILE: sorter_length.vim
+" AUTHOR:  Shougo Matsushita <Shougo.Matsu@gmail.com>
+" License: MIT license  {{{
+"     Permission is hereby granted, free of charge, to any person obtaining
+"     a copy of this software and associated documentation files (the
+"     "Software"), to deal in the Software without restriction, including
+"     without limitation the rights to use, copy, modify, merge, publish,
+"     distribute, sublicense, and/or sell copies of the Software, and to
+"     permit persons to whom the Software is furnished to do so, subject to
+"     the following conditions:
+"
+"     The above copyright notice and this permission notice shall be included
+"     in all copies or substantial portions of the Software.
+"
+"     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+"     OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+"     MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+"     IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+"     CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+"     TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+"     SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+" }}}
+"=============================================================================
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! neocomplete#filters#sorter_length#define() abort "{{{
+  return s:sorter
+endfunction"}}}
+
+let s:sorter = {
+      \ 'name' : 'sorter_length',
+      \ 'description' : 'sort by length order',
+      \}
+
+function! s:sorter.filter(context) abort "{{{
+  return sort(a:context.candidates, 's:compare')
+endfunction"}}}
+
+function! s:compare(i1, i2) abort
+  let diff = len(a:i1.word) - len(a:i2.word)
+  if !diff
+    let diff = (a:i1.word ># a:i2.word) ? 1 : -1
+  endif
+  return diff
+endfunction
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: foldmethod=marker

+ 74 - 0
autoload/neocomplete/filters/sorter_rank.vim

@@ -0,0 +1,74 @@
+"=============================================================================
+" FILE: sorter_rank.vim
+" AUTHOR:  Shougo Matsushita <Shougo.Matsu@gmail.com>
+" License: MIT license  {{{
+"     Permission is hereby granted, free of charge, to any person obtaining
+"     a copy of this software and associated documentation files (the
+"     "Software"), to deal in the Software without restriction, including
+"     without limitation the rights to use, copy, modify, merge, publish,
+"     distribute, sublicense, and/or sell copies of the Software, and to
+"     permit persons to whom the Software is furnished to do so, subject to
+"     the following conditions:
+"
+"     The above copyright notice and this permission notice shall be included
+"     in all copies or substantial portions of the Software.
+"
+"     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+"     OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+"     MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+"     IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+"     CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+"     TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+"     SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+" }}}
+"=============================================================================
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! neocomplete#filters#sorter_rank#define() abort "{{{
+  return s:sorter
+endfunction"}}}
+
+let s:sorter = {
+      \ 'name' : 'sorter_rank',
+      \ 'description' : 'sort by matched rank order',
+      \}
+
+function! s:sorter.filter(context) abort "{{{
+  lua << EOF
+do
+  local candidates = vim.eval('a:context.candidates')
+  local t = {}
+  local input = string.lower(vim.eval('a:context.input'))
+  for i = 1, #candidates do
+    t[i] = candidates[i-1]
+    local ti = t[i]
+
+    -- Match position.
+    ti.neocomplete__match = select(1, string.find(
+        string.lower(ti.word), input, 1, true))
+    if ti.neocomplete__match == nil then
+      ti.neocomplete__match = string.len(ti.word)
+    end
+
+    if ti.rank == nil then
+      ti.rank = 0
+    end
+  end
+  table.sort(t, function(a, b)
+        return (a.rank == b.rank) and (a.neocomplete__match
+            < b.neocomplete__match) or (a.rank > b.rank)
+      end)
+  for i = 0, #candidates-1 do
+    candidates[i] = t[i+1]
+  end
+end
+EOF
+  return a:context.candidates
+endfunction"}}}
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: foldmethod=marker

+ 49 - 0
autoload/neocomplete/filters/sorter_word.vim

@@ -0,0 +1,49 @@
+"=============================================================================
+" FILE: sorter_word.vim
+" AUTHOR:  Shougo Matsushita <Shougo.Matsu@gmail.com>
+" License: MIT license  {{{
+"     Permission is hereby granted, free of charge, to any person obtaining
+"     a copy of this software and associated documentation files (the
+"     "Software"), to deal in the Software without restriction, including
+"     without limitation the rights to use, copy, modify, merge, publish,
+"     distribute, sublicense, and/or sell copies of the Software, and to
+"     permit persons to whom the Software is furnished to do so, subject to
+"     the following conditions:
+"
+"     The above copyright notice and this permission notice shall be included
+"     in all copies or substantial portions of the Software.
+"
+"     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+"     OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+"     MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+"     IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+"     CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+"     TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+"     SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+" }}}
+"=============================================================================
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! neocomplete#filters#sorter_word#define() abort "{{{
+  return s:sorter
+endfunction"}}}
+
+let s:sorter = {
+      \ 'name' : 'sorter_word',
+      \ 'description' : 'sort by word order',
+      \}
+
+function! s:sorter.filter(context) abort "{{{
+  return sort(a:context.candidates, 's:compare')
+endfunction"}}}
+
+function! s:compare(i1, i2) abort
+  return a:i1.word ># a:i2.word
+endfunction
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: foldmethod=marker

+ 351 - 0
autoload/neocomplete/handler.vim

@@ -0,0 +1,351 @@
+"=============================================================================
+" FILE: handler.vim
+" AUTHOR: Shougo Matsushita <Shougo.Matsu@gmail.com>
+" License: MIT license  {{{
+"     Permission is hereby granted, free of charge, to any person obtaining
+"     a copy of this software and associated documentation files (the
+"     "Software"), to deal in the Software without restriction, including
+"     without limitation the rights to use, copy, modify, merge, publish,
+"     distribute, sublicense, and/or sell copies of the Software, and to
+"     permit persons to whom the Software is furnished to do so, subject to
+"     the following conditions:
+"
+"     The above copyright notice and this permission notice shall be included
+"     in all copies or substantial portions of the Software.
+"
+"     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+"     OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+"     MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+"     IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+"     CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+"     TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+"     SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+" }}}
+"=============================================================================
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! neocomplete#handler#_on_moved_i() abort "{{{
+  let neocomplete = neocomplete#get_current_neocomplete()
+  if neocomplete.linenr != line('.')
+    call neocomplete#helper#clear_result()
+  endif
+  let neocomplete.linenr = line('.')
+
+  call s:close_preview_window()
+endfunction"}}}
+function! neocomplete#handler#_on_insert_enter() abort "{{{
+  if !neocomplete#is_enabled()
+    return
+  endif
+
+  let neocomplete = neocomplete#get_current_neocomplete()
+  if neocomplete.linenr != line('.')
+    call neocomplete#helper#clear_result()
+  endif
+  let neocomplete.linenr = line('.')
+
+  if &l:foldmethod ==# 'expr' && foldlevel('.') != 0
+    foldopen
+  endif
+endfunction"}}}
+function! neocomplete#handler#_on_insert_leave() abort "{{{
+  call neocomplete#helper#clear_result()
+
+  call s:close_preview_window()
+  call s:make_cache_current_line()
+
+  let neocomplete = neocomplete#get_current_neocomplete()
+  let neocomplete.cur_text = ''
+endfunction"}}}
+function! neocomplete#handler#_on_complete_done() abort "{{{
+  let neocomplete = neocomplete#get_current_neocomplete()
+
+  if neocomplete.event !=# 'mapping'
+        \ && !s:is_delimiter() && !get(neocomplete, 'refresh', 0)
+    call neocomplete#mappings#close_popup()
+  endif
+
+  " Use v:completed_item feature.
+  if !exists('v:completed_item') || empty(v:completed_item)
+    return
+  endif
+
+  let complete_str = v:completed_item.word
+  if complete_str == ''
+    return
+  endif
+
+  let frequencies = neocomplete#variables#get_frequencies()
+  if !has_key(frequencies, complete_str)
+    let frequencies[complete_str] = 20
+  else
+    let frequencies[complete_str] += 20
+  endif
+endfunction"}}}
+function! neocomplete#handler#_on_insert_char_pre() abort "{{{
+  let neocomplete = neocomplete#get_current_neocomplete()
+  let neocomplete.skip_next_complete = 0
+
+  if pumvisible() && g:neocomplete#enable_refresh_always
+    " Auto refresh
+    call feedkeys("\<Plug>(neocomplete_auto_refresh)")
+  endif
+
+  if neocomplete#is_cache_disabled()
+    return
+  endif
+
+  let neocomplete.old_char = v:char
+endfunction"}}}
+function! neocomplete#handler#_on_text_changed() abort "{{{
+  if neocomplete#is_cache_disabled()
+    return
+  endif
+
+  if getline('.') == ''
+    call s:make_cache_current_line()
+  endif
+
+  if !neocomplete#util#is_text_changed()
+    call s:indent_current_line()
+  endif
+endfunction"}}}
+
+function! s:complete_delay(timer) abort "{{{
+  let event = s:timer.event
+  unlet! s:timer
+
+  if mode() ==# 'i'
+    call s:do_auto_complete(event)
+  endif
+endfunction"}}}
+
+function! neocomplete#handler#_do_auto_complete(event) abort "{{{
+  if s:check_in_do_auto_complete(a:event)
+    return
+  endif
+
+  if g:neocomplete#auto_complete_delay > 0 && has('timers')
+        \ && (!has('gui_macvim') || has('patch-8.0.95'))
+    if exists('s:timer')
+      call timer_stop(s:timer.id)
+    endif
+    if a:event !=# 'Manual'
+      let s:timer = { 'event': a:event }
+      let s:timer.id = timer_start(
+            \ g:neocomplete#auto_complete_delay,
+            \ function('s:complete_delay'))
+      return
+    endif
+  endif
+
+  return s:do_auto_complete(a:event)
+endfunction"}}}
+
+function! s:do_auto_complete(event) abort "{{{
+  let neocomplete = neocomplete#get_current_neocomplete()
+
+  if s:check_in_do_auto_complete(a:event)
+    return
+  endif
+
+  let neocomplete.skipped = 0
+  let neocomplete.event = a:event
+  call neocomplete#helper#clear_result()
+
+  " Set context filetype.
+  call neocomplete#context_filetype#set()
+
+  let cur_text = neocomplete#get_cur_text(1)
+  let complete_pos = -1
+
+  call neocomplete#print_debug('cur_text = ' . cur_text)
+
+  try
+    " Prevent infinity loop.
+    if s:is_skip_auto_complete(cur_text)
+      call neocomplete#print_debug('Skipped.')
+      return
+    endif
+
+    let complete_pos = s:check_force_omni(cur_text)
+    if complete_pos >= 0
+      return
+    endif
+
+    " Check multibyte input or eskk or spaces.
+    if cur_text =~ '^\s*$'
+          \ || (!neocomplete#is_eskk_enabled()
+          \     && neocomplete#is_multibyte_input(cur_text))
+      call neocomplete#print_debug('Skipped.')
+      return
+    endif
+
+    try
+      let neocomplete.is_auto_complete = 1
+
+      " Do prefetch.
+      let neocomplete.complete_sources =
+            \ neocomplete#complete#_get_results(cur_text)
+    finally
+      let neocomplete.is_auto_complete = 0
+    endtry
+
+    if empty(neocomplete.complete_sources)
+      call s:check_fallback(cur_text)
+      return
+    endif
+
+    " Start auto complete.
+    call s:complete_key(
+          \ "\<Plug>(neocomplete_start_auto_complete)")
+  finally
+    call neocomplete#complete#_set_previous_position(cur_text, complete_pos)
+  endtry
+endfunction"}}}
+
+function! s:check_in_do_auto_complete(event) abort "{{{
+  if neocomplete#is_locked()
+        \ || (a:event !=# 'InsertEnter' && mode() !=# 'i')
+    return 1
+  endif
+
+  " Detect completefunc.
+  if &l:completefunc != '' && &l:buftype =~ 'nofile'
+    return 1
+  endif
+endfunction"}}}
+function! s:is_skip_auto_complete(cur_text) abort "{{{
+  let neocomplete = neocomplete#get_current_neocomplete()
+
+  if (g:neocomplete#lock_iminsert && &l:iminsert)
+        \ || (&l:formatoptions =~# '[tca]' && &l:textwidth > 0
+        \     && strdisplaywidth(a:cur_text) >= &l:textwidth)
+    let neocomplete.skip_next_complete = 0
+    return 1
+  endif
+
+  let skip = neocomplete.skip_next_complete
+
+  if !skip || s:is_delimiter()
+    return 0
+  endif
+
+  let neocomplete.skip_next_complete = 0
+  return skip
+endfunction"}}}
+function! s:close_preview_window() abort "{{{
+  if g:neocomplete#enable_auto_close_preview
+        \ && bufname('%') !=# '[Command Line]'
+        \ && winnr('$') != 1 && !&l:previewwindow
+        \ && !neocomplete#is_cache_disabled()
+    " Close preview window.
+    pclose!
+  endif
+endfunction"}}}
+function! s:make_cache_current_line() abort "{{{
+  let neocomplete = neocomplete#get_current_neocomplete()
+  if neocomplete#helper#is_enabled_source('buffer',
+        \ neocomplete.context_filetype)
+    " Caching current cache line.
+    call neocomplete#sources#buffer#make_cache_current_line()
+  endif
+  if neocomplete#helper#is_enabled_source('member',
+        \ neocomplete.context_filetype)
+    " Caching current cache line.
+    call neocomplete#sources#member#make_cache_current_line()
+  endif
+endfunction"}}}
+function! s:check_force_omni(cur_text) abort "{{{
+  let cur_text = a:cur_text
+  let complete_pos = neocomplete#helper#get_force_omni_complete_pos(cur_text)
+
+  if complete_pos >= 0
+        \ && !neocomplete#complete#_check_previous_position(
+        \       cur_text, complete_pos)
+    call s:complete_key("\<Plug>(neocomplete_start_omni_complete)")
+  endif
+
+  return complete_pos
+endfunction"}}}
+function! s:check_fallback(cur_text) abort "{{{
+  let cur_text = a:cur_text
+  let complete_pos = match(cur_text, '\h\w*$')
+  let neocomplete = neocomplete#get_current_neocomplete()
+  if empty(g:neocomplete#fallback_mappings)
+        \ || len(matchstr(cur_text, '\h\w*$'))
+        \   < g:neocomplete#auto_completion_start_length
+        \ || neocomplete.skip_next_complete
+        \ || neocomplete#complete#_check_previous_position(
+        \      cur_text, complete_pos)
+    return
+  endif
+
+  let key = ''
+  for i in range(0, len(g:neocomplete#fallback_mappings)-1)
+    let key .= '<C-r>=neocomplete#mappings#fallback(' . i . ')<CR>'
+  endfor
+  execute 'inoremap <silent> <Plug>(neocomplete_fallback)' key
+
+  " Fallback
+  call s:complete_key("\<Plug>(neocomplete_fallback)")
+endfunction"}}}
+
+function! s:complete_key(key) abort "{{{
+  call neocomplete#helper#complete_configure()
+
+  if has('patch-7.4.601')
+    call feedkeys(a:key, 'i')
+  else
+    call feedkeys(a:key)
+  endif
+endfunction"}}}
+
+function! s:indent_current_line() abort "{{{
+  " indent line matched by indentkeys
+  let neocomplete = neocomplete#get_current_neocomplete()
+
+  let cur_text = matchstr(getline('.'), '^.*\%'.col('.').'c')
+  if neocomplete.indent_text == matchstr(getline('.'), '\S.*$')
+    return
+  endif
+
+  for word in filter(map(split(&l:indentkeys, ','),
+        \ "v:val =~ '^<.*>$' ? matchstr(v:val, '^<\\zs.*\\ze>$')
+        \                  : matchstr(v:val, ':\\|e\\|=\\zs.*')"),
+        \ "v:val != ''")
+
+    if word ==# 'e'
+      let word = 'else'
+    endif
+
+    let lastpos = len(cur_text)-len(word)
+    if lastpos >= 0 && strridx(cur_text, word) == lastpos
+      call neocomplete#helper#indent_current_line()
+      let neocomplete.indent_text = matchstr(getline('.'), '\S.*$')
+      break
+    endif
+  endfor
+endfunction"}}}
+function! s:is_delimiter() abort "{{{
+  " Check delimiter pattern.
+  let is_delimiter = 0
+  let cur_text = neocomplete#get_cur_text(1)
+
+  for delimiter in ['/']
+    if stridx(cur_text, delimiter,
+          \ len(cur_text) - len(delimiter)) >= 0
+      let is_delimiter = 1
+      break
+    endif
+  endfor
+
+  return is_delimiter
+endfunction"}}}
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: foldmethod=marker

+ 357 - 0
autoload/neocomplete/helper.vim

@@ -0,0 +1,357 @@
+"=============================================================================
+" FILE: helper.vim
+" AUTHOR: Shougo Matsushita <Shougo.Matsu@gmail.com>
+" License: MIT license  {{{
+"     Permission is hereby granted, free of charge, to any person obtaining
+"     a copy of this software and associated documentation files (the
+"     "Software"), to deal in the Software without restriction, including
+"     without limitation the rights to use, copy, modify, merge, publish,
+"     distribute, sublicense, and/or sell copies of the Software, and to
+"     permit persons to whom the Software is furnished to do so, subject to
+"     the following conditions:
+"
+"     The above copyright notice and this permission notice shall be included
+"     in all copies or substantial portions of the Software.
+"
+"     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+"     OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+"     MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+"     IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+"     CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+"     TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+"     SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+" }}}
+"=============================================================================
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! neocomplete#helper#get_cur_text(...) abort "{{{
+  let neocomplete = neocomplete#get_current_neocomplete()
+  let is_skip_char = get(a:000, 0, 0)
+  let mode = mode()
+  if neocomplete.event ==# 'InsertEnter'
+    let mode = 'i'
+  endif
+
+  let cur_text =
+        \ (mode ==# 'i' ?
+        \   (col('.')-1) : col('.')) >= len(getline('.')) ?
+        \      getline('.') :
+        \      matchstr(getline('.'),
+        \         '^.*\%' . (mode ==# 'i' && !is_skip_char ?
+        \                    col('.') : col('.') - 1)
+        \         . 'c' . (mode ==# 'i' ? '' : '.'))
+
+  if cur_text =~ '^.\{-}\ze\S\+$'
+    let complete_str = matchstr(cur_text, '\S\+$')
+    let cur_text = matchstr(cur_text, '^.\{-}\ze\S\+$')
+  else
+    let complete_str = ''
+  endif
+
+  if neocomplete.event ==# 'InsertCharPre'
+    let complete_str .= v:char
+  endif
+
+  let neocomplete.cur_text = cur_text . complete_str
+
+  " Save cur_text.
+  return neocomplete.cur_text
+endfunction"}}}
+
+function! neocomplete#helper#get_force_omni_complete_pos(cur_text) abort "{{{
+  let filetype = neocomplete#get_context_filetype()
+  let omnifunc = &l:omnifunc
+
+  if neocomplete#helper#check_invalid_omnifunc(omnifunc)
+    return -1
+  endif
+
+  let pattern = ''
+
+  if has_key(g:neocomplete#force_omni_input_patterns, omnifunc)
+    let pattern = g:neocomplete#force_omni_input_patterns[omnifunc]
+  elseif filetype != '' &&
+        \ get(g:neocomplete#force_omni_input_patterns, filetype, '') != ''
+    let pattern = g:neocomplete#force_omni_input_patterns[filetype]
+  endif
+
+  if pattern == ''
+    return -1
+  endif
+
+  return match(a:cur_text, '\%(' . pattern . '\m\)$')
+endfunction"}}}
+
+function! neocomplete#helper#is_enabled_source(source, filetype) abort "{{{
+  let source = type(a:source) == type('') ?
+        \ get(neocomplete#variables#get_sources(), a:source, {})
+        \ : a:source
+
+  return !empty(source) && (empty(source.filetypes) ||
+        \     neocomplete#helper#check_filetype(source.filetypes))
+        \  && (!get(source.disabled_filetypes, '_', 0) &&
+        \      !neocomplete#helper#check_filetype(source.disabled_filetypes))
+endfunction"}}}
+
+function! neocomplete#helper#get_source_filetypes(filetype) abort "{{{
+  return neocomplete#context_filetype#filetypes()
+endfunction"}}}
+
+function! neocomplete#helper#complete_check() abort "{{{
+  let neocomplete = neocomplete#get_current_neocomplete()
+  if g:neocomplete#enable_debug
+    echomsg split(reltimestr(reltime(neocomplete.start_time)))[0]
+  endif
+  let ret =
+        \ neocomplete#is_auto_complete()
+        \     && g:neocomplete#skip_auto_completion_time != ''
+        \     && split(reltimestr(reltime(neocomplete.start_time)))[0] >
+        \          g:neocomplete#skip_auto_completion_time
+  if ret
+    let neocomplete = neocomplete#get_current_neocomplete()
+    let neocomplete.skipped = 1
+
+    call neocomplete#print_debug('Skipped.')
+  endif
+
+  return ret
+endfunction"}}}
+
+function! neocomplete#helper#get_syn_name(is_trans) abort "{{{
+  return len(getline('.')) < 200 ?
+        \ synIDattr(synIDtrans(synID(line('.'), mode() ==# 'i' ?
+        \          col('.')-1 : col('.'), a:is_trans)), 'name') : ''
+endfunction"}}}
+
+function! neocomplete#helper#match_word(cur_text, ...) abort "{{{
+  let pattern = a:0 >= 1 ? a:1 : neocomplete#get_keyword_pattern_end()
+
+  " Check wildcard.
+  let complete_pos = match(a:cur_text, pattern)
+
+  let complete_str = (complete_pos >=0) ?
+        \ a:cur_text[complete_pos :] : ''
+
+  return [complete_pos, complete_str]
+endfunction"}}}
+
+function! neocomplete#helper#filetype_complete(arglead, cmdline, cursorpos) abort "{{{
+  " Dup check.
+  let ret = {}
+  for item in map(
+        \ split(globpath(&runtimepath, 'syntax/*.vim'), '\n') +
+        \ split(globpath(&runtimepath, 'indent/*.vim'), '\n') +
+        \ split(globpath(&runtimepath, 'ftplugin/*.vim'), '\n')
+        \ , 'fnamemodify(v:val, ":t:r")')
+    if !has_key(ret, item) && item =~ '^'.a:arglead
+      let ret[item] = 1
+    endif
+  endfor
+
+  return sort(keys(ret))
+endfunction"}}}
+
+function! neocomplete#helper#unite_patterns(pattern_var, filetype) abort "{{{
+  let keyword_patterns = []
+
+  lua << EOF
+do
+  local patterns = vim.eval('keyword_patterns')
+  local filetypes = vim.eval("split(a:filetype, '\\.')")
+  local pattern_var = vim.eval('a:pattern_var')
+
+  local dup_check = {}
+  for i = 0, #filetypes-1 do
+    local ft = filetypes[i]
+
+    -- Composite filetype.
+    if pattern_var[ft] ~= nil and dup_check[ft] == nil then
+      dup_check[ft] = 1
+      patterns:add(pattern_var[ft])
+    end
+  end
+
+  if #patterns == 0 then
+    local default = pattern_var['_']
+    if default == nil then
+      default = pattern_var['default']
+    end
+    if default ~= nil and default ~= '' then
+      patterns:add(default)
+    end
+  end
+end
+EOF
+
+  return join(keyword_patterns, '\m\|')
+endfunction"}}}
+
+function! neocomplete#helper#check_filetype(dictionary) abort "{{{
+  return !empty(filter(neocomplete#context_filetype#filetypes(),
+        \ 'get(a:dictionary, v:val, 0)'))
+endfunction"}}}
+
+function! neocomplete#helper#get_sources_list(...) abort "{{{
+  let filetype = neocomplete#get_context_filetype()
+
+  let source_names = exists('b:neocomplete_sources') ?
+        \ b:neocomplete_sources :
+        \ get(a:000, 0,
+        \   get(g:neocomplete#sources, filetype,
+        \     get(g:neocomplete#sources, '_', ['_'])))
+  call neocomplete#init#_sources(source_names)
+
+  let all_sources = neocomplete#available_sources()
+  let sources = {}
+  for source_name in source_names
+    if source_name ==# '_'
+      " All sources.
+      let sources = all_sources
+      break
+    endif
+
+    if !has_key(all_sources, source_name)
+      call neocomplete#print_warning(printf(
+            \ 'Invalid source name "%s" is given.', source_name))
+      continue
+    endif
+
+    let sources[source_name] = all_sources[source_name]
+  endfor
+
+  let neocomplete = neocomplete#get_current_neocomplete()
+  let neocomplete.sources = filter(sources, "
+        \   empty(v:val.filetypes) ||
+        \   neocomplete#helper#check_filetype(v:val.filetypes)")
+  let neocomplete.sources_filetype = neocomplete.context_filetype
+
+  return neocomplete.sources
+endfunction"}}}
+
+function! neocomplete#helper#clear_result() abort "{{{
+  let neocomplete = neocomplete#get_current_neocomplete()
+
+  let neocomplete.complete_str = ''
+  let neocomplete.candidates = []
+  let neocomplete.complete_sources = []
+  let neocomplete.complete_pos = -1
+
+  " Restore completeopt.
+  if neocomplete.completeopt !=# &completeopt
+    " Restore completeopt.
+    let &completeopt = neocomplete.completeopt
+  endif
+endfunction"}}}
+
+function! neocomplete#helper#call_hook(sources, hook_name, context) abort "{{{
+  for source in neocomplete#util#convert2list(a:sources)
+    try
+      if has_key(source.hooks, a:hook_name)
+        call call(source.hooks[a:hook_name],
+              \ [extend(source.neocomplete__context, a:context)],
+              \ source.hooks)
+      endif
+    catch
+      call neocomplete#print_error(v:throwpoint)
+      call neocomplete#print_error(v:exception)
+      call neocomplete#print_error(
+            \ 'Error occurred in calling hook "' . a:hook_name . '"!')
+      call neocomplete#print_error(
+            \ 'Source name is ' . source.name)
+    endtry
+  endfor
+endfunction"}}}
+
+function! neocomplete#helper#call_filters(filters, source, context) abort "{{{
+  let context = extend(a:source.neocomplete__context, a:context)
+  for filter in a:filters
+    try
+      let context.candidates = call(filter.filter, [context], filter)
+    catch
+      call neocomplete#print_error(v:throwpoint)
+      call neocomplete#print_error(v:exception)
+      call neocomplete#print_error(
+            \ 'Error occurred in calling filter '
+            \   . filter.name . '!')
+      call neocomplete#print_error(
+            \ 'Source name is ' . a:source.name)
+    endtry
+  endfor
+
+  return context.candidates
+endfunction"}}}
+
+function! neocomplete#helper#sort_human(candidates) abort "{{{
+  " Use lua interface.
+  lua << EOF
+do
+  local candidates = vim.eval('a:candidates')
+  local t = {}
+  for i = 1, #candidates do
+    t[i] = candidates[i-1]
+  end
+  table.sort(t, function(a, b) return a.word < b.word end)
+  for i = 0, #candidates-1 do
+    candidates[i] = t[i+1]
+  end
+end
+EOF
+  return a:candidates
+endfunction"}}}
+
+function! neocomplete#helper#check_invalid_omnifunc(omnifunc) abort "{{{
+  return a:omnifunc == '' || (a:omnifunc !~ '#' && !exists('*' . a:omnifunc))
+endfunction"}}}
+
+function! neocomplete#helper#indent_current_line() abort "{{{
+  let pos = getpos('.')
+  let len = len(getline('.'))
+  let equalprg = &l:equalprg
+  try
+    setlocal equalprg=
+    silent normal! ==
+  finally
+    let &l:equalprg = equalprg
+    let pos[2] += len(getline('.')) - len
+    call setpos('.', pos)
+  endtry
+endfunction"}}}
+
+function! neocomplete#helper#complete_configure() abort "{{{
+  set completeopt-=menu
+  set completeopt-=longest
+  set completeopt+=menuone
+
+  " Set options.
+  let neocomplete = neocomplete#get_current_neocomplete()
+  let neocomplete.completeopt = &completeopt
+
+  if neocomplete#util#is_complete_select()
+        \ && &completeopt !~# 'noinsert\|noselect'
+    if g:neocomplete#enable_auto_select
+      set completeopt-=noselect
+      set completeopt+=noinsert
+    else
+      set completeopt-=noinsert
+      set completeopt+=noselect
+    endif
+  endif
+endfunction"}}}
+
+function! neocomplete#helper#clean(directory) abort "{{{
+  let directory = neocomplete#get_data_directory() .'/'.a:directory
+  for file in split(glob(directory . '/*'), '\n')
+    let orig = substitute(substitute(fnamemodify(file, ':t'),
+        \             '=-', ':', 'g'), '=+', '/', 'g')
+    if !filereadable(orig)
+      call delete(file)
+    endif
+  endfor
+endfunction"}}}
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: foldmethod=marker

+ 656 - 0
autoload/neocomplete/init.vim

@@ -0,0 +1,656 @@
+"=============================================================================
+" FILE: init.vim
+" AUTHOR: Shougo Matsushita <Shougo.Matsu@gmail.com>
+" License: MIT license  {{{
+"     Permission is hereby granted, free of charge, to any person obtaining
+"     a copy of this software and associated documentation files (the
+"     "Software"), to deal in the Software without restriction, including
+"     without limitation the rights to use, copy, modify, merge, publish,
+"     distribute, sublicense, and/or sell copies of the Software, and to
+"     permit persons to whom the Software is furnished to do so, subject to
+"     the following conditions:
+"
+"     The above copyright notice and this permission notice shall be included
+"     in all copies or substantial portions of the Software.
+"
+"     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+"     OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+"     MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+"     IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+"     CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+"     TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+"     SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+" }}}
+"=============================================================================
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+if !exists('s:is_enabled')
+  let s:is_enabled = 0
+endif
+
+function! neocomplete#init#enable() abort "{{{
+  if neocomplete#is_enabled()
+    return
+  endif
+
+  if !(has('lua') && (v:version > 703 || v:version == 703 && has('patch885')))
+    echomsg 'neocomplete does not work with this version of Vim.'
+    echomsg 'neocomplete requires Vim 7.3.885 or later with Lua support ("+lua").'
+    return
+  endif
+
+  if !exists('b:neocomplete')
+    call neocomplete#init#_current_neocomplete()
+  endif
+  call neocomplete#init#_autocmds()
+  call neocomplete#init#_others()
+
+  call neocomplete#init#_sources(get(g:neocomplete#sources,
+        \ neocomplete#get_context_filetype(), ['_']))
+
+  let s:is_enabled = 1
+
+  doautocmd <nomodeline> neocomplete InsertEnter
+endfunction"}}}
+
+function! neocomplete#init#disable() abort "{{{
+  if !neocomplete#is_enabled()
+    return
+  endif
+
+  let s:is_enabled = 0
+
+  augroup neocomplete
+    autocmd!
+  augroup END
+
+  silent! delcommand NeoCompleteDisable
+
+  call neocomplete#helper#call_hook(filter(values(
+        \ neocomplete#variables#get_sources()), 'v:val.loaded'),
+        \ 'on_final', {})
+endfunction"}}}
+
+function! neocomplete#init#is_enabled() abort "{{{
+  return s:is_enabled
+endfunction"}}}
+
+function! neocomplete#init#_autocmds() abort "{{{
+  augroup neocomplete
+    autocmd!
+    autocmd InsertEnter *
+          \ call neocomplete#handler#_on_insert_enter()
+    autocmd InsertLeave *
+          \ call neocomplete#handler#_on_insert_leave()
+    autocmd CursorMovedI *
+          \ call neocomplete#handler#_on_moved_i()
+    autocmd InsertCharPre *
+          \ call neocomplete#handler#_on_insert_char_pre()
+    autocmd TextChangedI *
+          \ call neocomplete#handler#_on_text_changed()
+    autocmd CompleteDone *
+          \ call neocomplete#handler#_on_complete_done()
+  augroup END
+
+  let event = neocomplete#util#is_text_changed() ?
+        \  'TextChangedI' : 'CursorMovedI'
+  execute 'autocmd neocomplete' event '*'
+        \ 'call neocomplete#handler#_do_auto_complete("'.event.'")'
+
+  autocmd neocomplete InsertEnter *
+        \ call neocomplete#handler#_do_auto_complete('InsertEnter')
+endfunction"}}}
+
+function! neocomplete#init#_others() abort "{{{
+  call neocomplete#init#_variables()
+
+  call neocomplete#commands#_initialize()
+
+  " For auto complete keymappings.
+  call neocomplete#mappings#define_default_mappings()
+
+  " Detect set paste.
+  if &paste
+    redir => output
+    99verbose set paste
+    redir END
+    call neocomplete#print_error(output)
+    call neocomplete#print_error(
+          \ 'Detected set paste! Disabled neocomplete.')
+  endif
+
+  " Detect poor color
+  if &t_Co != '' && &t_Co < 8
+    call neocomplete#print_error(
+          \ 'Your terminal color is very limited. Disabled neocomplete.')
+  endif
+
+  command! -nargs=0 -bar NeoCompleteDisable
+        \ call neocomplete#init#disable()
+endfunction"}}}
+
+function! neocomplete#init#_variables() abort "{{{
+  " Initialize keyword patterns. "{{{
+  call neocomplete#util#set_default_dictionary(
+        \'g:neocomplete#keyword_patterns',
+        \'_',
+        \'\h\w*')
+  call neocomplete#util#set_default_dictionary(
+        \ 'g:neocomplete#keyword_patterns',
+        \'filename',
+        \ neocomplete#util#is_windows() ?
+        \'\%(\a\+:/\)\?\%([/[:alnum:]()$+_~.{}\x80-\xff-]\|[^[:print:]]\|\\.\)\+' :
+        \'\%([/\[\][:alnum:]()$+_~.{}-]\|[^[:print:]]\|\\.\)\+')
+  call neocomplete#util#set_default_dictionary(
+        \'g:neocomplete#keyword_patterns',
+        \'lisp,scheme,clojure,int-gosh,int-clisp,int-clj',
+        \'[[:alpha:]!$%&*+/:<=>?@\^_~\-][[:alnum:]!$%&*./:<=>?@\^_~\-]*')
+  call neocomplete#util#set_default_dictionary(
+        \'g:neocomplete#keyword_patterns',
+        \'ruby,int-irb',
+        \'^=\%(b\%[egin]\|e\%[nd]\)\|\%(@@\|[$@]\)\h\w*\|\h\w*[!?]\?')
+  call neocomplete#util#set_default_dictionary(
+        \'g:neocomplete#keyword_patterns',
+        \'php,int-php',
+        \'</\?\%(\h[[:alnum:]_-]*\s*\)\?\%(/\?>\)\?\|\$\h\w*\|\h\w*')
+  call neocomplete#util#set_default_dictionary(
+        \'g:neocomplete#keyword_patterns',
+        \'perl,int-perlsh',
+        \'<\h\w*>\?\|[$@%&*]\h\w*\|\h\w*')
+  call neocomplete#util#set_default_dictionary(
+        \'g:neocomplete#keyword_patterns',
+        \'perl6,int-perl6',
+        \'<\h\w*>\?\|[$@%&][!.*?]\?\h[[:alnum:]_-]*\|\h[[:alnum:]_-]*')
+  call neocomplete#util#set_default_dictionary(
+        \'g:neocomplete#keyword_patterns',
+        \'pir',
+        \'[$@%.=]\?\h\w*')
+  call neocomplete#util#set_default_dictionary(
+        \'g:neocomplete#keyword_patterns',
+        \'pasm',
+        \'[=]\?\h\w*')
+  call neocomplete#util#set_default_dictionary(
+        \'g:neocomplete#keyword_patterns',
+        \'vim,help',
+        \'-\h[[:alnum:]-]*=\?\|\c\[:\%(\h\w*:\]\)\?\|&\h[[:alnum:]_:]*\|'.
+        \'<SID>\%(\h\w*\)\?\|<Plug>([^)]*)\?'.
+        \'\|<\h[[:alnum:]_-]*>\?\|\h[[:alnum:]_:#]*[!(]\?\|$\h\w*')
+  call neocomplete#util#set_default_dictionary(
+        \'g:neocomplete#keyword_patterns',
+        \'tex',
+        \'\\\a{\a\{1,2}}\|\\[[:alpha:]@][[:alnum:]@]*'.
+        \'\%({\%([[:alnum:]:_]\+\*\?}\?\)\?\)\?\|\a[[:alnum:]:_]*\*\?')
+  call neocomplete#util#set_default_dictionary(
+        \'g:neocomplete#keyword_patterns',
+        \'sh,zsh,int-zsh,int-bash,int-sh',
+        \'[[:alpha:]_.-][[:alnum:]_.-]*')
+  call neocomplete#util#set_default_dictionary(
+        \'g:neocomplete#keyword_patterns',
+        \'vimshell',
+        \'\$\$\?\w*\|[[:alpha:]_.\\/~-][[:alnum:]_.\\/~-]*\|\d\+\%(\.\d\+\)\+')
+  call neocomplete#util#set_default_dictionary(
+        \'g:neocomplete#keyword_patterns',
+        \'ps1,int-powershell',
+        \'\[\h\%([[:alnum:]_.]*\]::\)\?\|[$%@.]\?[[:alpha:]_.:-][[:alnum:]_.:-]*')
+  call neocomplete#util#set_default_dictionary(
+        \'g:neocomplete#keyword_patterns',
+        \'c',
+        \'^\s*#\s*\h\w*\|\h\w*')
+  call neocomplete#util#set_default_dictionary(
+        \'g:neocomplete#keyword_patterns',
+        \'cpp',
+        \'^\s*#\s*\h\w*\|\h\w*')
+  call neocomplete#util#set_default_dictionary(
+        \'g:neocomplete#keyword_patterns',
+        \'objc',
+        \'^\s*#\s*\h\w*\|\h\w*\|@\h\w*')
+  call neocomplete#util#set_default_dictionary(
+        \'g:neocomplete#keyword_patterns',
+        \'objcpp',
+        \'^\s*#\s*\h\w*\|\h\w*\|@\h\w*')
+  call neocomplete#util#set_default_dictionary(
+        \'g:neocomplete#keyword_patterns',
+        \'objj',
+        \'\h\w*\|@\h\w*')
+  call neocomplete#util#set_default_dictionary(
+        \'g:neocomplete#keyword_patterns',
+        \'d',
+        \'\h\w*')
+  call neocomplete#util#set_default_dictionary(
+        \'g:neocomplete#keyword_patterns',
+        \'python,int-python,int-ipython',
+        \'[@]\?\h\w*')
+  call neocomplete#util#set_default_dictionary(
+        \'g:neocomplete#keyword_patterns',
+        \'cs',
+        \'\h\w*')
+  call neocomplete#util#set_default_dictionary(
+        \'g:neocomplete#keyword_patterns',
+        \'java',
+        \'[@]\?\h\w*')
+  call neocomplete#util#set_default_dictionary(
+        \'g:neocomplete#keyword_patterns',
+        \'javascript,actionscript,int-js,int-kjs,int-rhino',
+        \'\h\w*')
+  call neocomplete#util#set_default_dictionary(
+        \'g:neocomplete#keyword_patterns',
+        \'coffee,int-coffee',
+        \'[@]\?\h\w*')
+  call neocomplete#util#set_default_dictionary(
+        \'g:neocomplete#keyword_patterns',
+        \'awk',
+        \'\h\w*')
+  call neocomplete#util#set_default_dictionary(
+        \'g:neocomplete#keyword_patterns',
+        \'haskell,int-ghci',
+        \'\%(\u\w*\.\)\+[[:alnum:]_'']*\|[[:alpha:]_''][[:alnum:]_'']*')
+  call neocomplete#util#set_default_dictionary(
+        \'g:neocomplete#keyword_patterns',
+        \'ml,ocaml,int-ocaml,int-sml,int-smlsharp',
+        \'[''`#.]\?\h[[:alnum:]_'']*')
+  call neocomplete#util#set_default_dictionary(
+        \'g:neocomplete#keyword_patterns',
+        \'erlang,int-erl',
+        \'^\s*-\h\w*\|\%(\h\w*:\)*\h\w*\|\h[[:alnum:]_@]*')
+  call neocomplete#util#set_default_dictionary(
+        \'g:neocomplete#keyword_patterns',
+        \'html,xhtml,xml,markdown,mkd,eruby',
+        \'</\?\%([[:alnum:]_:-]\+\s*\)\?\%(/\?>\)\?\|&\h\%(\w*;\)\?'.
+        \'\|\h[[:alnum:]_-]*="\%([^"]*"\?\)\?\|\h[[:alnum:]_:-]*')
+  call neocomplete#util#set_default_dictionary(
+        \'g:neocomplete#keyword_patterns',
+        \'css,stylus,scss,less',
+        \'[@#.]\?[[:alpha:]_-][[:alnum:]_-]*')
+  call neocomplete#util#set_default_dictionary(
+        \'g:neocomplete#keyword_patterns',
+        \'tags',
+        \'^[^!][^/[:blank:]]*')
+  call neocomplete#util#set_default_dictionary(
+        \'g:neocomplete#keyword_patterns',
+        \'pic',
+        \'^\s*#\h\w*\|\h\w*')
+  call neocomplete#util#set_default_dictionary(
+        \'g:neocomplete#keyword_patterns',
+        \'arm',
+        \'\h\w*')
+  call neocomplete#util#set_default_dictionary(
+        \'g:neocomplete#keyword_patterns',
+        \'asmh8300',
+        \'[[:alpha:]_.][[:alnum:]_.]*')
+  call neocomplete#util#set_default_dictionary(
+        \'g:neocomplete#keyword_patterns',
+        \'masm',
+        \'\.\h\w*\|[[:alpha:]_@?$][[:alnum:]_@?$]*\|\h\w*:\h\w*')
+  call neocomplete#util#set_default_dictionary(
+        \'g:neocomplete#keyword_patterns',
+        \'nasm',
+        \'^\s*\[\h\w*\|[%.]\?\h\w*\|\%(\.\.@\?\|%[%$!]\)\%(\h\w*\)\?\|\h\w*:\h\w*')
+  call neocomplete#util#set_default_dictionary(
+        \'g:neocomplete#keyword_patterns',
+        \'asm',
+        \'[%$.]\?\h\w*\%(\$\h\w*\)\?')
+  call neocomplete#util#set_default_dictionary(
+        \'g:neocomplete#keyword_patterns',
+        \'gas',
+        \'[$.]\?\h\w*')
+  call neocomplete#util#set_default_dictionary(
+        \'g:neocomplete#keyword_patterns',
+        \'gdb,int-gdb',
+        \'$\h\w*\|[[:alnum:]:._-]\+')
+  call neocomplete#util#set_default_dictionary(
+        \'g:neocomplete#keyword_patterns',
+        \'make',
+        \'[[:alpha:]_.-][[:alnum:]_.-]*')
+  call neocomplete#util#set_default_dictionary(
+        \'g:neocomplete#keyword_patterns',
+        \'scala,int-scala',
+        \'\h\w*')
+  call neocomplete#util#set_default_dictionary(
+        \'g:neocomplete#keyword_patterns',
+        \'int-termtter',
+        \'\h[[:alnum:]_/-]*\|\$\a\+\|#\h\w*')
+  call neocomplete#util#set_default_dictionary(
+        \'g:neocomplete#keyword_patterns',
+        \'int-earthquake',
+        \'[:#$]\h\w*\|\h[[:alnum:]_/-]*')
+  call neocomplete#util#set_default_dictionary(
+        \'g:neocomplete#keyword_patterns',
+        \'dosbatch,int-cmdproxy',
+        \'\$\w+\|[[:alpha:]_./-][[:alnum:]_.-]*')
+  call neocomplete#util#set_default_dictionary(
+        \'g:neocomplete#keyword_patterns',
+        \'vb',
+        \'\h\w*\|#\h\w*')
+  call neocomplete#util#set_default_dictionary(
+        \'g:neocomplete#keyword_patterns',
+        \'lua',
+        \'\h\w*')
+  call neocomplete#util#set_default_dictionary(
+        \'g:neocomplete#keyword_patterns',
+        \ 'zimbu',
+        \'\h\w*')
+  call neocomplete#util#set_default_dictionary(
+        \'g:neocomplete#keyword_patterns',
+        \'konoha',
+        \'[*$@%]\h\w*\|\h\w*')
+  call neocomplete#util#set_default_dictionary(
+        \'g:neocomplete#keyword_patterns',
+        \'cobol',
+        \'\a[[:alnum:]-]*')
+  call neocomplete#util#set_default_dictionary(
+        \'g:neocomplete#keyword_patterns',
+        \'coq',
+        \'\h[[:alnum:]_'']*')
+  call neocomplete#util#set_default_dictionary(
+        \'g:neocomplete#keyword_patterns',
+        \'tcl',
+        \'[.-]\h\w*\|\h\w*')
+  call neocomplete#util#set_default_dictionary(
+        \'g:neocomplete#keyword_patterns',
+        \'nyaos,int-nyaos',
+        \'\h\w*')
+  call neocomplete#util#set_default_dictionary(
+        \'g:neocomplete#keyword_patterns',
+        \'go',
+        \'\h\w*')
+  call neocomplete#util#set_default_dictionary(
+        \'g:neocomplete#keyword_patterns',
+        \'toml',
+        \'\h[[:alnum:]_.-]*')
+  "}}}
+
+  " Initialize delimiter patterns. "{{{
+  call neocomplete#util#set_default_dictionary(
+        \ 'g:neocomplete#delimiter_patterns',
+        \ 'vim,help', ['#'])
+  call neocomplete#util#set_default_dictionary(
+        \ 'g:neocomplete#delimiter_patterns',
+        \ 'erlang,lisp,int-clisp', [':'])
+  call neocomplete#util#set_default_dictionary(
+        \ 'g:neocomplete#delimiter_patterns',
+        \ 'lisp,int-clisp', ['/', ':'])
+  call neocomplete#util#set_default_dictionary(
+        \ 'g:neocomplete#delimiter_patterns',
+        \ 'clojure,int-clj', ['/', '.'])
+  call neocomplete#util#set_default_dictionary(
+        \ 'g:neocomplete#delimiter_patterns',
+        \ 'perl,cpp', ['::'])
+  call neocomplete#util#set_default_dictionary(
+        \ 'g:neocomplete#delimiter_patterns',
+        \ 'php', ['\', '::'])
+  call neocomplete#util#set_default_dictionary(
+        \ 'g:neocomplete#delimiter_patterns',
+        \ 'java,d,javascript,actionscript,'.
+        \ 'ruby,eruby,haskell,int-ghci,coffee,zimbu,konoha',
+        \ ['.'])
+  call neocomplete#util#set_default_dictionary(
+        \ 'g:neocomplete#delimiter_patterns',
+        \ 'lua', ['.', ':'])
+  call neocomplete#util#set_default_dictionary(
+        \ 'g:neocomplete#delimiter_patterns',
+        \ 'perl6', ['.', '::'])
+  "}}}
+
+  " Initialize text mode filetypes. "{{{
+  call neocomplete#util#set_default_dictionary(
+        \ 'g:neocomplete#text_mode_filetypes',
+        \ join(['hybrid', 'text', 'help', 'tex', 'gitcommit', 'gitrebase',
+        \       'vcs-commit', 'markdown', 'mkd', 'textile', 'creole',
+        \       'org', 'rdoc', 'mediawiki', 'rst', 'asciidoc', 'pod',
+        \       'gita-commit', 'J6uil_say',
+        \ ], ','), 1)
+  "}}}
+
+  " Initialize tags filter patterns. "{{{
+  call neocomplete#util#set_default_dictionary(
+        \'g:neocomplete#tags_filter_patterns', 'c,cpp',
+        \'v:val.word !~ ''^[~_]''')
+  "}}}
+
+  " Initialize force omni completion patterns. "{{{
+  call neocomplete#util#set_default_dictionary(
+        \'g:neocomplete#force_omni_input_patterns', 'objc',
+        \'\h\w\+\|[^.[:digit:] *\t]\%(\.\|->\)')
+  "}}}
+
+  " Must g:neocomplete#auto_completion_start_length > 1.
+  if g:neocomplete#auto_completion_start_length < 1
+    let g:neocomplete#auto_completion_start_length = 1
+  endif
+
+  " Must g:neocomplete#min_keyword_length > 1.
+  if g:neocomplete#min_keyword_length < 1
+    let g:neocomplete#min_keyword_length = 1
+  endif
+endfunction"}}}
+
+function! neocomplete#init#_current_neocomplete() abort "{{{
+  let b:neocomplete = {
+        \ 'context' : {
+        \      'input' : '',
+        \      'complete_pos' : -1,
+        \      'complete_str' : '',
+        \      'candidates' : [],
+        \ },
+        \ 'lock' : 0,
+        \ 'skip_next_complete' : 0,
+        \ 'filetype' : '',
+        \ 'context_filetype' : '',
+        \ 'context_filetypes' : [],
+        \ 'completion_length' : -1,
+        \ 'foldinfo' : [],
+        \ 'skipped' : 0,
+        \ 'event' : '',
+        \ 'cur_text' : '',
+        \ 'old_cur_text' : '',
+        \ 'old_linenr' : line('.'),
+        \ 'old_complete_pos' : -1,
+        \ 'old_char' : '',
+        \ 'complete_str' : '',
+        \ 'complete_pos' : -1,
+        \ 'candidates' : [],
+        \ 'complete_sources' : [],
+        \ 'manual_sources' : [],
+        \ 'start_time' : reltime(),
+        \ 'linenr' : 0,
+        \ 'completeopt' : &completeopt,
+        \ 'sources' : [],
+        \ 'sources_filetype' : '',
+        \ 'within_comment' : 0,
+        \ 'is_auto_complete' : 0,
+        \ 'indent_text' : '',
+        \ 'detected_foldmethod' : 0,
+        \ 'default_matchers' : neocomplete#init#_filters(
+        \  (g:neocomplete#enable_fuzzy_completion ?
+        \   ['matcher_fuzzy'] : ['matcher_head'])
+        \  + ['matcher_length']),
+        \}
+endfunction"}}}
+
+function! neocomplete#init#_sources(names) abort "{{{
+  if !exists('s:loaded_source_files')
+    " Initialize.
+    let s:loaded_source_files = {}
+    let s:loaded_all_sources = 0
+    let s:runtimepath_save = ''
+  endif
+
+  " Initialize sources table.
+  if s:loaded_all_sources && &runtimepath ==# s:runtimepath_save
+    return
+  endif
+
+  let runtimepath_save = neocomplete#util#split_rtp(s:runtimepath_save)
+  let runtimepath = neocomplete#util#join_rtp(
+        \ filter(neocomplete#util#split_rtp(),
+        \ 'index(runtimepath_save, v:val) < 0'))
+  let sources = neocomplete#variables#get_sources()
+
+  for name in filter(copy(a:names), '!has_key(sources, v:val)')
+    " Search autoload.
+    for source_name in map(filter(split(globpath(runtimepath,
+          \ 'autoload/neocomplete/sources/*.vim'), '\n'),
+          \ "index(g:neocomplete#ignore_source_files,
+          \        fnamemodify(v:val, ':t')) < 0"),
+          \ "fnamemodify(v:val, ':t:r')")
+      if has_key(s:loaded_source_files, source_name)
+        continue
+      endif
+
+      let s:loaded_source_files[source_name] = 1
+
+      let source = neocomplete#sources#{source_name}#define()
+      if empty(source)
+        " Ignore.
+        continue
+      endif
+
+      call neocomplete#define_source(source)
+    endfor
+
+    if name == '_'
+      let s:loaded_all_sources = 1
+      let s:runtimepath_save = &runtimepath
+    endif
+  endfor
+endfunction"}}}
+
+function! neocomplete#init#_source(source) abort "{{{
+  let default = {
+        \ 'is_volatile' : 0,
+        \ 'max_candidates' : 0,
+        \ 'filetypes' : {},
+        \ 'disabled' : 0,
+        \ 'disabled_filetypes' : {},
+        \ 'hooks' : {},
+        \ 'matchers' : [],
+        \ 'sorters' : ['sorter_rank'],
+        \ 'converters' : [
+        \      'converter_remove_overlap',
+        \      'converter_abbr',
+        \ ],
+        \ 'keyword_patterns' : g:neocomplete#keyword_patterns,
+        \ 'min_pattern_length' : g:neocomplete#auto_completion_start_length,
+        \ 'input_pattern' : '',
+        \ 'neocomplete__context' : neocomplete#init#_context({}),
+        \ }
+
+  let source = extend(copy(default), a:source)
+
+  " Overwritten by user custom.
+  let custom = neocomplete#custom#get().sources
+  let source = extend(source, get(custom, source.name,
+        \ get(custom, '_', {})))
+
+  let source.loaded = 0
+  " Source kind convertion.
+  if !has_key(source, 'kind')
+    let source.kind = 'manual'
+  elseif source.kind ==# 'plugin'
+    let source.kind = 'keyword'
+  elseif source.kind ==# 'ftplugin' || source.kind ==# 'complfunc'
+    " For compatibility.
+    let source.kind = 'manual'
+  endif
+
+  if !has_key(source, 'rank')
+    " Set default rank.
+    let source.rank = (source.kind ==# 'keyword') ? 5 :
+          \ empty(source.filetypes) ? 10 : 100
+  endif
+
+  if !has_key(source, 'mark')
+    " Set default mark.
+    let source.mark = '[' . source.name . ']'
+  endif
+
+  if !has_key(source.keyword_patterns, '_')
+    " Set default keyword pattern.
+    let source.keyword_patterns['_'] =
+          \ get(g:neocomplete#keyword_patterns, '_', '\h\w*')
+  endif
+
+  let source.neocomplete__matchers = neocomplete#init#_filters(
+        \ neocomplete#util#convert2list(source.matchers))
+  let source.neocomplete__sorters = neocomplete#init#_filters(
+        \ neocomplete#util#convert2list(source.sorters))
+  let source.neocomplete__converters = neocomplete#init#_filters(
+        \ neocomplete#util#convert2list(source.converters))
+
+  let source.neocomplete__context.source_name = source.name
+
+  return source
+endfunction"}}}
+
+function! neocomplete#init#_filters(names) abort "{{{
+  let _ = []
+  let filters = neocomplete#variables#get_filters()
+
+  for name in a:names
+    if !has_key(filters, name)
+      " Search autoload.
+      for filter_name in map(split(globpath(&runtimepath,
+            \ 'autoload/neocomplete/filters/'.
+            \   substitute(name,
+            \'^\%(matcher\|sorter\|converter\)_[^/_-]\+\zs[/_-].*$', '', '')
+            \  .'*.vim'), '\n'), "fnamemodify(v:val, ':t:r')")
+        let filter = neocomplete#filters#{filter_name}#define()
+        if empty(filter)
+          " Ignore.
+          continue
+        endif
+
+        call neocomplete#define_filter(filter)
+      endfor
+
+      if !has_key(filters, name)
+        " Not found.
+        call neocomplete#print_error(
+              \ printf('filter name : %s is not found.', string(name)))
+        continue
+      endif
+    endif
+
+    if has_key(filters, name)
+      call add(_, filters[name])
+    endif
+  endfor
+
+  return _
+endfunction"}}}
+
+function! neocomplete#init#_filter(filter) abort "{{{
+  let default = {
+        \ }
+
+  let filter = extend(default, a:filter)
+  if !has_key(filter, 'kind')
+    let filter.kind =
+          \ (filter.name =~# '^matcher_') ? 'matcher' :
+          \ (filter.name =~# '^sorter_') ? 'sorter' : 'converter'
+  endif
+
+  return filter
+endfunction"}}}
+
+function! neocomplete#init#_context(context) abort "{{{
+  let filetype = neocomplete#get_context_filetype()
+  return extend(a:context, {
+        \ 'input' : '',
+        \ 'prev_complete_pos' : -1,
+        \ 'prev_candidates' : [],
+        \ 'prev_line' : '',
+        \ 'complete_pos' : -1,
+        \ 'complete_str' : '',
+        \ 'candidates' : [],
+        \ 'filetype' : filetype,
+        \ 'filetypes' : neocomplete#context_filetype#filetypes(),
+        \ })
+endfunction"}}}
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: foldmethod=marker

+ 269 - 0
autoload/neocomplete/mappings.vim

@@ -0,0 +1,269 @@
+"=============================================================================
+" FILE: mappings.vim
+" AUTHOR: Shougo Matsushita <Shougo.Matsu@gmail.com>
+" License: MIT license  {{{
+"     Permission is hereby granted, free of charge, to any person obtaining
+"     a copy of this software and associated documentation files (the
+"     "Software"), to deal in the Software without restriction, including
+"     without limitation the rights to use, copy, modify, merge, publish,
+"     distribute, sublicense, and/or sell copies of the Software, and to
+"     permit persons to whom the Software is furnished to do so, subject to
+"     the following conditions:
+"
+"     The above copyright notice and this permission notice shall be included
+"     in all copies or substantial portions of the Software.
+"
+"     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+"     OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+"     MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+"     IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+"     CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+"     TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+"     SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+" }}}
+"=============================================================================
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! neocomplete#mappings#define_default_mappings() abort "{{{
+  inoremap <expr><silent> <Plug>(neocomplete_start_unite_complete)
+        \ unite#sources#neocomplete#start_complete()
+  inoremap <expr><silent> <Plug>(neocomplete_start_unite_quick_match)
+        \ unite#sources#neocomplete#start_quick_match()
+  if neocomplete#util#is_complete_select()
+    inoremap <silent> <Plug>(neocomplete_start_omni_complete)
+          \ <C-x><C-o>
+  else
+    inoremap <silent> <Plug>(neocomplete_start_omni_complete)
+          \ <C-x><C-o><C-p>
+  endif
+  if neocomplete#util#is_complete_select()
+    inoremap <silent> <Plug>(neocomplete_start_auto_complete)
+          \ <C-r>=neocomplete#mappings#auto_complete()<CR>
+    inoremap <silent> <Plug>(neocomplete_start_manual_complete)
+          \ <C-r>=neocomplete#mappings#manual_complete()<CR>
+  else
+    inoremap <silent> <Plug>(neocomplete_start_auto_complete)
+          \ <C-r>=neocomplete#mappings#auto_complete()<CR><C-r>=
+          \neocomplete#mappings#popup_post()<CR>
+    inoremap <silent> <Plug>(neocomplete_start_manual_complete)
+          \ <C-r>=neocomplete#mappings#manual_complete()<CR><C-r>=
+          \neocomplete#mappings#popup_post()<CR>
+  endif
+
+  if !has('patch-7.4.653')
+    " To prevent Vim's complete() bug.
+    if mapcheck('<C-h>', 'i') ==# ''
+      inoremap <expr><C-h> neocomplete#smart_close_popup()."\<C-h>"
+    endif
+    if mapcheck('<BS>', 'i') ==# ''
+      inoremap <expr><BS> neocomplete#smart_close_popup()."\<C-h>"
+    endif
+  endif
+
+  inoremap <silent> <Plug>(neocomplete_auto_refresh)
+        \ <C-r>=neocomplete#mappings#refresh()<CR>
+endfunction"}}}
+
+function! neocomplete#mappings#auto_complete() abort "{{{
+  let neocomplete = neocomplete#get_current_neocomplete()
+  let cur_text = neocomplete#get_cur_text(1)
+  let complete_pos =
+        \ neocomplete#complete#_get_complete_pos(
+        \ neocomplete.complete_sources)
+  let base = cur_text[complete_pos :]
+
+  let neocomplete.candidates = neocomplete#complete#_get_words(
+        \ neocomplete.complete_sources, complete_pos, base)
+  let neocomplete.complete_str = base
+  let neocomplete.refresh = 0
+  if empty(neocomplete.candidates)
+    return ''
+  endif
+
+  " Start auto complete.
+  call complete(complete_pos+1, neocomplete.candidates)
+  return ''
+endfunction"}}}
+
+function! neocomplete#mappings#manual_complete() abort "{{{
+  let neocomplete = neocomplete#get_current_neocomplete()
+  let cur_text = neocomplete#get_cur_text(1)
+  let complete_sources = neocomplete#complete#_get_results(
+        \ cur_text, neocomplete.manual_sources)
+  let complete_pos =
+        \ neocomplete#complete#_get_complete_pos(
+        \ complete_sources)
+  let base = cur_text[complete_pos :]
+
+  let neocomplete.complete_pos = complete_pos
+  let neocomplete.candidates = neocomplete#complete#_get_words(
+        \ complete_sources, complete_pos, base)
+  let neocomplete.complete_str = base
+  if empty(neocomplete.candidates)
+    return ''
+  endif
+
+  " Start auto complete.
+  call complete(complete_pos+1, neocomplete.candidates)
+  return ''
+endfunction"}}}
+
+function! neocomplete#mappings#smart_close_popup() abort "{{{
+  return neocomplete#mappings#cancel_popup()
+endfunction
+"}}}
+function! neocomplete#mappings#close_popup() abort "{{{
+  let neocomplete = neocomplete#get_current_neocomplete()
+  let neocomplete.complete_str = ''
+  let neocomplete.old_cur_text = neocomplete#get_cur_text(1)
+  let neocomplete.skip_next_complete = 1
+
+  return pumvisible() ? "\<C-y>" : ''
+endfunction
+"}}}
+function! neocomplete#mappings#cancel_popup() abort "{{{
+  let neocomplete = neocomplete#get_current_neocomplete()
+  let neocomplete.complete_str = ''
+  let neocomplete.old_cur_text = neocomplete#get_cur_text(1)
+  let neocomplete.old_complete_pos = col('.')
+  if mode() !=# 'i'
+    let neocomplete.old_complete_pos += 1
+  endif
+  let neocomplete.old_linenr = line('.')
+  let neocomplete.skip_next_complete = 1
+
+  return pumvisible() ? "\<C-e>" : ''
+endfunction
+"}}}
+
+function! neocomplete#mappings#popup_post() abort "{{{
+  return  !pumvisible() ? "" :
+        \ g:neocomplete#enable_auto_select ? "\<C-p>\<Down>" : "\<C-p>"
+endfunction"}}}
+
+function! neocomplete#mappings#undo_completion() abort "{{{
+  if !neocomplete#is_enabled()
+    return ''
+  endif
+
+  let neocomplete = neocomplete#get_current_neocomplete()
+
+  " Get cursor word.
+  let complete_str =
+        \ (!exists('v:completed_item') || empty(v:completed_item)) ?
+        \ neocomplete#helper#match_word(neocomplete#get_cur_text(1))[1] :
+        \ v:completed_item.word
+
+  let old_keyword_str = neocomplete.complete_str
+  let neocomplete.complete_str = complete_str
+
+  return (!pumvisible() ? '' :
+        \ complete_str ==# old_keyword_str ? "\<C-e>" : "\<C-y>")
+        \. repeat("\<BS>", strchars(complete_str)) . old_keyword_str
+endfunction"}}}
+
+function! neocomplete#mappings#complete_common_string() abort "{{{
+  if !neocomplete#is_enabled()
+    return ''
+  endif
+
+  " Get cursor word.
+  let neocomplete = neocomplete#get_current_neocomplete()
+  let neocomplete.event = 'mapping'
+  let complete_str =
+        \ neocomplete#helper#match_word(neocomplete#get_cur_text(1))[1]
+
+  if complete_str == ''
+    return ''
+  endif
+
+  " Save options.
+  let ignorecase_save = &ignorecase
+
+  try
+    if neocomplete#is_text_mode()
+      let &ignorecase = 1
+    elseif g:neocomplete#enable_smart_case
+          \ || g:neocomplete#enable_camel_case
+      let &ignorecase = complete_str !~ '\u'
+    else
+      let &ignorecase = g:neocomplete#enable_ignore_case
+    endif
+
+    let candidates = neocomplete#filters#matcher_head#define().filter(
+          \ { 'candidates' : copy(neocomplete.candidates),
+          \   'complete_str' : complete_str})
+
+    if empty(candidates)
+      return ''
+    endif
+
+    let common_str = candidates[0].word
+    for keyword in candidates[1:]
+      while !neocomplete#head_match(keyword.word, common_str)
+        let common_str = common_str[: -2]
+      endwhile
+    endfor
+  finally
+    let &ignorecase = ignorecase_save
+  endtry
+
+  if common_str == ''
+        \ || complete_str ==? common_str
+    return ''
+  endif
+
+  return (pumvisible() ? "\<C-e>" : '')
+        \ . repeat("\<BS>", strchars(complete_str)) . common_str
+endfunction"}}}
+
+function! neocomplete#mappings#fallback(i) abort "{{{
+  let mapping = g:neocomplete#fallback_mappings[a:i]
+  return  (pumvisible() || (mapping ==? "\<C-x>\<C-o>"
+        \                   && &l:omnifunc == '')) ? "" :
+        \ (mapping . (neocomplete#util#is_complete_select() ?
+        \             "" : "\<C-p>"))
+endfunction"}}}
+
+function! neocomplete#mappings#refresh() abort "{{{
+  let neocomplete = neocomplete#get_current_neocomplete()
+  let neocomplete.refresh = 1
+  return pumvisible() ? "\<C-e>" : ''
+endfunction"}}}
+
+" Manual complete wrapper.
+function! neocomplete#mappings#start_manual_complete(...) abort "{{{
+  if !neocomplete#is_enabled()
+    return ''
+  endif
+
+  if neocomplete#helper#get_force_omni_complete_pos(
+        \ neocomplete#get_cur_text(1)) >= 0
+    return "\<C-x>\<C-o>"
+  endif
+
+  " Set context filetype.
+  call neocomplete#context_filetype#set()
+
+  let neocomplete = neocomplete#get_current_neocomplete()
+
+  let sources = get(a:000, 0,
+        \ keys(neocomplete#available_sources()))
+  let neocomplete.manual_sources = neocomplete#helper#get_sources_list(
+        \ neocomplete#util#convert2list(sources))
+  let neocomplete.sources_filetype = ''
+
+  call neocomplete#helper#complete_configure()
+
+  " Start complete.
+  return "\<C-r>=neocomplete#mappings#manual_complete()\<CR>"
+        \ . (neocomplete#util#is_complete_select() ?
+        \    "" : "\<C-r>=neocomplete#mappings#popup_post()\<CR>")
+endfunction"}}}
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: foldmethod=marker

+ 400 - 0
autoload/neocomplete/sources/buffer.vim

@@ -0,0 +1,400 @@
+"=============================================================================
+" FILE: buffer.vim
+" AUTHOR:  Shougo Matsushita <Shougo.Matsu@gmail.com>
+" License: MIT license  {{{
+"     Permission is hereby granted, free of charge, to any person obtaining
+"     a copy of this software and associated documentation files (the
+"     "Software"), to deal in the Software without restriction, including
+"     without limitation the rights to use, copy, modify, merge, publish,
+"     distribute, sublicense, and/or sell copies of the Software, and to
+"     permit persons to whom the Software is furnished to do so, subject to
+"     the following conditions:
+"
+"     The above copyright notice and this permission notice shall be included
+"     in all copies or substantial portions of the Software.
+"
+"     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+"     OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+"     MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+"     IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+"     CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+"     TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+"     SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+" }}}
+"=============================================================================
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+" Global options definition. "{{{
+let g:neocomplete#sources#buffer#cache_limit_size =
+      \ get(g:, 'neocomplete#sources#buffer#cache_limit_size', 500000)
+let g:neocomplete#sources#buffer#disabled_pattern =
+      \ get(g:, 'neocomplete#sources#buffer#disabled_pattern', '')
+let g:neocomplete#sources#buffer#max_keyword_width =
+      \ get(g:, 'neocomplete#sources#buffer#max_keyword_width', 80)
+"}}}
+
+" Important variables.
+if !exists('s:buffer_sources')
+  let s:buffer_sources = {}
+  let s:async_dictionary_list = {}
+endif
+
+let s:source = {
+      \ 'name' : 'buffer',
+      \ 'kind' : 'manual',
+      \ 'mark' : '[B]',
+      \ 'rank' : 5,
+      \ 'min_pattern_length' :
+      \     g:neocomplete#auto_completion_start_length,
+      \ 'hooks' : {},
+      \ 'is_volatile' : 1,
+      \}
+
+function! s:source.hooks.on_init(context) abort "{{{
+  let s:buffer_sources = {}
+
+  augroup neocomplete "{{{
+    autocmd BufEnter,BufRead,BufWinEnter,BufWritePost *
+          \ call s:check_source()
+    autocmd InsertEnter,InsertLeave *
+          \ call neocomplete#sources#buffer#make_cache_current_line()
+    autocmd VimLeavePre * call s:clean()
+  augroup END"}}}
+
+  " Create cache directory.
+  call neocomplete#cache#make_directory('buffer_cache')
+  call neocomplete#cache#make_directory('buffer_temp')
+
+  " Initialize script variables. "{{{
+  let s:buffer_sources = {}
+  let s:async_dictionary_list = {}
+  "}}}
+
+  call s:make_cache_buffer(bufnr('%'))
+  call s:check_source()
+endfunction
+"}}}
+
+function! s:source.hooks.on_final(context) abort "{{{
+  silent! delcommand NeoCompleteBufferMakeCache
+
+  let s:buffer_sources = {}
+endfunction"}}}
+
+function! s:source.hooks.on_post_filter(context) abort "{{{
+  " Filters too long word.
+  call filter(a:context.candidates,
+        \ 'len(v:val.word) < g:neocomplete#sources#buffer#max_keyword_width')
+endfunction"}}}
+
+function! s:source.gather_candidates(context) abort "{{{
+  call s:check_async_cache(a:context)
+
+  let keyword_list = []
+  for source in s:get_sources_list(a:context)
+    let keyword_list += source.words
+  endfor
+  return keyword_list
+endfunction"}}}
+
+function! neocomplete#sources#buffer#define() abort "{{{
+  return s:source
+endfunction"}}}
+
+function! neocomplete#sources#buffer#get_frequencies() abort "{{{
+  return get(get(s:buffer_sources, bufnr('%'), {}), 'frequencies', {})
+endfunction"}}}
+
+function! neocomplete#sources#buffer#make_cache_current_line() abort "{{{
+  if neocomplete#is_locked()
+    return
+  endif
+
+  " let start = reltime()
+  call s:make_cache_current_buffer(
+        \ max([1, line('.') - winline()]),
+        \ min([line('$'), line('.') + winheight(0) - winline()]))
+  " echomsg reltimestr(reltime(start))
+endfunction"}}}
+
+function! s:should_create_cache(bufnr) " {{{
+  let filepath = fnamemodify(bufname(a:bufnr), ':p')
+  return getfsize(filepath) < g:neocomplete#sources#buffer#cache_limit_size
+        \ && getbufvar(a:bufnr, '&modifiable')
+        \ && !getwinvar(bufwinnr(a:bufnr), '&previewwindow')
+        \ && (g:neocomplete#sources#buffer#disabled_pattern == ''
+        \  || filepath !~# g:neocomplete#sources#buffer#disabled_pattern)
+endfunction"}}}
+
+function! s:get_sources_list(context) abort "{{{
+  let filetypes_dict = {}
+  for filetype in a:context.filetypes
+    let filetypes_dict[filetype] = 1
+  endfor
+
+  return values(filter(copy(s:buffer_sources),
+        \ "has_key(filetypes_dict, v:val.filetype)
+        \ || has_key(filetypes_dict, '_')
+        \ || bufnr('%') == v:key
+        \ || (bufname('%') ==# '[Command Line]' && bufwinnr('#') == v:key)"))
+endfunction"}}}
+
+function! s:initialize_source(srcname) abort "{{{
+  let path = fnamemodify(bufname(a:srcname), ':p')
+  let filename = fnamemodify(path, ':t')
+  if filename == ''
+    let filename = '[No Name]'
+    let path .= '/[No Name]'
+  endif
+
+  let ft = getbufvar(a:srcname, '&filetype')
+  if ft == ''
+    let ft = 'nothing'
+  endif
+
+  let keyword_pattern = neocomplete#get_keyword_pattern(ft, s:source.name)
+
+  let s:buffer_sources[a:srcname] = {
+        \ 'words' : [],
+        \ 'frequencies' : {},
+        \ 'name' : filename, 'filetype' : ft,
+        \ 'keyword_pattern' : keyword_pattern,
+        \ 'cached_time' : 0,
+        \ 'path' : path,
+        \ 'cache_name' : neocomplete#cache#encode_name('buffer_cache', path),
+        \}
+endfunction"}}}
+
+function! s:make_cache_file(srcname) abort "{{{
+  " Initialize source.
+  if !has_key(s:buffer_sources, a:srcname)
+    call s:initialize_source(a:srcname)
+  endif
+
+  let source = s:buffer_sources[a:srcname]
+
+  if !filereadable(source.path)
+        \ || getbufvar(a:srcname, '&modified')
+        \ || getbufvar(a:srcname, '&buftype') =~ 'nofile\|acwrite'
+    call s:make_cache_buffer(a:srcname)
+    return
+  endif
+
+  call neocomplete#print_debug('make_cache_buffer: ' . source.path)
+
+  let source.cache_name =
+        \ neocomplete#cache#async_load_from_file(
+        \     'buffer_cache', source.path,
+        \     source.keyword_pattern, 'B')
+  let source.cached_time = localtime()
+  let source.filetype = getbufvar(a:srcname, '&filetype')
+  let s:async_dictionary_list[source.path] = [{
+        \ 'filename' : source.path,
+        \ 'cachename' : source.cache_name,
+        \ }]
+endfunction"}}}
+
+function! s:make_cache_buffer(srcname) abort "{{{
+  if !s:should_create_cache(a:srcname)
+    return
+  endif
+
+  call neocomplete#print_debug('make_cache_buffer: ' . a:srcname)
+
+  if !s:exists_current_source()
+    call s:initialize_source(a:srcname)
+
+    if a:srcname ==# bufnr('%')
+      " Force sync cache
+      call s:make_cache_current_buffer(1, 1000)
+      return
+    endif
+  endif
+
+  let source = s:buffer_sources[a:srcname]
+  let temp = neocomplete#cache#getfilename(
+        \ 'buffer_temp', getpid() . '_' . a:srcname)
+  let lines = getbufline(a:srcname, 1, '$')
+  call writefile(lines, temp)
+
+  " Create temporary file
+  let source.cache_name =
+        \ neocomplete#cache#async_load_from_file(
+        \     'buffer_cache', temp,
+        \     source.keyword_pattern, 'B')
+  let source.cached_time = localtime()
+  let source.filetype = getbufvar(a:srcname, '&filetype')
+  if source.filetype == ''
+    let source.filetype = 'nothing'
+  endif
+  let s:async_dictionary_list[source.path] = [{
+        \ 'filename' : temp,
+        \ 'cachename' : source.cache_name,
+        \ }]
+endfunction"}}}
+
+function! s:check_changed_buffer(bufnr) abort "{{{
+  let source = s:buffer_sources[a:bufnr]
+
+  let ft = getbufvar(a:bufnr, '&filetype')
+  if ft == ''
+    let ft = 'nothing'
+  endif
+
+  let filename = fnamemodify(bufname(a:bufnr), ':t')
+  if filename == ''
+    let filename = '[No Name]'
+  endif
+
+  return source.name != filename || source.filetype != ft
+endfunction"}}}
+
+function! s:check_source() abort "{{{
+  " Check new buffer.
+  call map(filter(range(1, bufnr('$')), "
+        \ (v:val != bufnr('%') || neocomplete#has_vimproc())
+        \ && (!has_key(s:buffer_sources, v:val) && buflisted(v:val)
+        \   || (has_key(s:buffer_sources, v:val) &&
+        \     s:buffer_sources[v:val].cached_time
+        \         < getftime(s:buffer_sources[v:val].path)))
+        \ && (!neocomplete#is_locked(v:val) ||
+        \    g:neocomplete#disable_auto_complete)
+        \ && s:should_create_cache(v:val)
+        \ "), 's:make_cache_file(v:val)')
+
+  " Remove unlisted buffers.
+  call filter(s:buffer_sources,
+        \ "v:key == bufnr('%') || buflisted(str2nr(v:key))")
+endfunction"}}}
+
+function! s:exists_current_source() abort "{{{
+  return has_key(s:buffer_sources, bufnr('%')) &&
+        \ !s:check_changed_buffer(bufnr('%'))
+endfunction"}}}
+
+function! s:make_cache_current_buffer(start, end) abort "{{{
+  let srcname = bufnr('%')
+
+  " Make cache from current buffer.
+  if !s:should_create_cache(srcname)
+    return
+  endif
+
+  if !s:exists_current_source()
+    call s:initialize_source(srcname)
+  endif
+
+  let source = s:buffer_sources[srcname]
+  let keyword_pattern = source.keyword_pattern
+  if keyword_pattern == ''
+    return
+  endif
+
+  let words = []
+
+  lua << EOF
+do
+  local words = vim.eval('words')
+  local dup = {}
+  local min_length = vim.eval('g:neocomplete#min_keyword_length')
+  for linenr = vim.eval('a:start'), vim.eval('a:end') do
+    local match = 0
+    while 1 do
+      local match_str = vim.eval('matchstr(getline('..linenr..
+      '), keyword_pattern, ' .. match .. ')')
+      if match_str == '' then
+        break
+      end
+      if dup[match_str] == nil
+        and string.len(match_str) >= min_length then
+        dup[match_str] = 1
+        words:add(match_str)
+      end
+
+      -- Next match.
+      match = vim.eval('matchend(getline(' .. linenr ..
+        '), keyword_pattern, ' .. match .. ')')
+    end
+  end
+end
+EOF
+
+  let source.words = neocomplete#util#uniq(source.words + words)
+endfunction"}}}
+
+function! s:check_async_cache(context) abort "{{{
+  for source in s:get_sources_list(a:context)
+    if !has_key(s:async_dictionary_list, source.path)
+      continue
+    endif
+
+    " Load from cache.
+    let [loaded, file_cache] = neocomplete#cache#get_cache_list(
+          \ 'buffer_cache', s:async_dictionary_list[source.path])
+    if loaded
+      let source.words = file_cache
+    endif
+
+    if empty(s:async_dictionary_list[source.path])
+      call remove(s:async_dictionary_list, source.path)
+    endif
+  endfor
+endfunction"}}}
+
+function! s:clean() abort "{{{
+  " Remove temporary files
+  for file in glob(printf('%s/%d_*',
+        \ neocomplete#get_data_directory() . '/buffer_temp',
+        \ getpid()), 1, 1)
+    call delete(file)
+
+    let cachefile = neocomplete#get_data_directory() . '/buffer_cache/'
+          \ . substitute(substitute(file, ':', '=-', 'g'), '[/\\]', '=+', 'g')
+    if filereadable(cachefile)
+      call delete(cachefile)
+    endif
+  endfor
+endfunction"}}}
+
+" Command functions. "{{{
+function! neocomplete#sources#buffer#make_cache(name) abort "{{{
+  if !neocomplete#is_enabled()
+    call neocomplete#initialize()
+  endif
+
+  if a:name == ''
+    let number = bufnr('%')
+  else
+    let number = bufnr(a:name)
+
+    if number < 0
+      let bufnr = bufnr('%')
+
+      " No swap warning.
+      let save_shm = &shortmess
+      set shortmess+=A
+
+      " Open new buffer.
+      execute 'silent! edit' fnameescape(a:name)
+
+      let &shortmess = save_shm
+
+      if bufnr('%') != bufnr
+        setlocal nobuflisted
+        execute 'buffer' bufnr
+      endif
+    endif
+
+    let number = bufnr(a:name)
+  endif
+
+  call s:make_cache_file(number)
+endfunction"}}}
+"}}}
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: foldmethod=marker

+ 150 - 0
autoload/neocomplete/sources/dictionary.vim

@@ -0,0 +1,150 @@
+"=============================================================================
+" FILE: dictionary.vim
+" AUTHOR:  Shougo Matsushita <Shougo.Matsu@gmail.com>
+" License: MIT license  {{{
+"     Permission is hereby granted, free of charge, to any person obtaining
+"     a copy of this software and associated documentation files (the
+"     "Software"), to deal in the Software without restriction, including
+"     without limitation the rights to use, copy, modify, merge, publish,
+"     distribute, sublicense, and/or sell copies of the Software, and to
+"     permit persons to whom the Software is furnished to do so, subject to
+"     the following conditions:
+"
+"     The above copyright notice and this permission notice shall be included
+"     in all copies or substantial portions of the Software.
+"
+"     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+"     OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+"     MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+"     IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+"     CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+"     TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+"     SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+" }}}
+"=============================================================================
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+" Global options definition. "{{{
+let g:neocomplete#sources#dictionary#dictionaries =
+      \ get(g:, 'neocomplete#sources#dictionary#dictionaries', {})
+"}}}
+
+" Important variables.
+if !exists('s:dictionary_cache')
+  let s:dictionary_cache = {}
+  let s:async_dictionary_list = {}
+endif
+
+function! neocomplete#sources#dictionary#define() abort "{{{
+  return s:source
+endfunction"}}}
+
+let s:source = {
+      \ 'name' : 'dictionary',
+      \ 'kind' : 'keyword',
+      \ 'mark' : '[D]',
+      \ 'rank' : 4,
+      \ 'hooks' : {},
+      \}
+
+function! s:source.hooks.on_init(context) abort "{{{
+  augroup neocomplete "{{{
+    autocmd FileType * call s:make_cache(&l:filetype)
+  augroup END"}}}
+
+  " Create cache directory.
+  call neocomplete#cache#make_directory('dictionary_cache')
+
+  " Initialize check.
+  call s:make_cache(&l:filetype)
+endfunction"}}}
+
+function! s:source.hooks.on_final(context) abort "{{{
+  silent! delcommand NeoCompleteDictionaryMakeCache
+endfunction"}}}
+
+function! s:source.gather_candidates(context) abort "{{{
+  let list = []
+
+  for ft in a:context.filetypes
+    if !has_key(s:dictionary_cache, ft)
+      call s:make_cache(ft)
+    endif
+    call neocomplete#cache#check_cache(
+          \ 'dictionary_cache', ft,
+          \ s:async_dictionary_list, s:dictionary_cache, 1)
+
+    let list += get(s:dictionary_cache, ft, [])
+  endfor
+
+  return list
+endfunction"}}}
+
+function! s:make_cache(filetype) abort "{{{
+  if !has_key(s:dictionary_cache, a:filetype)
+        \ && !has_key(s:async_dictionary_list, a:filetype)
+    call neocomplete#sources#dictionary#remake_cache(a:filetype)
+  endif
+endfunction"}}}
+
+function! neocomplete#sources#dictionary#remake_cache(filetype) abort "{{{
+  if !neocomplete#is_enabled()
+    call neocomplete#initialize()
+  endif
+
+  let filetype = a:filetype
+  if filetype == ''
+    let filetype = neocomplete#get_context_filetype(1)
+  endif
+
+  if !has_key(s:async_dictionary_list, filetype)
+    let s:async_dictionary_list[filetype] = []
+  endif
+
+  let pattern = neocomplete#get_keyword_pattern(filetype, s:source.name)
+  for dictionary in neocomplete#sources#dictionary#get_dictionaries(filetype)
+    let dictionary = neocomplete#util#substitute_path_separator(
+          \ fnamemodify(dictionary, ':p'))
+    if filereadable(dictionary)
+      call neocomplete#print_debug('Make cache dictionary: ' . dictionary)
+      call add(s:async_dictionary_list[filetype], {
+            \ 'filename' : dictionary,
+            \ 'cachename' : neocomplete#cache#async_load_from_file(
+            \       'dictionary_cache', dictionary, pattern, 'D')
+            \ })
+    endif
+  endfor
+endfunction"}}}
+
+function! neocomplete#sources#dictionary#get_dictionaries(filetype) abort "{{{
+  let filetype = a:filetype
+  if filetype == ''
+    let filetype = neocomplete#get_context_filetype(1)
+  endif
+
+  " Make cache.
+  let dictionaries = get(
+        \ g:neocomplete#sources#dictionary#dictionaries, filetype, '')
+  if has_key(g:neocomplete#sources#dictionary#dictionaries, '_')
+    " Load global dictionaries.
+    let dictionaries .= ',' .
+          \ g:neocomplete#sources#dictionary#dictionaries['_']
+  endif
+
+  if dictionaries == '' && &l:dictionary != ''
+    if ((filetype ==# 'nothing' && &filetype == '')
+          \ || filetype ==# &filetype)
+          \ && &l:dictionary !=# &g:dictionary
+      let dictionaries = &l:dictionary
+    endif
+  endif
+
+  return split(dictionaries, ',')
+endfunction"}}}
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: foldmethod=marker

+ 159 - 0
autoload/neocomplete/sources/file.vim

@@ -0,0 +1,159 @@
+"=============================================================================
+" FILE: file.vim
+" AUTHOR:  Shougo Matsushita <Shougo.Matsu@gmail.com>
+" License: MIT license  {{{
+"     Permission is hereby granted, free of charge, to any person obtaining
+"     a copy of this software and associated documentation files (the
+"     "Software"), to deal in the Software without restriction, including
+"     without limitation the rights to use, copy, modify, merge, publish,
+"     distribute, sublicense, and/or sell copies of the Software, and to
+"     permit persons to whom the Software is furnished to do so, subject to
+"     the following conditions:
+"
+"     The above copyright notice and this permission notice shall be included
+"     in all copies or substantial portions of the Software.
+"
+"     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+"     OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+"     MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+"     IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+"     CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+"     TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+"     SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+" }}}
+"=============================================================================
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+let s:source = {
+      \ 'name' : 'file',
+      \ 'kind' : 'manual',
+      \ 'mark' : '[F]',
+      \ 'rank' : 10,
+      \ 'sorters' : 'sorter_filename',
+      \ 'converters' : ['converter_remove_overlap', 'converter_abbr'],
+      \ 'is_volatile' : 1,
+      \ 'input_pattern': '/',
+      \}
+
+function! s:source.get_complete_position(context) abort "{{{
+  let filetype = a:context.filetype
+  if filetype ==# 'vimshell' || filetype ==# 'unite' || filetype ==# 'int-ssh'
+    return -1
+  endif
+
+  " Filename pattern.
+  let pattern = neocomplete#get_keyword_pattern_end('filename', self.name)
+  let [complete_pos, complete_str] =
+        \ neocomplete#helper#match_word(a:context.input, pattern)
+
+  if complete_str =~ '//' || complete_str == '/' ||
+        \ (neocomplete#is_auto_complete() &&
+        \     complete_str !~ '/' ||
+        \     complete_str =~#
+        \          '\\[^ ;*?[]"={}'']\|\.\.\+$\|/c\%[ygdrive/]$\|\${')
+    " Not filename pattern.
+    return -1
+  endif
+
+  if complete_str =~ '/'
+    let complete_pos += strridx(complete_str, '/') + 1
+  endif
+
+  return complete_pos
+endfunction"}}}
+
+function! s:source.gather_candidates(context) abort "{{{
+  let pattern = neocomplete#get_keyword_pattern_end('filename', self.name)
+  let complete_str =
+        \ neocomplete#helper#match_word(a:context.input, pattern)[1]
+  if neocomplete#is_windows() && complete_str =~ '^[\\/]'
+    return []
+  endif
+
+  let cwd = getcwd()
+  try
+    let buffer_dir = fnamemodify(bufname('%'), ':h')
+    if isdirectory(buffer_dir)
+      " cd to buffer directory.
+      execute 'lcd' fnameescape(buffer_dir)
+    endif
+
+    let files = s:get_glob_files(complete_str, '')
+  finally
+    execute 'lcd' fnameescape(cwd)
+  endtry
+
+  return files
+endfunction"}}}
+
+let s:cached_files = {}
+
+function! s:get_glob_files(complete_str, path) abort "{{{
+  let path = ',,' . substitute(a:path, '\.\%(,\|$\)\|,,', '', 'g')
+
+  let complete_str = neocomplete#util#substitute_path_separator(
+        \ substitute(a:complete_str, '\\\(.\)', '\1', 'g'))
+  let complete_str = substitute(complete_str, '[^/.]\+$', '', '')
+
+  " Note: Support ${env}
+  let complete_str = substitute(complete_str, '\${\(\w\+\)}', '$\1', 'g')
+
+  let glob = (complete_str !~ '\*$')?
+        \ complete_str . '*' : complete_str
+
+  let ftype = getftype(glob)
+  if ftype != '' && ftype !=# 'dir'
+    " Note: If glob() device files, Vim may freeze!
+    return []
+  endif
+
+  if a:path == ''
+    let files = neocomplete#util#glob(glob)
+  else
+    try
+      let globs = globpath(path, glob)
+    catch
+      return []
+    endtry
+    let files = split(substitute(globs, '\\', '/', 'g'), '\n')
+  endif
+
+  call filter(files, 'v:val !~ "/\\.\\.\\?$"')
+
+  let files = map(
+        \ files, "{
+        \    'word' : fnamemodify(v:val, ':t'),
+        \    'action__is_directory' : isdirectory(v:val),
+        \    'kind' : (isdirectory(v:val) ? 'dir' : 'file'),
+        \ }")
+
+  let candidates = []
+  for dict in files
+    let abbr = dict.word
+    if dict.action__is_directory && dict.word !~ '/$'
+      let abbr .= '/'
+      if g:neocomplete#enable_auto_delimiter
+        let dict.word .= '/'
+      endif
+    endif
+    let dict.abbr = abbr
+
+    " Escape word.
+    let dict.word = escape(dict.word, ' ;*?[]"={}''')
+
+    call add(candidates, dict)
+  endfor
+
+  return candidates
+endfunction"}}}
+
+function! neocomplete#sources#file#define() abort "{{{
+  return s:source
+endfunction"}}}
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: foldmethod=marker

+ 277 - 0
autoload/neocomplete/sources/member.vim

@@ -0,0 +1,277 @@
+"=============================================================================
+" FILE: member.vim
+" AUTHOR:  Shougo Matsushita <Shougo.Matsu@gmail.com>
+" License: MIT license  {{{
+"     Permission is hereby granted, free of charge, to any person obtaining
+"     a copy of this software and associated documentation files (the
+"     "Software"), to deal in the Software without restriction, including
+"     without limitation the rights to use, copy, modify, merge, publish,
+"     distribute, sublicense, and/or sell copies of the Software, and to
+"     permit persons to whom the Software is furnished to do so, subject to
+"     the following conditions:
+"
+"     The above copyright notice and this permission notice shall be included
+"     in all copies or substantial portions of the Software.
+"
+"     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+"     OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+"     MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+"     IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+"     CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+"     TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+"     SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+" }}}
+"=============================================================================
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+" Global options definition. "{{{
+let g:neocomplete#sources#member#prefix_patterns =
+      \ get(g:, 'neocomplete#sources#member#prefix_patterns', {})
+let g:neocomplete#sources#member#input_patterns =
+      \ get(g:, 'neocomplete#sources#member#input_patterns', {})
+"}}}
+
+" Important variables.
+if !exists('s:member_sources')
+  let s:member_sources = {}
+endif
+
+let s:source = {
+      \ 'name' : 'member',
+      \ 'kind' : 'manual',
+      \ 'mark' : '[M]',
+      \ 'rank' : 5,
+      \ 'min_pattern_length' : 0,
+      \ 'hooks' : {},
+      \ 'is_volatile' : 1,
+      \}
+
+function! s:source.hooks.on_init(context) abort "{{{
+  augroup neocomplete "{{{
+    " Make cache events
+    autocmd CursorHold * call s:make_cache_current_buffer(
+          \ line('.')-10, line('.')+10)
+    autocmd InsertEnter,InsertLeave *
+          \ call neocomplete#sources#member#make_cache_current_line()
+    autocmd FileType *
+          \ call neocomplete#sources#member#remake_cache(&l:filetype)
+  augroup END"}}}
+
+  " Initialize member prefix patterns. "{{{
+  call neocomplete#util#set_default_dictionary(
+        \ 'g:neocomplete#sources#member#prefix_patterns',
+        \ '_', '\.')
+  call neocomplete#util#set_default_dictionary(
+        \ 'g:neocomplete#sources#member#prefix_patterns',
+        \ 'c,objc', '\.\|->')
+  call neocomplete#util#set_default_dictionary(
+        \ 'g:neocomplete#sources#member#prefix_patterns',
+        \ 'cpp,objcpp', '\.\|->\|::')
+  call neocomplete#util#set_default_dictionary(
+        \ 'g:neocomplete#sources#member#prefix_patterns',
+        \ 'perl,php', '->')
+  call neocomplete#util#set_default_dictionary(
+        \ 'g:neocomplete#sources#member#prefix_patterns',
+        \ 'ruby', '\.\|::')
+  call neocomplete#util#set_default_dictionary(
+        \ 'g:neocomplete#sources#member#prefix_patterns',
+        \ 'lua', '\.\|:')
+  "}}}
+
+  " Initialize member patterns. "{{{
+  call neocomplete#util#set_default_dictionary(
+        \ 'g:neocomplete#sources#member#input_patterns',
+        \ '_', '\h\w*\%(()\?\|\[\h\w*\]\)\?')
+  "}}}
+
+  " Initialize script variables. "{{{
+  let s:member_sources = {}
+  "}}}
+endfunction
+"}}}
+
+function! s:source.get_complete_position(context) abort "{{{
+  " Check member prefix pattern.
+  let filetype = a:context.filetype
+  let prefix = get(g:neocomplete#sources#member#prefix_patterns, filetype,
+        \ get(g:neocomplete#sources#member#prefix_patterns, '_', ''))
+  if prefix == ''
+    return -1
+  endif
+
+  let member = s:get_member_pattern(filetype)
+  let complete_pos = matchend(a:context.input,
+        \ member . '\m\%(' . prefix . '\m\)\ze\w*$')
+  return complete_pos
+endfunction"}}}
+
+function! s:source.gather_candidates(context) abort "{{{
+  " Check member prefix pattern.
+  let filetype = a:context.filetype
+  let prefix = get(g:neocomplete#sources#member#prefix_patterns, filetype,
+        \ get(g:neocomplete#sources#member#prefix_patterns, '_', ''))
+  if prefix == ''
+    return []
+  endif
+
+  call neocomplete#sources#member#remake_cache(filetype)
+
+  let var_name = matchstr(a:context.input,
+        \ s:get_member_pattern(filetype) . '\m\%(' .
+        \ prefix . '\m\)\ze\w*$')
+  if var_name == ''
+    return []
+  endif
+
+  return s:get_member_list(a:context, a:context.input, var_name)
+endfunction"}}}
+
+function! neocomplete#sources#member#define() abort "{{{
+  return s:source
+endfunction"}}}
+
+function! neocomplete#sources#member#make_cache_current_line() abort "{{{
+  if !neocomplete#is_enabled()
+    call neocomplete#initialize()
+  endif
+
+  " Make cache from current line.
+  return s:make_cache_current_buffer(line('.')-1, line('.')+1)
+endfunction"}}}
+function! neocomplete#sources#member#make_cache_current_buffer() abort "{{{
+  if !neocomplete#is_enabled()
+    call neocomplete#initialize()
+  endif
+
+  " Make cache from current buffer.
+  return s:make_cache_current_buffer(1, line('$'))
+endfunction"}}}
+function! s:make_cache_current_buffer(start, end) abort "{{{
+  let filetype = neocomplete#get_context_filetype(1)
+
+  if !has_key(s:member_sources, bufnr('%'))
+    call s:initialize_source(bufnr('%'), filetype)
+  endif
+
+  call s:make_cache_lines(bufnr('%'), filetype, getline(a:start, a:end))
+endfunction"}}}
+function! s:make_cache_lines(srcname, filetype, lines) abort "{{{
+  let filetype = a:filetype
+  if !has_key(s:member_sources, a:srcname)
+    call s:initialize_source(a:srcname, filetype)
+  endif
+
+  let prefix = get(g:neocomplete#sources#member#prefix_patterns, filetype,
+        \ get(g:neocomplete#sources#member#prefix_patterns, '_', ''))
+  if prefix == ''
+    return
+  endif
+  let source = s:member_sources[a:srcname]
+  let member_pattern = s:get_member_pattern(filetype)
+  let prefix_pattern = member_pattern . '\m\%(' . prefix . '\m\)'
+  let keyword_pattern =
+        \ prefix_pattern . member_pattern
+
+  " Cache member pattern.
+  for line in a:lines
+    let match = match(line, keyword_pattern)
+
+    while match >= 0 "{{{
+      let match_str = matchstr(line, '^'.keyword_pattern, match)
+
+      " Next match.
+      let match = matchend(line, prefix_pattern, match)
+
+      let member_name = matchstr(match_str, member_pattern . '$')
+      if member_name == ''
+        continue
+      endif
+      let var_name = match_str[ : -len(member_name)-1]
+
+      if !has_key(source.member_cache, var_name)
+        let source.member_cache[var_name] = {}
+      endif
+      if !has_key(source.member_cache[var_name], member_name)
+        let source.member_cache[var_name][member_name] = 1
+      endif
+
+      let match_str = matchstr(var_name, '^'.keyword_pattern)
+    endwhile"}}}
+  endfor
+endfunction"}}}
+
+function! s:get_member_list(context, cur_text, var_name) abort "{{{
+  let keyword_list = []
+  for source in filter(s:get_sources_list(a:context),
+        \ 'has_key(v:val.member_cache, a:var_name)')
+    let keyword_list +=
+          \ keys(source.member_cache[a:var_name])
+  endfor
+
+  return keyword_list
+endfunction"}}}
+
+function! s:get_sources_list(context) abort "{{{
+  let filetypes_dict = {}
+  for filetype in a:context.filetypes
+    let filetypes_dict[filetype] = 1
+  endfor
+
+  return values(filter(copy(s:member_sources),
+        \ "has_key(filetypes_dict, v:val.filetype)
+        \ || has_key(filetypes_dict, '_')
+        \ || bufnr('%') == v:key
+        \ || (bufname('%') ==# '[Command Line]' && bufwinnr('#') == v:key)"))
+endfunction"}}}
+
+function! s:initialize_source(srcname, filetype) abort "{{{
+  let path = (a:srcname=~ '^\d\+$') ?
+        \ fnamemodify(bufname(a:srcname), ':p') : a:srcname
+  let filename = fnamemodify(path, ':t')
+  if filename == ''
+    let filename = '[No Name]'
+    let path .= '/[No Name]'
+  endif
+
+  let ft = a:filetype
+  if ft == ''
+    let ft = 'nothing'
+  endif
+
+  let s:member_sources[a:srcname] = {
+        \ 'member_cache' : {}, 'filetype' : ft,
+        \ 'time' : getftime(path),
+        \ 'keyword_pattern' : neocomplete#get_keyword_pattern(ft, s:source.name),
+        \}
+endfunction"}}}
+
+function! s:get_member_pattern(filetype) abort "{{{
+  return get(g:neocomplete#sources#member#input_patterns, a:filetype,
+        \ get(g:neocomplete#sources#member#input_patterns, '_', ''))
+endfunction"}}}
+
+function! neocomplete#sources#member#remake_cache(filetype) abort "{{{
+  if !neocomplete#is_enabled()
+    call neocomplete#initialize()
+  endif
+
+  if get(g:neocomplete#sources#member#prefix_patterns, a:filetype, '') == ''
+    return
+  endif
+
+  for dictionary in
+        \ filter(map(neocomplete#sources#dictionary#get_dictionaries(a:filetype),
+        \  "neocomplete#util#substitute_path_separator(
+        \      fnamemodify(v:val, ':p'))"),
+        \ "filereadable(v:val) && (!has_key(s:member_sources, v:val)
+        \    || getftime(v:val) > s:member_sources[v:val].time)")
+    call s:make_cache_lines(dictionary, a:filetype, readfile(dictionary))
+  endfor
+endfunction"}}}
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: foldmethod=marker

+ 294 - 0
autoload/neocomplete/sources/omni.vim

@@ -0,0 +1,294 @@
+"=============================================================================
+" FILE: omni.vim
+" AUTHOR:  Shougo Matsushita <Shougo.Matsu@gmail.com>
+" License: MIT license  {{{
+"     Permission is hereby granted, free of charge, to any person obtaining
+"     a copy of this software and associated documentation files (the
+"     "Software"), to deal in the Software without restriction, including
+"     without limitation the rights to use, copy, modify, merge, publish,
+"     distribute, sublicense, and/or sell copies of the Software, and to
+"     permit persons to whom the Software is furnished to do so, subject to
+"     the following conditions:
+"
+"     The above copyright notice and this permission notice shall be included
+"     in all copies or substantial portions of the Software.
+"
+"     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+"     OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+"     MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+"     IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+"     CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+"     TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+"     SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+" }}}
+"=============================================================================
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+" Global options definition. "{{{
+let g:neocomplete#sources#omni#functions =
+      \ get(g:, 'neocomplete#sources#omni#functions', {})
+let g:neocomplete#sources#omni#input_patterns =
+      \ get(g:, 'neocomplete#sources#omni#input_patterns', {})
+"}}}
+
+let s:source = {
+      \ 'name' : 'omni',
+      \ 'kind' : 'manual',
+      \ 'mark' : '[O]',
+      \ 'rank' : 50,
+      \ 'min_pattern_length' : 0,
+      \ 'hooks' : {},
+      \}
+
+let s:List = neocomplete#util#get_vital().import('Data.List')
+
+function! s:source.hooks.on_init(context) abort "{{{
+  " Initialize omni completion pattern. "{{{
+  call neocomplete#util#set_default_dictionary(
+        \'g:neocomplete#sources#omni#input_patterns',
+        \'html,xhtml,xml,markdown,mkd',
+        \'<\|\s[[:alnum:]-]*')
+  call neocomplete#util#set_default_dictionary(
+        \'g:neocomplete#sources#omni#input_patterns',
+        \'css,scss,sass',
+        \'\w\{' . g:neocomplete#min_keyword_length . '\}\|\w\+[):;]\s*\w*\|[@!]')
+  call neocomplete#util#set_default_dictionary(
+        \'g:neocomplete#sources#omni#input_patterns',
+        \'javascript',
+        \'[^. \t]\.\%(\h\w*\)\?')
+  call neocomplete#util#set_default_dictionary(
+        \'g:neocomplete#sources#omni#input_patterns',
+        \'actionscript',
+        \'[^. \t][.:]\h\w*')
+  "call neocomplete#util#set_default_dictionary(
+        "\'g:neocomplete#sources#omni#input_patterns',
+        "\'php',
+        "\'[^. \t]->\h\w*\|\h\w*::\w*')
+  call neocomplete#util#set_default_dictionary(
+        \'g:neocomplete#sources#omni#input_patterns',
+        \'java',
+        \'\%(\h\w*\|)\)\.\w*')
+  "call neocomplete#util#set_default_dictionary(
+        "\'g:neocomplete#sources#omni#input_patterns',
+        "\'perl',
+        "\'\h\w*->\h\w*\|\h\w*::\w*')
+  "call neocomplete#util#set_default_dictionary(
+        "\'g:neocomplete#sources#omni#input_patterns',
+        "\'c',
+        "\'[^.[:digit:] *\t]\%(\.\|->\)\w*'
+  "call neocomplete#util#set_default_dictionary(
+        "\'g:neocomplete#sources#omni#input_patterns',
+        "\'cpp',
+        "\'[^.[:digit:] *\t]\%(\.\|->\)\w*\|\h\w*::\w*')
+  call neocomplete#util#set_default_dictionary(
+        \'g:neocomplete#sources#omni#input_patterns',
+        \'objc',
+        \'[^.[:digit:] *\t]\%(\.\|->\)\w*')
+  call neocomplete#util#set_default_dictionary(
+        \'g:neocomplete#sources#omni#input_patterns',
+        \'objj',
+        \'[\[ \.]\w\+$\|:\w*$')
+  call neocomplete#util#set_default_dictionary(
+        \'g:neocomplete#sources#omni#input_patterns',
+        \'go',
+        \'[^.[:digit:] *\t]\.\w*')
+  call neocomplete#util#set_default_dictionary(
+        \'g:neocomplete#sources#omni#input_patterns',
+        \'clojure',
+        \'\%(([^)]\+\)\|\*[[:alnum:]_-]\+')
+  call neocomplete#util#set_default_dictionary(
+        \'g:neocomplete#sources#omni#input_patterns',
+        \'rust',
+        \'[^.[:digit:] *\t]\%(\.\|\::\)\%(\h\w*\)\?')
+
+  " External language interface check.
+  if has('ruby')
+    " call neocomplete#util#set_default_dictionary(
+          "\'g:neocomplete#sources#omni#input_patterns', 'ruby',
+          "\'[^. *\t]\.\h\w*\|\h\w*::\w*')
+  endif
+  if has('python') || has('python3')
+    call neocomplete#util#set_default_dictionary(
+          \'g:neocomplete#sources#omni#input_patterns',
+          \'python', '[^. \t]\.\w*')
+  endif
+  "}}}
+endfunction"}}}
+
+function! s:source.get_complete_position(context) abort "{{{
+  let a:context.source__complete_results =
+        \ s:set_complete_results_pos(
+        \   s:get_omni_funcs(a:context.filetype), a:context.input)
+
+  return s:get_complete_pos(a:context.source__complete_results)
+endfunction"}}}
+
+function! s:source.gather_candidates(context) abort "{{{
+  return s:get_candidates(
+        \ s:set_complete_results_words(
+        \  a:context.source__complete_results),
+        \  a:context.complete_pos, a:context.complete_str)
+endfunction"}}}
+
+function! neocomplete#sources#omni#define() abort "{{{
+  return s:source
+endfunction"}}}
+
+function! s:get_omni_funcs(filetype) abort "{{{
+  let funcs = []
+  for ft in insert(split(a:filetype, '\.'), '_')
+    let omnifuncs = neocomplete#util#convert2list(
+          \ get(g:neocomplete#sources#omni#functions, ft, &l:omnifunc))
+
+    for omnifunc in omnifuncs
+      if neocomplete#helper#check_invalid_omnifunc(omnifunc)
+        " omnifunc is irregal.
+        continue
+      endif
+
+      if get(g:neocomplete#sources#omni#input_patterns, omnifunc, '') != ''
+        let pattern = g:neocomplete#sources#omni#input_patterns[omnifunc]
+      elseif get(g:neocomplete#sources#omni#input_patterns, ft, '') != ''
+        let pattern = g:neocomplete#sources#omni#input_patterns[ft]
+      else
+        let pattern = ''
+      endif
+
+      if pattern == ''
+        continue
+      endif
+
+      call add(funcs, [omnifunc, pattern])
+    endfor
+  endfor
+
+  return s:List.uniq(funcs)
+endfunction"}}}
+function! s:get_omni_list(list) abort "{{{
+  let omni_list = []
+
+  " Convert string list.
+  for val in deepcopy(a:list)
+    let dict = (type(val) == type('') ?
+          \ { 'word' : val } : val)
+    call add(omni_list, dict)
+
+    unlet val
+  endfor
+
+  return omni_list
+endfunction"}}}
+
+function! s:set_complete_results_pos(funcs, cur_text) abort "{{{
+  " Try omnifunc completion. "{{{
+  let complete_results = {}
+  for [omnifunc, pattern] in a:funcs
+    if neocomplete#is_auto_complete()
+          \ && (pattern == ''
+          \     || a:cur_text !~# '\%(' . pattern . '\m\)$')
+      continue
+    endif
+
+    " Save pos.
+    let pos = getpos('.')
+
+    try
+      let complete_pos = call(omnifunc, [1, ''])
+    catch
+      call neocomplete#print_error(
+            \ 'Error occurred calling omnifunction: ' . omnifunc)
+      call neocomplete#print_error(v:throwpoint)
+      call neocomplete#print_error(v:exception)
+      let complete_pos = -1
+    finally
+      if getpos('.') != pos
+        call setpos('.', pos)
+      endif
+    endtry
+
+    if complete_pos < 0
+      continue
+    endif
+
+    let complete_str = a:cur_text[complete_pos :]
+
+    let complete_results[omnifunc] = {
+          \ 'candidates' : [],
+          \ 'complete_pos' : complete_pos,
+          \ 'complete_str' : complete_str,
+          \ 'omnifunc' : omnifunc,
+          \}
+  endfor
+  "}}}
+
+  return complete_results
+endfunction"}}}
+function! s:set_complete_results_words(complete_results) abort "{{{
+  " Try source completion.
+  for [omnifunc, result] in items(a:complete_results)
+    if neocomplete#complete_check()
+      return a:complete_results
+    endif
+
+    let pos = getpos('.')
+
+    try
+      let ret = call(omnifunc, [0, result.complete_str])
+      let list = type(ret) == type(0) ? [] :
+            \ type(ret) == type([]) ? ret : ret.words
+    catch
+      call neocomplete#print_error(
+            \ 'Error occurred calling omnifunction: ' . omnifunc)
+      call neocomplete#print_error(v:throwpoint)
+      call neocomplete#print_error(v:exception)
+      let list = []
+    finally
+      call setpos('.', pos)
+    endtry
+
+    let list = s:get_omni_list(list)
+
+    let result.candidates = list
+  endfor
+
+  return a:complete_results
+endfunction"}}}
+function! s:get_complete_pos(complete_results) abort "{{{
+  if empty(a:complete_results)
+    return -1
+  endif
+
+  let complete_pos = col('.')
+  for result in values(a:complete_results)
+    if complete_pos > result.complete_pos
+      let complete_pos = result.complete_pos
+    endif
+  endfor
+
+  return complete_pos
+endfunction"}}}
+function! s:get_candidates(complete_results, complete_pos, complete_str) abort "{{{
+  " Append prefix.
+  let candidates = []
+  for result in values(a:complete_results)
+    if result.complete_pos > a:complete_pos
+      let prefix = a:complete_str[: result.complete_pos
+            \                            - a:complete_pos - 1]
+
+      for keyword in result.candidates
+        let keyword.word = prefix . keyword.word
+      endfor
+    endif
+
+    let candidates += result.candidates
+  endfor
+
+  return candidates
+endfunction"}}}
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: foldmethod=marker

+ 120 - 0
autoload/neocomplete/sources/tag.vim

@@ -0,0 +1,120 @@
+"=============================================================================
+" FILE: tag.vim
+" AUTHOR:  Shougo Matsushita <Shougo.Matsu@gmail.com>
+" License: MIT license  {{{
+"     Permission is hereby granted, free of charge, to any person obtaining
+"     a copy of this software and associated documentation files (the
+"     "Software"), to deal in the Software without restriction, including
+"     without limitation the rights to use, copy, modify, merge, publish,
+"     distribute, sublicense, and/or sell copies of the Software, and to
+"     permit persons to whom the Software is furnished to do so, subject to
+"     the following conditions:
+"
+"     The above copyright notice and this permission notice shall be included
+"     in all copies or substantial portions of the Software.
+"
+"     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+"     OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+"     MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+"     IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+"     CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+"     TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+"     SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+" }}}
+"=============================================================================
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+" Important variables.
+if !exists('s:tags_list')
+  let s:tags_list = {}
+  let s:async_tags_list = {}
+endif
+
+let s:source = {
+      \ 'name' : 'tag',
+      \ 'kind' : 'keyword',
+      \ 'mark' : '[T]',
+      \ 'hooks' : {},
+      \}
+
+function! s:source.hooks.on_init(context) abort "{{{
+  let g:neocomplete#sources#tags#cache_limit_size =
+        \ get(g:, 'neocomplete#sources#tags#cache_limit_size', 500000)
+
+  augroup neocomplete "{{{
+    autocmd BufWritePost * call neocomplete#sources#tag#make_cache(0)
+  augroup END"}}}
+
+  " Create cache directory.
+  call neocomplete#cache#make_directory('tags_cache')
+endfunction"}}}
+
+function! s:source.hooks.on_final(context) abort "{{{
+  silent! delcommand NeoCompleteTagMakeCache
+endfunction"}}}
+
+function! neocomplete#sources#tag#define() abort "{{{
+  return s:source
+endfunction"}}}
+
+function! s:source.gather_candidates(context) abort "{{{
+  if !has_key(s:async_tags_list, bufnr('%'))
+        \ && !has_key(s:tags_list, bufnr('%'))
+    call neocomplete#sources#tag#make_cache(0)
+  endif
+
+  if neocomplete#within_comment()
+    return []
+  endif
+
+  call neocomplete#cache#check_cache(
+        \ 'tags_cache', bufnr('%'), s:async_tags_list, s:tags_list, 0)
+
+  return copy(get(s:tags_list, bufnr('%'), []))
+endfunction"}}}
+
+function! s:initialize_tags(filename) abort "{{{
+  " Initialize tags list.
+  let ft = &filetype
+  if ft == ''
+    let ft = 'nothing'
+  endif
+
+  return {
+        \ 'filename' : a:filename,
+        \ 'cachename' : neocomplete#cache#async_load_from_tags(
+        \              'tags_cache', a:filename,
+        \              neocomplete#get_keyword_pattern(ft, s:source.name),
+        \              ft, s:source.mark)
+        \ }
+endfunction"}}}
+function! neocomplete#sources#tag#make_cache(force) abort "{{{
+  if !neocomplete#is_enabled()
+    call neocomplete#initialize()
+  endif
+
+  let bufnumber = bufnr('%')
+
+  let s:async_tags_list[bufnumber] = []
+  let tagfiles = tagfiles()
+  if get(g:, 'loaded_neoinclude', 0)
+    let tagfiles += neoinclude#include#get_tag_files()
+  endif
+  for tags in map(filter(tagfiles, 'getfsize(v:val) > 0'),
+        \ "neocomplete#util#substitute_path_separator(
+        \    fnamemodify(v:val, ':p'))")
+    if tags !~? '/doc/tags\%(-\w\+\)\?$' &&
+          \ (a:force || getfsize(tags)
+          \         < g:neocomplete#sources#tags#cache_limit_size)
+      call add(s:async_tags_list[bufnumber],
+            \ s:initialize_tags(tags))
+    endif
+  endfor
+endfunction"}}}
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: foldmethod=marker

+ 264 - 0
autoload/neocomplete/util.vim

@@ -0,0 +1,264 @@
+"=============================================================================
+" FILE: util.vim
+" AUTHOR: Shougo Matsushita <Shougo.Matsu@gmail.com>
+" License: MIT license  {{{
+"     Permission is hereby granted, free of charge, to any person obtaining
+"     a copy of this software and associated documentation files (the
+"     "Software"), to deal in the Software without restriction, including
+"     without limitation the rights to use, copy, modify, merge, publish,
+"     distribute, sublicense, and/or sell copies of the Software, and to
+"     permit persons to whom the Software is furnished to do so, subject to
+"     the following conditions:
+"
+"     The above copyright notice and this permission notice shall be included
+"     in all copies or substantial portions of the Software.
+"
+"     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+"     OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+"     MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+"     IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+"     CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+"     TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+"     SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+" }}}
+"=============================================================================
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+
+function! neocomplete#util#get_vital() abort "{{{
+  if !exists('s:V')
+    let s:V = vital#neocomplete#new()
+  endif
+  return s:V
+endfunction"}}}
+function! s:get_prelude() abort "{{{
+  if !exists('s:Prelude')
+    let s:Prelude = neocomplete#util#get_vital().import('Prelude')
+  endif
+  return s:Prelude
+endfunction"}}}
+function! s:get_list() abort "{{{
+  if !exists('s:List')
+    let s:List = neocomplete#util#get_vital().import('Data.List')
+  endif
+  return s:List
+endfunction"}}}
+function! s:get_string() abort "{{{
+  if !exists('s:String')
+    let s:String = neocomplete#util#get_vital().import('Data.String')
+  endif
+  return s:String
+endfunction"}}}
+function! s:get_process() abort "{{{
+  if !exists('s:Process')
+    let s:Process = neocomplete#util#get_vital().import('Process')
+  endif
+  return s:Process
+endfunction"}}}
+
+function! neocomplete#util#truncate_smart(...) abort "{{{
+  return call(s:get_string().truncate_skipping, a:000)
+endfunction"}}}
+function! neocomplete#util#truncate(...) abort "{{{
+  return call(s:get_string().truncate, a:000)
+endfunction"}}}
+function! neocomplete#util#strchars(...) abort "{{{
+  return call(s:get_string().strchars, a:000)
+endfunction"}}}
+function! neocomplete#util#wcswidth(string) abort "{{{
+  return strwidth(a:string)
+endfunction"}}}
+function! neocomplete#util#strwidthpart(...) abort "{{{
+  return call(s:get_string().strwidthpart, a:000)
+endfunction"}}}
+function! neocomplete#util#strwidthpart_reverse(...) abort "{{{
+  return call(s:get_string().strwidthpart_reverse, a:000)
+endfunction"}}}
+
+function! neocomplete#util#substitute_path_separator(...) abort "{{{
+  return call(s:get_prelude().substitute_path_separator, a:000)
+endfunction"}}}
+function! neocomplete#util#mb_strlen(...) abort "{{{
+  return call(s:get_string().strchars, a:000)
+endfunction"}}}
+function! neocomplete#util#uniq(list) abort "{{{
+  let dict = {}
+  for item in a:list
+    if !has_key(dict, item)
+      let dict[item] = item
+    endif
+  endfor
+
+  return values(dict)
+endfunction"}}}
+function! neocomplete#util#system(...) abort "{{{
+  return call(s:get_process().system, a:000)
+endfunction"}}}
+function! neocomplete#util#is_windows(...) abort "{{{
+  return call(s:get_prelude().is_windows, a:000)
+endfunction"}}}
+function! neocomplete#util#is_mac(...) abort "{{{
+  return call(s:get_prelude().is_mac, a:000)
+endfunction"}}}
+function! neocomplete#util#is_complete_select() abort "{{{
+  return has('patch-7.4.775')
+endfunction"}}}
+function! neocomplete#util#get_last_status(...) abort "{{{
+  return call(s:get_process().get_last_status, a:000)
+endfunction"}}}
+function! neocomplete#util#escape_pattern(...) abort "{{{
+  return call(s:get_string().escape_pattern, a:000)
+endfunction"}}}
+function! neocomplete#util#iconv(...) abort "{{{
+  return call(s:get_process().iconv, a:000)
+endfunction"}}}
+function! neocomplete#util#uniq(...) abort "{{{
+  return call(s:get_list().uniq, a:000)
+endfunction"}}}
+function! neocomplete#util#sort_by(...) abort "{{{
+  return call(s:get_list().sort_by, a:000)
+endfunction"}}}
+
+" Sudo check.
+function! neocomplete#util#is_sudo() abort "{{{
+  return $SUDO_USER != '' && $USER !=# $SUDO_USER
+      \ && $HOME !=# expand('~'.$USER)
+      \ && $HOME ==# expand('~'.$SUDO_USER)
+endfunction"}}}
+
+function! neocomplete#util#glob(pattern, ...) abort "{{{
+  if a:pattern =~ "'"
+    " Use glob('*').
+    let cwd = getcwd()
+    let base = neocomplete#util#substitute_path_separator(
+          \ fnamemodify(a:pattern, ':h'))
+    execute 'lcd' fnameescape(base)
+
+    let files = map(split(neocomplete#util#substitute_path_separator(
+          \ glob('*')), '\n'), "base . '/' . v:val")
+
+    execute 'lcd' fnameescape(cwd)
+
+    return files
+  endif
+
+  " let is_force_glob = get(a:000, 0, 0)
+  let is_force_glob = get(a:000, 0, 1)
+
+  if !is_force_glob && a:pattern =~ '^[^\\*]\+/\*'
+        \ && neocomplete#util#has_vimproc() && exists('*vimproc#readdir')
+    return filter(vimproc#readdir(a:pattern[: -2]), 'v:val !~ "/\\.\\.\\?$"')
+  else
+    " Escape [.
+    if neocomplete#util#is_windows()
+      let glob = substitute(a:pattern, '\[', '\\[[]', 'g')
+    else
+      let glob = escape(a:pattern, '[')
+    endif
+
+    return split(neocomplete#util#substitute_path_separator(glob(glob)), '\n')
+  endif
+endfunction"}}}
+function! neocomplete#util#expand(path) abort "{{{
+  return expand(escape(a:path, '*?[]"={}'), 1)
+endfunction"}}}
+
+function! neocomplete#util#set_default(var, val, ...) abort  "{{{
+  if !exists(a:var) || type({a:var}) != type(a:val)
+    let alternate_var = get(a:000, 0, '')
+
+    let {a:var} = exists(alternate_var) ?
+          \ {alternate_var} : a:val
+  endif
+endfunction"}}}
+function! neocomplete#util#set_dictionary_helper(variable, keys, pattern) abort "{{{
+  for key in split(a:keys, '\s*,\s*')
+    if !has_key(a:variable, key)
+      let a:variable[key] = a:pattern
+    endif
+  endfor
+endfunction"}}}
+
+function! neocomplete#util#set_default_dictionary(variable, keys, value) abort "{{{
+  if !exists('s:disable_dictionaries')
+    let s:disable_dictionaries = {}
+  endif
+
+  if has_key(s:disable_dictionaries, a:variable)
+    return
+  endif
+
+  call neocomplete#util#set_dictionary_helper({a:variable}, a:keys, a:value)
+endfunction"}}}
+function! neocomplete#util#disable_default_dictionary(variable) abort "{{{
+  if !exists('s:disable_dictionaries')
+    let s:disable_dictionaries = {}
+  endif
+
+  let s:disable_dictionaries[a:variable] = 1
+endfunction"}}}
+
+function! neocomplete#util#split_rtp(...) abort "{{{
+  let rtp = a:0 ? a:1 : &runtimepath
+  if type(rtp) == type([])
+    return rtp
+  endif
+
+  if rtp !~ '\\'
+    return split(rtp, ',')
+  endif
+
+  let split = split(rtp, '\\\@<!\%(\\\\\)*\zs,')
+  return map(split,'substitute(v:val, ''\\\([\\,]\)'', "\\1", "g")')
+endfunction"}}}
+function! neocomplete#util#join_rtp(list) abort "{{{
+  return join(map(copy(a:list), 's:escape(v:val)'), ',')
+endfunction"}}}
+" Escape a path for runtimepath.
+function! s:escape(path) abort"{{{
+  return substitute(a:path, ',\|\\,\@=', '\\\0', 'g')
+endfunction"}}}
+
+function! neocomplete#util#has_vimproc() abort "{{{
+  " Initialize.
+  if !exists('g:neocomplete#use_vimproc')
+    " Check vimproc.
+    try
+      call vimproc#version()
+      let exists_vimproc = 1
+    catch
+      let exists_vimproc = 0
+    endtry
+
+    let g:neocomplete#use_vimproc = exists_vimproc
+  endif
+
+  return g:neocomplete#use_vimproc
+endfunction"}}}
+
+function! neocomplete#util#dup_filter(list) abort "{{{
+  let dict = {}
+  for keyword in a:list
+    if !has_key(dict, keyword.word)
+      let dict[keyword.word] = keyword
+    endif
+  endfor
+
+  return values(dict)
+endfunction"}}}
+
+function! neocomplete#util#convert2list(expr) abort "{{{
+  return type(a:expr) ==# type([]) ? a:expr : [a:expr]
+endfunction"}}}
+
+function! neocomplete#util#is_text_changed() abort "{{{
+  " Note: Vim 7.4.143 fixed TextChangedI bug.
+  return v:version > 704 || v:version == 704 && has('patch143')
+endfunction"}}}
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: foldmethod=marker

+ 67 - 0
autoload/neocomplete/variables.vim

@@ -0,0 +1,67 @@
+"=============================================================================
+" FILE: variables.vim
+" AUTHOR: Shougo Matsushita <Shougo.Matsu@gmail.com>
+" License: MIT license  {{{
+"     Permission is hereby granted, free of charge, to any person obtaining
+"     a copy of this software and associated documentation files (the
+"     "Software"), to deal in the Software without restriction, including
+"     without limitation the rights to use, copy, modify, merge, publish,
+"     distribute, sublicense, and/or sell copies of the Software, and to
+"     permit persons to whom the Software is furnished to do so, subject to
+"     the following conditions:
+"
+"     The above copyright notice and this permission notice shall be included
+"     in all copies or substantial portions of the Software.
+"
+"     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+"     OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+"     MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+"     IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+"     CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+"     TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+"     SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+" }}}
+"=============================================================================
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! neocomplete#variables#get_frequencies() abort "{{{
+  if !exists('s:filetype_frequencies')
+    let s:filetype_frequencies = {}
+  endif
+  let filetype = neocomplete#get_context_filetype()
+  if !has_key(s:filetype_frequencies, filetype)
+    let s:filetype_frequencies[filetype] = {}
+  endif
+
+  let frequencies = s:filetype_frequencies[filetype]
+
+  return frequencies
+endfunction"}}}
+
+function! neocomplete#variables#get_sources() abort "{{{
+  if !exists('s:sources')
+    let s:sources = {}
+  endif
+  return s:sources
+endfunction"}}}
+
+function! neocomplete#variables#get_source(name) abort "{{{
+  if !exists('s:sources')
+    let s:sources = {}
+  endif
+  return get(s:sources, a:name, {})
+endfunction"}}}
+
+function! neocomplete#variables#get_filters() abort "{{{
+  if !exists('s:filters')
+    let s:filters = {}
+  endif
+  return s:filters
+endfunction"}}}
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: foldmethod=marker

+ 144 - 0
autoload/unite/sources/neocomplete.vim

@@ -0,0 +1,144 @@
+"=============================================================================
+" FILE: neocomplete.vim
+" AUTHOR:  Shougo Matsushita <Shougo.Matsu@gmail.com>
+" License: MIT license  {{{
+"     Permission is hereby granted, free of charge, to any person obtaining
+"     a copy of this software and associated documentation files (the
+"     "Software"), to deal in the Software without restriction, including
+"     without limitation the rights to use, copy, modify, merge, publish,
+"     distribute, sublicense, and/or sell copies of the Software, and to
+"     permit persons to whom the Software is furnished to do so, subject to
+"     the following conditions:
+"
+"     The above copyright notice and this permission notice shall be included
+"     in all copies or substantial portions of the Software.
+"
+"     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+"     OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+"     MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+"     IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+"     CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+"     TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+"     SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+" }}}
+"=============================================================================
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! unite#sources#neocomplete#define() abort "{{{
+  return s:neocomplete_source
+endfunction "}}}
+
+" neocomplete unite source.
+let s:neocomplete_source = {
+      \ 'name': 'neocomplete',
+      \ 'hooks' : {},
+      \ }
+
+function! s:neocomplete_source.hooks.on_init(args, context) abort "{{{
+  if !neocomplete#is_enabled()
+    let a:context.source__complete_pos = -1
+    let a:context.source__candidates = []
+    return
+  endif
+
+  " Save options.
+  let max_list_save = g:neocomplete#max_list
+  let max_keyword_width_save = g:neocomplete#max_keyword_width
+  let manual_start_length = g:neocomplete#manual_completion_start_length
+  let neocomplete = neocomplete#get_current_neocomplete()
+  let sources_save = get(neocomplete, 'sources', {})
+
+  try
+    let g:neocomplete#max_list = -1
+    let g:neocomplete#max_keyword_width = -1
+    let g:neocomplete#manual_completion_start_length = 0
+
+    let cur_text = neocomplete#get_cur_text(1)
+    let sources = get(a:context, 'source__sources', [])
+    let args = [cur_text]
+    if !empty(sources)
+      call add(args, neocomplete#helper#get_sources_list(sources))
+    endif
+    let complete_sources = call('neocomplete#complete#_get_results', args)
+    let a:context.source__complete_pos =
+          \ neocomplete#complete#_get_complete_pos(complete_sources)
+    let a:context.source__candidates = neocomplete#complete#_get_words(
+          \ complete_sources, a:context.source__complete_pos,
+          \ cur_text[a:context.source__complete_pos :])
+  finally
+    " Restore options.
+    let g:neocomplete#max_list = max_list_save
+    let g:neocomplete#max_keyword_width = max_keyword_width_save
+    let g:neocomplete#manual_completion_start_length = manual_start_length
+    let neocomplete.sources = empty(sources_save) ?
+          \ neocomplete#helper#get_sources_list() : sources_save
+  endtry
+endfunction"}}}
+
+function! s:neocomplete_source.gather_candidates(args, context) abort "{{{
+  let keyword_pos = a:context.source__complete_pos
+  let candidates = []
+  for keyword in a:context.source__candidates
+    let dict = {
+        \   'word' : keyword.word,
+        \   'abbr' : printf('%-50s', get(keyword, 'abbr', keyword.word)),
+        \   'kind': 'completion',
+        \   'action__complete_word' : keyword.word,
+        \   'action__complete_pos' : keyword_pos,
+        \ }
+    if has_key(keyword, 'kind')
+      let dict.abbr .= ' ' . keyword.kind
+    endif
+    if has_key(keyword, 'menu')
+      let dict.abbr .= ' ' . keyword.menu
+    endif
+    if has_key(keyword, 'description')
+      if type(keyword.description) ==# type(function('tr'))
+        let dict.action__complete_info_lazy = keyword.description
+      else
+        let dict.action__complete_info = keyword.description
+      endif
+    endif
+
+    call add(candidates, dict)
+  endfor
+
+  return candidates
+endfunction "}}}
+
+function! unite#sources#neocomplete#start_complete() abort "{{{
+  return s:start_complete(0)
+endfunction "}}}
+
+function! unite#sources#neocomplete#start_quick_match() abort "{{{
+  return s:start_complete(1)
+endfunction "}}}
+
+function! s:start_complete(is_quick_match) abort "{{{
+  if !neocomplete#is_enabled()
+    return ''
+  endif
+  if !exists(':Unite')
+    echoerr 'unite.vim is not installed.'
+    return ''
+  endif
+
+  let cur_text = neocomplete#get_cur_text(1)
+  let complete_sources = neocomplete#complete#_set_results_pos(cur_text)
+  if empty(complete_sources)
+    return ''
+  endif
+
+  return unite#start_complete(['neocomplete'], {
+        \ 'auto_preview' : 1, 'quick_match' : a:is_quick_match,
+        \ 'input' : cur_text[neocomplete#complete#_get_complete_pos(
+        \        complete_sources) :],
+        \ })
+endfunction"}}}
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: foldmethod=marker

+ 12 - 0
autoload/vital.vim

@@ -0,0 +1,12 @@
+function! vital#of(name) abort
+  let files = globpath(&runtimepath, 'autoload/vital/' . a:name . '.vital', 1)
+  let file = split(files, "\n")
+  if empty(file)
+    throw 'vital: version file not found: ' . a:name
+  endif
+  let ver = readfile(file[0], 'b')
+  if empty(ver)
+    throw 'vital: invalid version file: ' . a:name
+  endif
+  return vital#_{substitute(ver[0], '\W', '', 'g')}#new()
+endfunction

+ 5 - 0
autoload/vital/_neocomplete.vim

@@ -0,0 +1,5 @@
+let s:_plugin_name = expand('<sfile>:t:r')
+
+function! vital#{s:_plugin_name}#new() abort
+  return vital#{s:_plugin_name[1:]}#new()
+endfunction

File diff suppressed because it is too large
+ 457 - 0
autoload/vital/_neocomplete/Data/List.vim


File diff suppressed because it is too large
+ 633 - 0
autoload/vital/_neocomplete/Data/String.vim


File diff suppressed because it is too large
+ 430 - 0
autoload/vital/_neocomplete/Prelude.vim


+ 181 - 0
autoload/vital/_neocomplete/Process.vim

@@ -0,0 +1,181 @@
+" ___vital___
+" NOTE: lines between '" ___vital___' is generated by :Vitalize.
+" Do not mofidify the code nor insert new lines before '" ___vital___'
+if v:version > 703 || v:version == 703 && has('patch1170')
+  function! vital#_neocomplete#Process#import() abort
+    return map({'shellescape': '', 'has_vimproc': '', 'system': '', 'iconv': '', 'spawn': '', 'get_last_status': ''},  'function("s:" . v:key)')
+  endfunction
+else
+  function! s:_SID() abort
+    return matchstr(expand('<sfile>'), '<SNR>\zs\d\+\ze__SID$')
+  endfunction
+  execute join(['function! vital#_neocomplete#Process#import() abort', printf("return map({'shellescape': '', 'has_vimproc': '', 'system': '', 'iconv': '', 'spawn': '', 'get_last_status': ''}, \"function('<SNR>%s_' . v:key)\")", s:_SID()), 'endfunction'], "\n")
+  delfunction s:_SID
+endif
+" ___vital___
+" TODO: move all comments to doc file.
+"
+"
+" FIXME: This module name should be Vital.System ?
+" But the name has been already taken.
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+
+" FIXME: Unfortunately, can't use s:_vital_loaded() for this purpose.
+" Because these variables are used when this script file is loaded.
+let s:is_windows = has('win16') || has('win32') || has('win64') || has('win95')
+let s:is_unix = has('unix')
+" As of 7.4.122, the system()'s 1st argument is converted internally by Vim.
+" Note that Patch 7.4.122 does not convert system()'s 2nd argument and
+" return-value. We must convert them manually.
+let s:need_trans = v:version < 704 || (v:version == 704 && !has('patch122'))
+
+let s:TYPE_DICT = type({})
+let s:TYPE_LIST = type([])
+let s:TYPE_STRING = type('')
+
+function! s:spawn(expr, ...) abort
+  let shellslash = 0
+  if s:is_windows
+    let shellslash = &l:shellslash
+    setlocal noshellslash
+  endif
+  try
+    if type(a:expr) is s:TYPE_LIST
+      let special = 1
+      let cmdline = join(map(a:expr, 'shellescape(v:val, special)'), ' ')
+    elseif type(a:expr) is s:TYPE_STRING
+      let cmdline = a:expr
+      if a:0 && a:1
+        " for :! command
+        let cmdline = substitute(cmdline, '\([!%#]\|<[^<>]\+>\)', '\\\1', 'g')
+      endif
+    else
+      throw 'Process.spawn(): invalid argument (value type:'.type(a:expr).')'
+    endif
+    if s:is_windows
+      silent execute '!start' cmdline
+    else
+      silent execute '!' cmdline '&'
+    endif
+  finally
+    if s:is_windows
+      let &l:shellslash = shellslash
+    endif
+  endtry
+  return ''
+endfunction
+
+" iconv() wrapper for safety.
+function! s:iconv(expr, from, to) abort
+  if a:from ==# '' || a:to ==# '' || a:from ==? a:to
+    return a:expr
+  endif
+  let result = iconv(a:expr, a:from, a:to)
+  return result !=# '' ? result : a:expr
+endfunction
+
+" Check vimproc.
+function! s:has_vimproc() abort
+  if !exists('s:exists_vimproc')
+    try
+      call vimproc#version()
+      let s:exists_vimproc = 1
+    catch
+      let s:exists_vimproc = 0
+    endtry
+  endif
+  return s:exists_vimproc
+endfunction
+
+" * {command} [, {input} [, {timeout}]]
+" * {command} [, {dict}]
+"   {dict} = {
+"     use_vimproc: bool,
+"     input: string,
+"     timeout: bool,
+"     background: bool,
+"   }
+function! s:system(str, ...) abort
+  " Process optional arguments at first
+  " because use_vimproc is required later
+  " for a:str argument.
+  let input = ''
+  let use_vimproc = s:has_vimproc()
+  let background = 0
+  let args = []
+  if a:0 ==# 1
+    " {command} [, {dict}]
+    " a:1 = {dict}
+    if type(a:1) is s:TYPE_DICT
+      if has_key(a:1, 'use_vimproc')
+        let use_vimproc = a:1.use_vimproc
+      endif
+      if has_key(a:1, 'input')
+        let args += [s:iconv(a:1.input, &encoding, 'char')]
+      endif
+      if use_vimproc && has_key(a:1, 'timeout')
+        " ignores timeout unless you have vimproc.
+        let args += [a:1.timeout]
+      endif
+      if has_key(a:1, 'background')
+        let background = a:1.background
+      endif
+    elseif type(a:1) is s:TYPE_STRING
+      let args += [s:iconv(a:1, &encoding, 'char')]
+    else
+      throw 'Process.system(): invalid argument (value type:'.type(a:1).')'
+    endif
+  elseif a:0 >= 2
+    " {command} [, {input} [, {timeout}]]
+    " a:000 = [{input} [, {timeout}]]
+    let [input; rest] = a:000
+    let input   = s:iconv(input, &encoding, 'char')
+    let args += [input] + rest
+  endif
+
+  " Process a:str argument.
+  if type(a:str) is s:TYPE_LIST
+    let expr = use_vimproc ? '"''" . v:val . "''"' : 's:shellescape(v:val)'
+    let command = join(map(copy(a:str), expr), ' ')
+  elseif type(a:str) is s:TYPE_STRING
+    let command = a:str
+  else
+    throw 'Process.system(): invalid argument (value type:'.type(a:str).')'
+  endif
+  if s:need_trans
+    let command = s:iconv(command, &encoding, 'char')
+  endif
+  let args = [command] + args
+  if background && (use_vimproc || !s:is_windows)
+    let args[0] = args[0] . ' &'
+  endif
+
+  let funcname = use_vimproc ? 'vimproc#system' : 'system'
+  let output = call(funcname, args)
+  let output = s:iconv(output, 'char', &encoding)
+  return output
+endfunction
+
+function! s:get_last_status() abort
+  return s:has_vimproc() ?
+        \ vimproc#get_last_status() : v:shell_error
+endfunction
+
+if s:is_windows
+  function! s:shellescape(command) abort
+    return substitute(a:command, '[&()[\]{}^=;!''+,`~]', '^\0', 'g')
+  endfunction
+else
+  function! s:shellescape(...) abort
+    return call('shellescape', a:000)
+  endfunction
+endif
+
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim:set et ts=2 sts=2 sw=2 tw=0:

+ 101 - 0
autoload/vital/_neocomplete/System/Cache/Deprecated.vim

@@ -0,0 +1,101 @@
+" ___vital___
+" NOTE: lines between '" ___vital___' is generated by :Vitalize.
+" Do not mofidify the code nor insert new lines before '" ___vital___'
+if v:version > 703 || v:version == 703 && has('patch1170')
+  function! vital#_neocomplete#System#Cache#Deprecated#import() abort
+    return map({'filereadable': '', '_vital_depends': '', 'delete': '', 'readfile': '', 'getfilename': '', 'deletefile': '', 'check_old_cache': '', 'writefile': '', '_vital_loaded': ''},  'function("s:" . v:key)')
+  endfunction
+else
+  function! s:_SID() abort
+    return matchstr(expand('<sfile>'), '<SNR>\zs\d\+\ze__SID$')
+  endfunction
+  execute join(['function! vital#_neocomplete#System#Cache#Deprecated#import() abort', printf("return map({'filereadable': '', '_vital_depends': '', 'delete': '', 'readfile': '', 'getfilename': '', 'deletefile': '', 'check_old_cache': '', 'writefile': '', '_vital_loaded': ''}, \"function('<SNR>%s_' . v:key)\")", s:_SID()), 'endfunction'], "\n")
+  delfunction s:_SID
+endif
+" ___vital___
+" Note:
+"   This module is deprecated. Use a new `Syste.Cache` instead.
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! s:_vital_loaded(V) abort
+  let s:V = a:V
+  let s:S = s:V.import('Data.String')
+endfunction
+
+function! s:_vital_depends() abort
+  return ['Data.String']
+endfunction
+
+function! s:getfilename(cache_dir, filename) abort
+  return s:_encode_name(a:cache_dir, a:filename)
+endfunction
+
+function! s:filereadable(cache_dir, filename) abort
+  let cache_name = s:_encode_name(a:cache_dir, a:filename)
+  return filereadable(cache_name)
+endfunction
+
+function! s:readfile(cache_dir, filename) abort
+  let cache_name = s:_encode_name(a:cache_dir, a:filename)
+  return filereadable(cache_name) ? readfile(cache_name) : []
+endfunction
+
+function! s:writefile(cache_dir, filename, list) abort
+  let cache_name = s:_encode_name(a:cache_dir, a:filename)
+
+  call writefile(a:list, cache_name)
+endfunction
+
+function! s:delete(cache_dir, filename) abort
+  echoerr 'System.Cache.delete() is obsolete. Use its deletefile() instead.'
+  return call('s:deletefile', a:cache_dir, a:filename)
+endfunction
+
+function! s:deletefile(cache_dir, filename) abort
+  let cache_name = s:_encode_name(a:cache_dir, a:filename)
+  return delete(cache_name)
+endfunction
+
+function! s:_encode_name(cache_dir, filename) abort
+  " Check cache directory.
+  if !isdirectory(a:cache_dir)
+    call mkdir(a:cache_dir, 'p')
+  endif
+  let cache_dir = a:cache_dir
+  if cache_dir !~# '/$'
+    let cache_dir .= '/'
+  endif
+
+  return cache_dir . s:_create_hash(cache_dir, a:filename)
+endfunction
+
+function! s:check_old_cache(cache_dir, filename) abort
+  " Check old cache file.
+  let cache_name = s:_encode_name(a:cache_dir, a:filename)
+  let ret = getftime(cache_name) == -1
+        \ || getftime(cache_name) <= getftime(a:filename)
+  if ret && filereadable(cache_name)
+    " Delete old cache.
+    call delete(cache_name)
+  endif
+
+  return ret
+endfunction
+
+function! s:_create_hash(dir, str) abort
+  if len(a:dir) + len(a:str) < 150
+    let hash = substitute(substitute(
+          \ a:str, ':', '=-', 'g'), '[/\\]', '=+', 'g')
+  else
+    let hash = s:S.hash(a:str)
+  endif
+
+  return hash
+endfunction
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim:set et ts=2 sts=2 sw=2 tw=0:

+ 339 - 0
autoload/vital/neocomplete.vim

@@ -0,0 +1,339 @@
+let s:plugin_name = expand('<sfile>:t:r')
+let s:vital_base_dir = expand('<sfile>:h')
+let s:project_root = expand('<sfile>:h:h:h')
+let s:is_vital_vim = s:plugin_name is# 'vital'
+
+let s:loaded = {}
+let s:cache_sid = {}
+
+" function() wrapper
+if v:version > 703 || v:version == 703 && has('patch1170')
+  function! s:_function(fstr) abort
+    return function(a:fstr)
+  endfunction
+else
+  function! s:_SID() abort
+    return matchstr(expand('<sfile>'), '<SNR>\zs\d\+\ze__SID$')
+  endfunction
+  let s:_s = '<SNR>' . s:_SID() . '_'
+  function! s:_function(fstr) abort
+    return function(substitute(a:fstr, 's:', s:_s, 'g'))
+  endfunction
+endif
+
+function! vital#{s:plugin_name}#new() abort
+  return s:new(s:plugin_name)
+endfunction
+
+function! vital#{s:plugin_name}#import(...) abort
+  if !exists('s:V')
+    let s:V = s:new(s:plugin_name)
+  endif
+  return call(s:V.import, a:000, s:V)
+endfunction
+
+let s:Vital = {}
+
+function! s:new(plugin_name) abort
+  let base = deepcopy(s:Vital)
+  let base._plugin_name = a:plugin_name
+  return base
+endfunction
+
+function! s:vital_files() abort
+  if !exists('s:vital_files')
+    let s:vital_files = map(
+    \   s:is_vital_vim ? s:_global_vital_files() : s:_self_vital_files(),
+    \   'fnamemodify(v:val, ":p:gs?[\\\\/]?/?")')
+  endif
+  return copy(s:vital_files)
+endfunction
+let s:Vital.vital_files = s:_function('s:vital_files')
+
+function! s:import(name, ...) abort dict
+  let target = {}
+  let functions = []
+  for a in a:000
+    if type(a) == type({})
+      let target = a
+    elseif type(a) == type([])
+      let functions = a
+    endif
+    unlet a
+  endfor
+  let module = self._import(a:name)
+  if empty(functions)
+    call extend(target, module, 'keep')
+  else
+    for f in functions
+      if has_key(module, f) && !has_key(target, f)
+        let target[f] = module[f]
+      endif
+    endfor
+  endif
+  return target
+endfunction
+let s:Vital.import = s:_function('s:import')
+
+function! s:load(...) abort dict
+  for arg in a:000
+    let [name; as] = type(arg) == type([]) ? arg[: 1] : [arg, arg]
+    let target = split(join(as, ''), '\W\+')
+    let dict = self
+    let dict_type = type({})
+    while !empty(target)
+      let ns = remove(target, 0)
+      if !has_key(dict, ns)
+        let dict[ns] = {}
+      endif
+      if type(dict[ns]) == dict_type
+        let dict = dict[ns]
+      else
+        unlet dict
+        break
+      endif
+    endwhile
+    if exists('dict')
+      call extend(dict, self._import(name))
+    endif
+    unlet arg
+  endfor
+  return self
+endfunction
+let s:Vital.load = s:_function('s:load')
+
+function! s:unload() abort dict
+  let s:loaded = {}
+  let s:cache_sid = {}
+  unlet! s:vital_files
+endfunction
+let s:Vital.unload = s:_function('s:unload')
+
+function! s:exists(name) abort dict
+  if a:name !~# '\v^\u\w*%(\.\u\w*)*$'
+    throw 'vital: Invalid module name: ' . a:name
+  endif
+  return s:_module_path(a:name) isnot# ''
+endfunction
+let s:Vital.exists = s:_function('s:exists')
+
+function! s:search(pattern) abort dict
+  let paths = s:_extract_files(a:pattern, self.vital_files())
+  let modules = sort(map(paths, 's:_file2module(v:val)'))
+  return s:_uniq(modules)
+endfunction
+let s:Vital.search = s:_function('s:search')
+
+function! s:plugin_name() abort dict
+  return self._plugin_name
+endfunction
+let s:Vital.plugin_name = s:_function('s:plugin_name')
+
+function! s:_self_vital_files() abort
+  let builtin = printf('%s/__%s__/', s:vital_base_dir, s:plugin_name)
+  let installed = printf('%s/_%s/', s:vital_base_dir, s:plugin_name)
+  let base = builtin . ',' . installed
+  return split(globpath(base, '**/*.vim', 1), "\n")
+endfunction
+
+function! s:_global_vital_files() abort
+  let pattern = 'autoload/vital/__*__/**/*.vim'
+  return split(globpath(&runtimepath, pattern, 1), "\n")
+endfunction
+
+function! s:_extract_files(pattern, files) abort
+  let tr = {'.': '/', '*': '[^/]*', '**': '.*'}
+  let target = substitute(a:pattern, '\.\|\*\*\?', '\=tr[submatch(0)]', 'g')
+  let regexp = printf('autoload/vital/[^/]\+/%s.vim$', target)
+  return filter(a:files, 'v:val =~# regexp')
+endfunction
+
+function! s:_file2module(file) abort
+  let filename = fnamemodify(a:file, ':p:gs?[\\/]?/?')
+  let tail = matchstr(filename, 'autoload/vital/_\w\+/\zs.*\ze\.vim$')
+  return join(split(tail, '[\\/]\+'), '.')
+endfunction
+
+" @param {string} name e.g. Data.List
+function! s:_import(name) abort dict
+  if has_key(s:loaded, a:name)
+    return copy(s:loaded[a:name])
+  endif
+  let module = self._get_module(a:name)
+  if has_key(module, '_vital_created')
+    call module._vital_created(module)
+  endif
+  let export_module = filter(copy(module), 'v:key =~# "^\\a"')
+  " Cache module before calling module.vital_loaded() to avoid cyclic
+  " dependences but remove the cache if module._vital_loaded() fails.
+  " let s:loaded[a:name] = export_module
+  let s:loaded[a:name] = export_module
+  if has_key(module, '_vital_loaded')
+    try
+      call module._vital_loaded(vital#{s:plugin_name}#new())
+    catch
+      unlet s:loaded[a:name]
+      throw 'vital: fail to call ._vital_loaded(): ' . v:exception
+    endtry
+  endif
+  return copy(s:loaded[a:name])
+endfunction
+let s:Vital._import = s:_function('s:_import')
+
+" s:_get_module() returns module object wihch has all script local functions.
+function! s:_get_module(name) abort dict
+  let funcname = s:_import_func_name(self.plugin_name(), a:name)
+  if s:_exists_autoload_func_with_source(funcname)
+    return call(funcname, [])
+  else
+    return s:_get_builtin_module(a:name)
+  endif
+endfunction
+
+function! s:_get_builtin_module(name) abort
+ return s:sid2sfuncs(s:_module_sid(a:name))
+endfunction
+
+if s:is_vital_vim
+  " For vital.vim, we can use s:_get_builtin_module directly
+  let s:Vital._get_module = s:_function('s:_get_builtin_module')
+else
+  let s:Vital._get_module = s:_function('s:_get_module')
+endif
+
+function! s:_import_func_name(plugin_name, module_name) abort
+  return printf('vital#_%s#%s#import', a:plugin_name, s:_dot_to_sharp(a:module_name))
+endfunction
+
+function! s:_module_sid(name) abort
+  let path = s:_module_path(a:name)
+  if !filereadable(path)
+    throw 'vital: module not found: ' . a:name
+  endif
+  let vital_dir = s:is_vital_vim ? '__\w\+__' : printf('_\{1,2}%s\%%(__\)\?', s:plugin_name)
+  let base = join([vital_dir, ''], '[/\\]\+')
+  let p = base . substitute('' . a:name, '\.', '[/\\\\]\\+', 'g')
+  let sid = s:_sid(path, p)
+  if !sid
+    call s:_source(path)
+    let sid = s:_sid(path, p)
+    if !sid
+      throw printf('vital: cannot get <SID> from path: %s', path)
+    endif
+  endif
+  return sid
+endfunction
+
+function! s:_module_path(name) abort
+  return get(s:_extract_files(a:name, s:vital_files()), 0, '')
+endfunction
+
+function! s:_module_sid_base_dir() abort
+  return s:is_vital_vim ? &rtp : s:project_root
+endfunction
+
+function! s:_dot_to_sharp(name) abort
+  return substitute(a:name, '\.', '#', 'g')
+endfunction
+
+" It will sources autoload file if a given func is not already defined.
+function! s:_exists_autoload_func_with_source(funcname) abort
+  if exists('*' . a:funcname)
+    " Return true if a given func is already defined
+    return 1
+  endif
+  " source a file which may include a given func definition and try again.
+  let path = 'autoload/' . substitute(substitute(a:funcname, '#[^#]*$', '.vim', ''), '#', '/', 'g')
+  call s:_runtime(path)
+  return exists('*' . a:funcname)
+endfunction
+
+function! s:_runtime(path) abort
+  execute 'runtime' fnameescape(a:path)
+endfunction
+
+function! s:_source(path) abort
+  execute 'source' fnameescape(a:path)
+endfunction
+
+" @vimlint(EVL102, 1, l:_)
+" @vimlint(EVL102, 1, l:__)
+function! s:_sid(path, filter_pattern) abort
+  let unified_path = s:_unify_path(a:path)
+  if has_key(s:cache_sid, unified_path)
+    return s:cache_sid[unified_path]
+  endif
+  for line in filter(split(s:_redir(':scriptnames'), "\n"), 'v:val =~# a:filter_pattern')
+    let [_, sid, path; __] = matchlist(line, '^\s*\(\d\+\):\s\+\(.\+\)\s*$')
+    if s:_unify_path(path) is# unified_path
+      let s:cache_sid[unified_path] = sid
+      return s:cache_sid[unified_path]
+    endif
+  endfor
+  return 0
+endfunction
+
+function! s:_redir(cmd) abort
+  let [save_verbose, save_verbosefile] = [&verbose, &verbosefile]
+  set verbose=0 verbosefile=
+  redir => res
+    silent! execute a:cmd
+  redir END
+  let [&verbose, &verbosefile] = [save_verbose, save_verbosefile]
+  return res
+endfunction
+
+if filereadable(expand('<sfile>:r') . '.VIM') " is case-insensitive or not
+  let s:_unify_path_cache = {}
+  " resolve() is slow, so we cache results.
+  " Note: On windows, vim can't expand path names from 8.3 formats.
+  " So if getting full path via <sfile> and $HOME was set as 8.3 format,
+  " vital load duplicated scripts. Below's :~ avoid this issue.
+  function! s:_unify_path(path) abort
+    if has_key(s:_unify_path_cache, a:path)
+      return s:_unify_path_cache[a:path]
+    endif
+    let value = tolower(fnamemodify(resolve(fnamemodify(
+    \                   a:path, ':p')), ':~:gs?[\\/]?/?'))
+    let s:_unify_path_cache[a:path] = value
+    return value
+  endfunction
+else
+  function! s:_unify_path(path) abort
+    return resolve(fnamemodify(a:path, ':p:gs?[\\/]?/?'))
+  endfunction
+endif
+
+" copied and modified from Vim.ScriptLocal
+let s:SNR = join(map(range(len("\<SNR>")), '"[\\x" . printf("%0x", char2nr("\<SNR>"[v:val])) . "]"'), '')
+function! s:sid2sfuncs(sid) abort
+  let fs = split(s:_redir(printf(':function /^%s%s_', s:SNR, a:sid)), "\n")
+  let r = {}
+  let pattern = printf('\m^function\s<SNR>%d_\zs\w\{-}\ze(', a:sid)
+  for fname in map(fs, 'matchstr(v:val, pattern)')
+    let r[fname] = function(s:_sfuncname(a:sid, fname))
+  endfor
+  return r
+endfunction
+
+"" Return funcname of script local functions with SID
+function! s:_sfuncname(sid, funcname) abort
+  return printf('<SNR>%s_%s', a:sid, a:funcname)
+endfunction
+
+if exists('*uniq')
+  function! s:_uniq(list) abort
+    return uniq(a:list)
+  endfunction
+else
+  function! s:_uniq(list) abort
+    let i = len(a:list) - 1
+    while 0 < i
+      if a:list[i] ==# a:list[i - 1]
+        call remove(a:list, i)
+      endif
+      let i -= 1
+    endwhile
+    return a:list
+  endfunction
+endif

+ 8 - 0
autoload/vital/neocomplete.vital

@@ -0,0 +1,8 @@
+neocomplete
+645fe7142afdf5ef90e07cd275a15657c3328f53
+
+Prelude
+Data.List
+Data.String
+Process
+System.Cache.Deprecated

+ 1 - 0
bundle/Vundle.vim

@@ -0,0 +1 @@
+Subproject commit 9a38216a1c0c597f978d73547d37681fc689c90d

+ 1 - 0
bundle/ctrlp.vim

@@ -0,0 +1 @@
+Subproject commit 564176f01d7f3f7f8ab452ff4e1f5314de7b0981

File diff suppressed because it is too large
+ 2113 - 0
bundle/ctrlp/autoload/ctrlp.vim


+ 140 - 0
bundle/ctrlp/autoload/ctrlp/bookmarkdir.vim

@@ -0,0 +1,140 @@
+" =============================================================================
+" File:          autoload/ctrlp/bookmarkdir.vim
+" Description:   Bookmarked directories extension
+" Author:        Kien Nguyen <github.com/kien>
+" =============================================================================
+
+" Init {{{1
+if exists('g:loaded_ctrlp_bookmarkdir') && g:loaded_ctrlp_bookmarkdir
+	fini
+en
+let g:loaded_ctrlp_bookmarkdir = 1
+
+cal add(g:ctrlp_ext_vars, {
+	\ 'init': 'ctrlp#bookmarkdir#init()',
+	\ 'accept': 'ctrlp#bookmarkdir#accept',
+	\ 'lname': 'bookmarked dirs',
+	\ 'sname': 'bkd',
+	\ 'type': 'tabs',
+	\ 'opmul': 1,
+	\ 'nolim': 1,
+	\ 'wipe': 'ctrlp#bookmarkdir#remove',
+	\ })
+
+let s:id = g:ctrlp_builtins + len(g:ctrlp_ext_vars)
+" Utilities {{{1
+fu! s:getinput(str, ...)
+	echoh Identifier
+	cal inputsave()
+	let input = call('input', a:0 ? [a:str] + a:000 : [a:str])
+	cal inputrestore()
+	echoh None
+	retu input
+endf
+
+fu! s:cachefile()
+	if !exists('s:cadir') || !exists('s:cafile')
+		let s:cadir = ctrlp#utils#cachedir().ctrlp#utils#lash().'bkd'
+		let s:cafile = s:cadir.ctrlp#utils#lash().'cache.txt'
+	en
+	retu s:cafile
+endf
+
+fu! s:writecache(lines)
+	cal ctrlp#utils#writecache(a:lines, s:cadir, s:cafile)
+endf
+
+fu! s:getbookmarks()
+	retu ctrlp#utils#readfile(s:cachefile())
+endf
+
+fu! s:savebookmark(name, cwd)
+	let cwds = exists('+ssl') ? [tr(a:cwd, '\', '/'), tr(a:cwd, '/', '\')] : [a:cwd]
+	let entries = filter(s:getbookmarks(), 'index(cwds, s:parts(v:val)[1]) < 0')
+	cal s:writecache(insert(entries, a:name.'	'.a:cwd))
+endf
+
+fu! s:setentries()
+	let time = getftime(s:cachefile())
+	if !( exists('s:bookmarks') && time == s:bookmarks[0] )
+		let s:bookmarks = [time, s:getbookmarks()]
+	en
+endf
+
+fu! s:parts(str)
+	let mlist = matchlist(a:str, '\v([^\t]+)\t(.*)$')
+	retu mlist != [] ? mlist[1:2] : ['', '']
+endf
+
+fu! s:process(entries, type)
+	retu map(a:entries, 's:modify(v:val, a:type)')
+endf
+
+fu! s:modify(entry, type)
+	let [name, dir] = s:parts(a:entry)
+	let dir = fnamemodify(dir, a:type)
+	retu name.'	'.( dir == '' ? '.' : dir )
+endf
+
+fu! s:msg(name, cwd)
+	redr
+	echoh Identifier | echon 'Bookmarked ' | echoh Constant
+	echon a:name.' ' | echoh Directory | echon a:cwd
+	echoh None
+endf
+
+fu! s:syntax()
+	if !ctrlp#nosy()
+		cal ctrlp#hicheck('CtrlPBookmark', 'Identifier')
+		cal ctrlp#hicheck('CtrlPTabExtra', 'Comment')
+		sy match CtrlPBookmark '^> [^\t]\+' contains=CtrlPLinePre
+		sy match CtrlPTabExtra '\zs\t.*\ze$'
+	en
+endf
+" Public {{{1
+fu! ctrlp#bookmarkdir#init()
+	cal s:setentries()
+	cal s:syntax()
+	retu s:process(copy(s:bookmarks[1]), ':.')
+endf
+
+fu! ctrlp#bookmarkdir#accept(mode, str)
+	let parts = s:parts(s:modify(a:str, ':p'))
+	cal call('s:savebookmark', parts)
+	if a:mode =~ 't\|v\|h'
+		cal ctrlp#exit()
+	en
+	cal ctrlp#setdir(parts[1], a:mode =~ 't\|h' ? 'chd!' : 'lc!')
+	if a:mode == 'e'
+		cal ctrlp#switchtype(0)
+		cal ctrlp#recordhist()
+		cal ctrlp#prtclear()
+	en
+endf
+
+fu! ctrlp#bookmarkdir#add(dir)
+	let str = 'Directory to bookmark: '
+	let cwd = a:dir != '' ? a:dir : s:getinput(str, getcwd(), 'dir')
+	if cwd == '' | retu | en
+	let cwd = fnamemodify(cwd, ':p')
+	let name = s:getinput('Bookmark as: ', cwd)
+	if name == '' | retu | en
+	let name = tr(name, '	', ' ')
+	cal s:savebookmark(name, cwd)
+	cal s:msg(name, cwd)
+endf
+
+fu! ctrlp#bookmarkdir#remove(entries)
+	cal s:process(a:entries, ':p')
+	cal s:writecache(a:entries == [] ? [] :
+		\ filter(s:getbookmarks(), 'index(a:entries, v:val) < 0'))
+	cal s:setentries()
+	retu s:process(copy(s:bookmarks[1]), ':.')
+endf
+
+fu! ctrlp#bookmarkdir#id()
+	retu s:id
+endf
+"}}}
+
+" vim:fen:fdm=marker:fmr={{{,}}}:fdl=0:fdc=1:ts=2:sw=2:sts=2

+ 261 - 0
bundle/ctrlp/autoload/ctrlp/buffertag.vim

@@ -0,0 +1,261 @@
+" =============================================================================
+" File:          autoload/ctrlp/buffertag.vim
+" Description:   Buffer Tag extension
+" Maintainer:    Kien Nguyen <github.com/kien>
+" Credits:       Much of the code was taken from tagbar.vim by Jan Larres, plus
+"                a few lines from taglist.vim by Yegappan Lakshmanan and from
+"                buffertag.vim by Takeshi Nishida.
+" =============================================================================
+
+" Init {{{1
+if exists('g:loaded_ctrlp_buftag') && g:loaded_ctrlp_buftag
+	fini
+en
+let g:loaded_ctrlp_buftag = 1
+
+cal add(g:ctrlp_ext_vars, {
+	\ 'init': 'ctrlp#buffertag#init(s:crfile)',
+	\ 'accept': 'ctrlp#buffertag#accept',
+	\ 'lname': 'buffer tags',
+	\ 'sname': 'bft',
+	\ 'exit': 'ctrlp#buffertag#exit()',
+	\ 'type': 'tabs',
+	\ 'opts': 'ctrlp#buffertag#opts()',
+	\ })
+
+let s:id = g:ctrlp_builtins + len(g:ctrlp_ext_vars)
+
+let [s:pref, s:opts] = ['g:ctrlp_buftag_', {
+	\ 'systemenc': ['s:enc', &enc],
+	\ 'ctags_bin': ['s:bin', ''],
+	\ 'types': ['s:usr_types', {}],
+	\ }]
+
+let s:bins = [
+	\ 'ctags-exuberant',
+	\ 'exuberant-ctags',
+	\ 'exctags',
+	\ '/usr/local/bin/ctags',
+	\ '/opt/local/bin/ctags',
+	\ 'ctags',
+	\ 'ctags.exe',
+	\ 'tags',
+	\ ]
+
+let s:types = {
+	\ 'asm'    : '%sasm%sasm%sdlmt',
+	\ 'aspperl': '%sasp%sasp%sfsv',
+	\ 'aspvbs' : '%sasp%sasp%sfsv',
+	\ 'awk'    : '%sawk%sawk%sf',
+	\ 'beta'   : '%sbeta%sbeta%sfsv',
+	\ 'c'      : '%sc%sc%sdgsutvf',
+	\ 'cpp'    : '%sc++%sc++%snvdtcgsuf',
+	\ 'cs'     : '%sc#%sc#%sdtncEgsipm',
+	\ 'cobol'  : '%scobol%scobol%sdfgpPs',
+	\ 'eiffel' : '%seiffel%seiffel%scf',
+	\ 'erlang' : '%serlang%serlang%sdrmf',
+	\ 'expect' : '%stcl%stcl%scfp',
+	\ 'fortran': '%sfortran%sfortran%spbceiklmntvfs',
+	\ 'html'   : '%shtml%shtml%saf',
+	\ 'java'   : '%sjava%sjava%spcifm',
+	\ 'javascript': '%sjavascript%sjavascript%sf',
+	\ 'lisp'   : '%slisp%slisp%sf',
+	\ 'lua'    : '%slua%slua%sf',
+	\ 'make'   : '%smake%smake%sm',
+	\ 'pascal' : '%spascal%spascal%sfp',
+	\ 'perl'   : '%sperl%sperl%sclps',
+	\ 'php'    : '%sphp%sphp%scdvf',
+	\ 'python' : '%spython%spython%scmf',
+	\ 'rexx'   : '%srexx%srexx%ss',
+	\ 'ruby'   : '%sruby%sruby%scfFm',
+	\ 'scheme' : '%sscheme%sscheme%ssf',
+	\ 'sh'     : '%ssh%ssh%sf',
+	\ 'csh'    : '%ssh%ssh%sf',
+	\ 'zsh'    : '%ssh%ssh%sf',
+	\ 'slang'  : '%sslang%sslang%snf',
+	\ 'sml'    : '%ssml%ssml%secsrtvf',
+	\ 'sql'    : '%ssql%ssql%scFPrstTvfp',
+	\ 'tcl'    : '%stcl%stcl%scfmp',
+	\ 'vera'   : '%svera%svera%scdefgmpPtTvx',
+	\ 'verilog': '%sverilog%sverilog%smcPertwpvf',
+	\ 'vim'    : '%svim%svim%savf',
+	\ 'yacc'   : '%syacc%syacc%sl',
+	\ }
+
+cal map(s:types, 'printf(v:val, "--language-force=", " --", "-types=")')
+
+if executable('jsctags')
+	cal extend(s:types, { 'javascript': { 'args': '-f -', 'bin': 'jsctags' } })
+en
+
+fu! ctrlp#buffertag#opts()
+	for [ke, va] in items(s:opts)
+		let {va[0]} = exists(s:pref.ke) ? {s:pref.ke} : va[1]
+	endfo
+	" Ctags bin
+	if empty(s:bin)
+		for bin in s:bins | if executable(bin)
+			let s:bin = bin
+			brea
+		en | endfo
+	el
+		let s:bin = expand(s:bin, 1)
+	en
+	" Types
+	cal extend(s:types, s:usr_types)
+endf
+" Utilities {{{1
+fu! s:validfile(fname, ftype)
+	if ( !empty(a:fname) || !empty(a:ftype) ) && filereadable(a:fname)
+		\ && index(keys(s:types), a:ftype) >= 0 | retu 1 | en
+	retu 0
+endf
+
+fu! s:exectags(cmd)
+	if exists('+ssl')
+		let [ssl, &ssl] = [&ssl, 0]
+	en
+	if &sh =~ 'cmd\.exe'
+		let [sxq, &sxq, shcf, &shcf] = [&sxq, '"', &shcf, '/s /c']
+	en
+	let output = system(a:cmd)
+	if &sh =~ 'cmd\.exe'
+		let [&sxq, &shcf] = [sxq, shcf]
+	en
+	if exists('+ssl')
+		let &ssl = ssl
+	en
+	retu output
+endf
+
+fu! s:exectagsonfile(fname, ftype)
+	let [ags, ft] = ['-f - --sort=no --excmd=pattern --fields=nKs ', a:ftype]
+	if type(s:types[ft]) == 1
+		let ags .= s:types[ft]
+		let bin = s:bin
+	elsei type(s:types[ft]) == 4
+		let ags = s:types[ft]['args']
+		let bin = expand(s:types[ft]['bin'], 1)
+	en
+	if empty(bin) | retu '' | en
+	let cmd = s:esctagscmd(bin, ags, a:fname)
+	if empty(cmd) | retu '' | en
+	let output = s:exectags(cmd)
+	if v:shell_error || output =~ 'Warning: cannot open' | retu '' | en
+	retu output
+endf
+
+fu! s:esctagscmd(bin, args, ...)
+	if exists('+ssl')
+		let [ssl, &ssl] = [&ssl, 0]
+	en
+	let fname = a:0 ? shellescape(a:1) : ''
+	let cmd = shellescape(a:bin).' '.a:args.' '.fname
+	if &sh =~ 'cmd\.exe'
+		let cmd = substitute(cmd, '[&()@^<>|]', '^\0', 'g')
+	en
+	if exists('+ssl')
+		let &ssl = ssl
+	en
+	if has('iconv')
+		let last = s:enc != &enc ? s:enc : !empty( $LANG ) ? $LANG : &enc
+		let cmd = iconv(cmd, &enc, last)
+	en
+	retu cmd
+endf
+
+fu! s:process(fname, ftype)
+	if !s:validfile(a:fname, a:ftype) | retu [] | endif
+	let ftime = getftime(a:fname)
+	if has_key(g:ctrlp_buftags, a:fname)
+		\ && g:ctrlp_buftags[a:fname]['time'] >= ftime
+		let lines = g:ctrlp_buftags[a:fname]['lines']
+	el
+		let data = s:exectagsonfile(a:fname, a:ftype)
+		let [raw, lines] = [split(data, '\n\+'), []]
+		for line in raw
+			if line !~# '^!_TAG_' && len(split(line, ';"')) == 2
+				let parsed_line = s:parseline(line)
+				if parsed_line != ''
+					cal add(lines, parsed_line)
+				en
+			en
+		endfo
+		let cache = { a:fname : { 'time': ftime, 'lines': lines } }
+		cal extend(g:ctrlp_buftags, cache)
+	en
+	retu lines
+endf
+
+fu! s:parseline(line)
+	let vals = matchlist(a:line,
+		\ '\v^([^\t]+)\t(.+)\t[?/]\^?(.{-1,})\$?[?/]\;\"\t(.+)\tline(no)?\:(\d+)')
+	if vals == [] | retu '' | en
+	let [bufnr, bufname] = [bufnr('^'.vals[2].'$'), fnamemodify(vals[2], ':p:t')]
+	retu vals[1].'	'.vals[4].'|'.bufnr.':'.bufname.'|'.vals[6].'| '.vals[3]
+endf
+
+fu! s:syntax()
+	if !ctrlp#nosy()
+		cal ctrlp#hicheck('CtrlPTagKind', 'Title')
+		cal ctrlp#hicheck('CtrlPBufName', 'Directory')
+		cal ctrlp#hicheck('CtrlPTabExtra', 'Comment')
+		sy match CtrlPTagKind '\zs[^\t|]\+\ze|\d\+:[^|]\+|\d\+|'
+		sy match CtrlPBufName '|\d\+:\zs[^|]\+\ze|\d\+|'
+		sy match CtrlPTabExtra '\zs\t.*\ze$' contains=CtrlPBufName,CtrlPTagKind
+	en
+endf
+
+fu! s:chknearby(pat)
+	if match(getline('.'), a:pat) < 0
+		let [int, forw, maxl] = [1, 1, line('$')]
+		wh !search(a:pat, 'W'.( forw ? '' : 'b' ))
+			if !forw
+				if int > maxl | brea | en
+				let int += int
+			en
+			let forw = !forw
+		endw
+	en
+endf
+" Public {{{1
+fu! ctrlp#buffertag#init(fname)
+	let bufs = exists('s:btmode') && s:btmode
+		\ ? filter(ctrlp#buffers(), 'filereadable(v:val)')
+		\ : [exists('s:bufname') ? s:bufname : a:fname]
+	let lines = []
+	for each in bufs
+		let bname = fnamemodify(each, ':p')
+		let tftype = get(split(getbufvar('^'.bname.'$', '&ft'), '\.'), 0, '')
+		cal extend(lines, s:process(bname, tftype))
+	endfo
+	cal s:syntax()
+	retu lines
+endf
+
+fu! ctrlp#buffertag#accept(mode, str)
+	let vals = matchlist(a:str,
+		\ '\v^[^\t]+\t+[^\t|]+\|(\d+)\:[^\t|]+\|(\d+)\|\s(.+)$')
+	let bufnr = str2nr(get(vals, 1))
+	if bufnr
+		cal ctrlp#acceptfile(a:mode, bufname(bufnr))
+		exe 'norm!' str2nr(get(vals, 2, line('.'))).'G'
+		cal s:chknearby('\V\C'.get(vals, 3, ''))
+		sil! norm! zvzz
+	en
+endf
+
+fu! ctrlp#buffertag#cmd(mode, ...)
+	let s:btmode = a:mode
+	if a:0 && !empty(a:1)
+		let s:bufname = fnamemodify(a:1, ':p')
+	en
+	retu s:id
+endf
+
+fu! ctrlp#buffertag#exit()
+	unl! s:btmode s:bufname
+endf
+"}}}
+
+" vim:fen:fdm=marker:fmr={{{,}}}:fdl=0:fdc=1:ts=2:sw=2:sts=2

+ 95 - 0
bundle/ctrlp/autoload/ctrlp/changes.vim

@@ -0,0 +1,95 @@
+" =============================================================================
+" File:          autoload/ctrlp/changes.vim
+" Description:   Change list extension
+" Author:        Kien Nguyen <github.com/kien>
+" =============================================================================
+
+" Init {{{1
+if exists('g:loaded_ctrlp_changes') && g:loaded_ctrlp_changes
+	fini
+en
+let g:loaded_ctrlp_changes = 1
+
+cal add(g:ctrlp_ext_vars, {
+	\ 'init': 'ctrlp#changes#init(s:bufnr, s:crbufnr)',
+	\ 'accept': 'ctrlp#changes#accept',
+	\ 'lname': 'changes',
+	\ 'sname': 'chs',
+	\ 'exit': 'ctrlp#changes#exit()',
+	\ 'type': 'tabe',
+	\ 'sort': 0,
+	\ 'nolim': 1,
+	\ })
+
+let s:id = g:ctrlp_builtins + len(g:ctrlp_ext_vars)
+" Utilities {{{1
+fu! s:changelist(bufnr)
+	sil! exe 'noa hid b' a:bufnr
+	redi => result
+	sil! changes
+	redi END
+	retu map(split(result, "\n")[1:], 'tr(v:val, "	", " ")')
+endf
+
+fu! s:process(clines, ...)
+	let [clines, evas] = [[], []]
+	for each in a:clines
+		let parts = matchlist(each, '\v^.\s*\d+\s+(\d+)\s+(\d+)\s(.*)$')
+		if !empty(parts)
+			if parts[3] == '' | let parts[3] = ' ' | en
+			cal add(clines, parts[3].'	|'.a:1.':'.a:2.'|'.parts[1].':'.parts[2].'|')
+		en
+	endfo
+	retu reverse(filter(clines, 'count(clines, v:val) == 1'))
+endf
+
+fu! s:syntax()
+	if !ctrlp#nosy()
+		cal ctrlp#hicheck('CtrlPBufName', 'Directory')
+		cal ctrlp#hicheck('CtrlPTabExtra', 'Comment')
+		sy match CtrlPBufName '\t|\d\+:\zs[^|]\+\ze|\d\+:\d\+|$'
+		sy match CtrlPTabExtra '\zs\t.*\ze$' contains=CtrlPBufName
+	en
+endf
+" Public {{{1
+fu! ctrlp#changes#init(original_bufnr, bufnr)
+	let bufnr = exists('s:bufnr') ? s:bufnr : a:bufnr
+	let bufs = exists('s:clmode') && s:clmode ? ctrlp#buffers('id') : [bufnr]
+	cal filter(bufs, 'v:val > 0')
+	let [swb, &swb] = [&swb, '']
+	let lines = []
+	for each in bufs
+		let fnamet = fnamemodify(bufname(each), ':t')
+		cal extend(lines, s:process(s:changelist(each), each, fnamet))
+	endfo
+	sil! exe 'noa hid b' a:original_bufnr
+	let &swb = swb
+	cal ctrlp#syntax()
+	cal s:syntax()
+	retu lines
+endf
+
+fu! ctrlp#changes#accept(mode, str)
+	let info = matchlist(a:str, '\t|\(\d\+\):[^|]\+|\(\d\+\):\(\d\+\)|$')
+	let bufnr = str2nr(get(info, 1))
+	if bufnr
+		cal ctrlp#acceptfile(a:mode, bufname(bufnr))
+		cal cursor(get(info, 2), get(info, 3))
+		sil! norm! zvzz
+	en
+endf
+
+fu! ctrlp#changes#cmd(mode, ...)
+	let s:clmode = a:mode
+	if a:0 && !empty(a:1)
+		let s:bufnr = bufnr('^'.fnamemodify(a:1, ':p').'$')
+	en
+	retu s:id
+endf
+
+fu! ctrlp#changes#exit()
+	unl! s:clmode s:bufnr
+endf
+"}}}
+
+" vim:fen:fdm=marker:fmr={{{,}}}:fdl=0:fdc=1:ts=2:sw=2:sts=2

+ 93 - 0
bundle/ctrlp/autoload/ctrlp/dir.vim

@@ -0,0 +1,93 @@
+" =============================================================================
+" File:          autoload/ctrlp/dir.vim
+" Description:   Directory extension
+" Author:        Kien Nguyen <github.com/kien>
+" =============================================================================
+
+" Init {{{1
+if exists('g:loaded_ctrlp_dir') && g:loaded_ctrlp_dir
+	fini
+en
+let [g:loaded_ctrlp_dir, g:ctrlp_newdir] = [1, 0]
+
+let s:ars = ['s:maxdepth', 's:maxfiles', 's:compare_lim', 's:glob', 's:caching']
+
+cal add(g:ctrlp_ext_vars, {
+	\ 'init': 'ctrlp#dir#init('.join(s:ars, ', ').')',
+	\ 'accept': 'ctrlp#dir#accept',
+	\ 'lname': 'dirs',
+	\ 'sname': 'dir',
+	\ 'type': 'path',
+	\ 'specinput': 1,
+	\ })
+
+let s:id = g:ctrlp_builtins + len(g:ctrlp_ext_vars)
+
+let s:dircounts = {}
+" Utilities {{{1
+fu! s:globdirs(dirs, depth)
+	let entries = split(globpath(a:dirs, s:glob), "\n")
+	let [dirs, depth] = [ctrlp#dirnfile(entries)[0], a:depth + 1]
+	cal extend(g:ctrlp_alldirs, dirs)
+	let nr = len(g:ctrlp_alldirs)
+	if !empty(dirs) && !s:max(nr, s:maxfiles) && depth <= s:maxdepth
+		sil! cal ctrlp#progress(nr)
+		cal map(dirs, 'ctrlp#utils#fnesc(v:val, "g", ",")')
+		cal s:globdirs(join(dirs, ','), depth)
+	en
+endf
+
+fu! s:max(len, max)
+	retu a:max && a:len > a:max
+endf
+
+fu! s:nocache()
+	retu !s:caching || ( s:caching > 1 && get(s:dircounts, s:cwd) < s:caching )
+endf
+" Public {{{1
+fu! ctrlp#dir#init(...)
+	let s:cwd = getcwd()
+	for each in range(len(s:ars))
+		let {s:ars[each]} = a:{each + 1}
+	endfo
+	let cadir = ctrlp#utils#cachedir().ctrlp#utils#lash().'dir'
+	let cafile = cadir.ctrlp#utils#lash().ctrlp#utils#cachefile('dir')
+	if g:ctrlp_newdir || s:nocache() || !filereadable(cafile)
+		let [s:initcwd, g:ctrlp_alldirs] = [s:cwd, []]
+		cal s:globdirs(ctrlp#utils#fnesc(s:cwd, 'g', ','), 0)
+		cal ctrlp#rmbasedir(g:ctrlp_alldirs)
+		if len(g:ctrlp_alldirs) <= s:compare_lim
+			cal sort(g:ctrlp_alldirs, 'ctrlp#complen')
+		en
+		cal ctrlp#utils#writecache(g:ctrlp_alldirs, cadir, cafile)
+		let g:ctrlp_newdir = 0
+	el
+		if !( exists('s:initcwd') && s:initcwd == s:cwd )
+			let s:initcwd = s:cwd
+			let g:ctrlp_alldirs = ctrlp#utils#readfile(cafile)
+		en
+	en
+	cal extend(s:dircounts, { s:cwd : len(g:ctrlp_alldirs) })
+	retu g:ctrlp_alldirs
+endf
+
+fu! ctrlp#dir#accept(mode, str)
+	let path = a:mode == 'h' ? getcwd() : s:cwd.ctrlp#utils#lash().a:str
+	if a:mode =~ 't\|v\|h'
+		cal ctrlp#exit()
+	en
+	cal ctrlp#setdir(path, a:mode =~ 't\|h' ? 'chd!' : 'lc!')
+	if a:mode == 'e'
+		sil! cal ctrlp#statusline()
+		cal ctrlp#setlines(s:id)
+		cal ctrlp#recordhist()
+		cal ctrlp#prtclear()
+	en
+endf
+
+fu! ctrlp#dir#id()
+	retu s:id
+endf
+"}}}
+
+" vim:fen:fdm=marker:fmr={{{,}}}:fdl=0:fdc=1:ts=2:sw=2:sts=2

+ 62 - 0
bundle/ctrlp/autoload/ctrlp/line.vim

@@ -0,0 +1,62 @@
+" =============================================================================
+" File:          autoload/ctrlp/line.vim
+" Description:   Line extension
+" Author:        Kien Nguyen <github.com/kien>
+" =============================================================================
+
+" Init {{{1
+if exists('g:loaded_ctrlp_line') && g:loaded_ctrlp_line
+	fini
+en
+let g:loaded_ctrlp_line = 1
+
+cal add(g:ctrlp_ext_vars, {
+	\ 'init': 'ctrlp#line#init()',
+	\ 'accept': 'ctrlp#line#accept',
+	\ 'lname': 'lines',
+	\ 'sname': 'lns',
+	\ 'type': 'tabe',
+	\ })
+
+let s:id = g:ctrlp_builtins + len(g:ctrlp_ext_vars)
+" Utilities {{{1
+fu! s:syntax()
+	if !ctrlp#nosy()
+		cal ctrlp#hicheck('CtrlPBufName', 'Directory')
+		cal ctrlp#hicheck('CtrlPTabExtra', 'Comment')
+		sy match CtrlPBufName '\t|\zs[^|]\+\ze|\d\+:\d\+|$'
+		sy match CtrlPTabExtra '\zs\t.*\ze$' contains=CtrlPBufName
+	en
+endf
+" Public {{{1
+fu! ctrlp#line#init()
+	let [bufs, lines] = [ctrlp#buffers('id'), []]
+	for bufnr in bufs
+		let [lfb, bufn] = [getbufline(bufnr, 1, '$'), bufname(bufnr)]
+		let lfb = lfb == [] ? ctrlp#utils#readfile(fnamemodify(bufn, ':p')) : lfb
+		cal map(lfb, 'tr(v:val, ''	'', '' '')')
+		let [linenr, len_lfb, buft] = [1, len(lfb), fnamemodify(bufn, ':t')]
+		wh linenr <= len_lfb
+			let lfb[linenr - 1] .= '	|'.buft.'|'.bufnr.':'.linenr.'|'
+			let linenr += 1
+		endw
+		cal extend(lines, filter(lfb, 'v:val !~ ''^\s*\t|[^|]\+|\d\+:\d\+|$'''))
+	endfo
+	cal s:syntax()
+	retu lines
+endf
+
+fu! ctrlp#line#accept(mode, str)
+	let info = matchlist(a:str, '\t|[^|]\+|\(\d\+\):\(\d\+\)|$')
+	let bufnr = str2nr(get(info, 1))
+	if bufnr
+		cal ctrlp#acceptfile(a:mode, bufname(bufnr), get(info, 2))
+	en
+endf
+
+fu! ctrlp#line#id()
+	retu s:id
+endf
+"}}}
+
+" vim:fen:fdm=marker:fmr={{{,}}}:fdl=0:fdc=1:ts=2:sw=2:sts=2

+ 83 - 0
bundle/ctrlp/autoload/ctrlp/mixed.vim

@@ -0,0 +1,83 @@
+" =============================================================================
+" File:          autoload/ctrlp/mixed.vim
+" Description:   Mixing Files + MRU + Buffers
+" Author:        Kien Nguyen <github.com/kien>
+" =============================================================================
+
+" Init {{{1
+if exists('g:loaded_ctrlp_mixed') && g:loaded_ctrlp_mixed
+	fini
+en
+let [g:loaded_ctrlp_mixed, g:ctrlp_newmix] = [1, 0]
+
+cal add(g:ctrlp_ext_vars, {
+	\ 'init': 'ctrlp#mixed#init(s:compare_lim)',
+	\ 'accept': 'ctrlp#acceptfile',
+	\ 'lname': 'fil + mru + buf',
+	\ 'sname': 'mix',
+	\ 'type': 'path',
+	\ 'opmul': 1,
+	\ 'specinput': 1,
+	\ })
+
+let s:id = g:ctrlp_builtins + len(g:ctrlp_ext_vars)
+" Utilities {{{1
+fu! s:newcache(cwd)
+	if g:ctrlp_newmix || !has_key(g:ctrlp_allmixes, 'data') | retu 1 | en
+	retu g:ctrlp_allmixes['cwd'] != a:cwd
+		\ || g:ctrlp_allmixes['filtime'] < getftime(ctrlp#utils#cachefile())
+		\ || g:ctrlp_allmixes['mrutime'] < getftime(ctrlp#mrufiles#cachefile())
+		\ || g:ctrlp_allmixes['bufs'] < len(ctrlp#mrufiles#bufs())
+endf
+
+fu! s:getnewmix(cwd, clim)
+	if g:ctrlp_newmix
+		cal ctrlp#mrufiles#refresh('raw')
+		let g:ctrlp_newcache = 1
+	en
+	let g:ctrlp_lines = copy(ctrlp#files())
+	cal ctrlp#progress('Mixing...')
+	let mrufs = copy(ctrlp#mrufiles#list('raw'))
+	if exists('+ssl') && &ssl
+		cal map(mrufs, 'tr(v:val, "\\", "/")')
+	en
+	let bufs = map(ctrlp#buffers('id'), 'fnamemodify(bufname(v:val), ":p")')
+	let mrufs = bufs + filter(mrufs, 'index(bufs, v:val) < 0')
+	if len(mrufs) > len(g:ctrlp_lines)
+		cal filter(mrufs, 'stridx(v:val, a:cwd)')
+	el
+		let cwd_mrufs = filter(copy(mrufs), '!stridx(v:val, a:cwd)')
+		let cwd_mrufs = ctrlp#rmbasedir(cwd_mrufs)
+		for each in cwd_mrufs
+			let id = index(g:ctrlp_lines, each)
+			if id >= 0 | cal remove(g:ctrlp_lines, id) | en
+		endfo
+	en
+	cal map(mrufs, 'fnamemodify(v:val, ":.")')
+	let g:ctrlp_lines = len(mrufs) > len(g:ctrlp_lines)
+		\ ? g:ctrlp_lines + mrufs : mrufs + g:ctrlp_lines
+	if len(g:ctrlp_lines) <= a:clim
+		cal sort(g:ctrlp_lines, 'ctrlp#complen')
+	en
+	let g:ctrlp_allmixes = { 'filtime': getftime(ctrlp#utils#cachefile()),
+		\ 'mrutime': getftime(ctrlp#mrufiles#cachefile()), 'cwd': a:cwd,
+		\ 'bufs': len(ctrlp#mrufiles#bufs()), 'data': g:ctrlp_lines }
+endf
+" Public {{{1
+fu! ctrlp#mixed#init(clim)
+	let cwd = getcwd()
+	if s:newcache(cwd)
+		cal s:getnewmix(cwd, a:clim)
+	el
+		let g:ctrlp_lines = g:ctrlp_allmixes['data']
+	en
+	let g:ctrlp_newmix = 0
+	retu g:ctrlp_lines
+endf
+
+fu! ctrlp#mixed#id()
+	retu s:id
+endf
+"}}}
+
+" vim:fen:fdm=marker:fmr={{{,}}}:fdl=0:fdc=1:ts=2:sw=2:sts=2

+ 148 - 0
bundle/ctrlp/autoload/ctrlp/mrufiles.vim

@@ -0,0 +1,148 @@
+" =============================================================================
+" File:          autoload/ctrlp/mrufiles.vim
+" Description:   Most Recently Used Files extension
+" Author:        Kien Nguyen <github.com/kien>
+" =============================================================================
+
+" Static variables {{{1
+let [s:mrbs, s:mrufs] = [[], []]
+
+fu! ctrlp#mrufiles#opts()
+	let [pref, opts] = ['g:ctrlp_mruf_', {
+		\ 'max': ['s:max', 250],
+		\ 'include': ['s:in', ''],
+		\ 'exclude': ['s:ex', ''],
+		\ 'case_sensitive': ['s:cseno', 1],
+		\ 'relative': ['s:re', 0],
+		\ 'save_on_update': ['s:soup', 1],
+		\ }]
+	for [ke, va] in items(opts)
+		let [{va[0]}, {pref.ke}] = [pref.ke, exists(pref.ke) ? {pref.ke} : va[1]]
+	endfo
+endf
+cal ctrlp#mrufiles#opts()
+" Utilities {{{1
+fu! s:excl(fn)
+	retu !empty({s:ex}) && a:fn =~# {s:ex}
+endf
+
+fu! s:mergelists()
+	let diskmrufs = ctrlp#utils#readfile(ctrlp#mrufiles#cachefile())
+	cal filter(diskmrufs, 'index(s:mrufs, v:val) < 0')
+	let mrufs = s:mrufs + diskmrufs
+	retu s:chop(mrufs)
+endf
+
+fu! s:chop(mrufs)
+	if len(a:mrufs) > {s:max} | cal remove(a:mrufs, {s:max}, -1) | en
+	retu a:mrufs
+endf
+
+fu! s:reformat(mrufs)
+	let cwd = getcwd()
+	let cwd .= cwd !~ '[\/]$' ? ctrlp#utils#lash() : ''
+	if {s:re}
+		let cwd = exists('+ssl') ? tr(cwd, '/', '\') : cwd
+		cal filter(a:mrufs, '!stridx(v:val, cwd)')
+	en
+	let idx = strlen(cwd)
+	if exists('+ssl') && &ssl
+		let cwd = tr(cwd, '\', '/')
+		cal map(a:mrufs, 'tr(v:val, "\\", "/")')
+	en
+	retu map(a:mrufs, '!stridx(v:val, cwd) ? strpart(v:val, idx) : v:val')
+endf
+
+fu! s:record(bufnr)
+	if s:locked | retu | en
+	let bufnr = a:bufnr + 0
+	let bufname = bufname(bufnr)
+	if bufnr > 0 && !empty(bufname)
+		cal filter(s:mrbs, 'v:val != bufnr')
+		cal insert(s:mrbs, bufnr)
+		cal s:addtomrufs(bufname)
+	en
+endf
+
+fu! s:addtomrufs(fname)
+	let fn = fnamemodify(a:fname, ':p')
+	let fn = exists('+ssl') ? tr(fn, '/', '\') : fn
+	if ( !empty({s:in}) && fn !~# {s:in} ) || ( !empty({s:ex}) && fn =~# {s:ex} )
+		\ || !empty(getbufvar('^'.fn.'$', '&bt')) || !filereadable(fn) | retu
+	en
+	let idx = index(s:mrufs, fn, 0, !{s:cseno})
+	if idx
+		cal filter(s:mrufs, 'v:val !='.( {s:cseno} ? '#' : '?' ).' fn')
+		cal insert(s:mrufs, fn)
+		if {s:soup} && idx < 0
+			cal s:savetofile(s:mergelists())
+		en
+	en
+endf
+
+fu! s:savetofile(mrufs)
+	cal ctrlp#utils#writecache(a:mrufs, s:cadir, s:cafile)
+endf
+" Public {{{1
+fu! ctrlp#mrufiles#refresh(...)
+	let mrufs = s:mergelists()
+	cal filter(mrufs, '!empty(ctrlp#utils#glob(v:val, 1)) && !s:excl(v:val)')
+	if exists('+ssl')
+		cal map(mrufs, 'tr(v:val, "/", "\\")')
+		cal map(s:mrufs, 'tr(v:val, "/", "\\")')
+		let cond = 'count(mrufs, v:val, !{s:cseno}) == 1'
+		cal filter(mrufs, cond)
+		cal filter(s:mrufs, cond)
+	en
+	cal s:savetofile(mrufs)
+	retu a:0 && a:1 == 'raw' ? [] : s:reformat(mrufs)
+endf
+
+fu! ctrlp#mrufiles#remove(files)
+	let mrufs = []
+	if a:files != []
+		let mrufs = s:mergelists()
+		let cond = 'index(a:files, v:val, 0, !{s:cseno}) < 0'
+		cal filter(mrufs, cond)
+		cal filter(s:mrufs, cond)
+	en
+	cal s:savetofile(mrufs)
+	retu s:reformat(mrufs)
+endf
+
+fu! ctrlp#mrufiles#add(fn)
+	if !empty(a:fn)
+		cal s:addtomrufs(a:fn)
+	en
+endf
+
+fu! ctrlp#mrufiles#list(...)
+	retu a:0 ? a:1 == 'raw' ? s:mergelists() : 0 : s:reformat(s:mergelists())
+endf
+
+fu! ctrlp#mrufiles#bufs()
+	retu s:mrbs
+endf
+
+fu! ctrlp#mrufiles#cachefile()
+	if !exists('s:cadir') || !exists('s:cafile')
+		let s:cadir = ctrlp#utils#cachedir().ctrlp#utils#lash().'mru'
+		let s:cafile = s:cadir.ctrlp#utils#lash().'cache.txt'
+	en
+	retu s:cafile
+endf
+
+fu! ctrlp#mrufiles#init()
+	if !has('autocmd') | retu | en
+	let s:locked = 0
+	aug CtrlPMRUF
+		au!
+		au BufAdd,BufEnter,BufLeave,BufWritePost * cal s:record(expand('<abuf>', 1))
+		au QuickFixCmdPre  *vimgrep* let s:locked = 1
+		au QuickFixCmdPost *vimgrep* let s:locked = 0
+		au VimLeavePre * cal s:savetofile(s:mergelists())
+	aug END
+endf
+"}}}
+
+" vim:fen:fdm=marker:fmr={{{,}}}:fdl=0:fdc=1:ts=2:sw=2:sts=2

+ 59 - 0
bundle/ctrlp/autoload/ctrlp/quickfix.vim

@@ -0,0 +1,59 @@
+" =============================================================================
+" File:          autoload/ctrlp/quickfix.vim
+" Description:   Quickfix extension
+" Author:        Kien Nguyen <github.com/kien>
+" =============================================================================
+
+" Init {{{1
+if exists('g:loaded_ctrlp_quickfix') && g:loaded_ctrlp_quickfix
+	fini
+en
+let g:loaded_ctrlp_quickfix = 1
+
+cal add(g:ctrlp_ext_vars, {
+	\ 'init': 'ctrlp#quickfix#init()',
+	\ 'accept': 'ctrlp#quickfix#accept',
+	\ 'lname': 'quickfix',
+	\ 'sname': 'qfx',
+	\ 'type': 'line',
+	\ 'sort': 0,
+	\ 'nolim': 1,
+	\ })
+
+let s:id = g:ctrlp_builtins + len(g:ctrlp_ext_vars)
+
+fu! s:lineout(dict)
+	retu printf('%s|%d:%d| %s', bufname(a:dict['bufnr']), a:dict['lnum'],
+		\ a:dict['col'], matchstr(a:dict['text'], '\s*\zs.*\S'))
+endf
+" Utilities {{{1
+fu! s:syntax()
+	if !ctrlp#nosy()
+		cal ctrlp#hicheck('CtrlPqfLineCol', 'Search')
+		sy match CtrlPqfLineCol '|\zs\d\+:\d\+\ze|'
+	en
+endf
+" Public {{{1
+fu! ctrlp#quickfix#init()
+	cal s:syntax()
+	retu map(getqflist(), 's:lineout(v:val)')
+endf
+
+fu! ctrlp#quickfix#accept(mode, str)
+	let vals = matchlist(a:str, '^\([^|]\+\ze\)|\(\d\+\):\(\d\+\)|')
+	if vals == [] || vals[1] == '' | retu | en
+	cal ctrlp#acceptfile(a:mode, vals[1])
+	let cur_pos = getpos('.')[1:2]
+	if cur_pos != [1, 1] && cur_pos != map(vals[2:3], 'str2nr(v:val)')
+		mark '
+	en
+	cal cursor(vals[2], vals[3])
+	sil! norm! zvzz
+endf
+
+fu! ctrlp#quickfix#id()
+	retu s:id
+endf
+"}}}
+
+" vim:fen:fdm=marker:fmr={{{,}}}:fdl=0:fdc=1:ts=2:sw=2:sts=2

+ 59 - 0
bundle/ctrlp/autoload/ctrlp/rtscript.vim

@@ -0,0 +1,59 @@
+" =============================================================================
+" File:          autoload/ctrlp/rtscript.vim
+" Description:   Runtime scripts extension
+" Author:        Kien Nguyen <github.com/kien>
+" =============================================================================
+
+" Init {{{1
+if exists('g:loaded_ctrlp_rtscript') && g:loaded_ctrlp_rtscript
+	fini
+en
+let [g:loaded_ctrlp_rtscript, g:ctrlp_newrts] = [1, 0]
+
+cal add(g:ctrlp_ext_vars, {
+	\ 'init': 'ctrlp#rtscript#init(s:caching)',
+	\ 'accept': 'ctrlp#acceptfile',
+	\ 'lname': 'runtime scripts',
+	\ 'sname': 'rts',
+	\ 'type': 'path',
+	\ 'opmul': 1,
+	\ })
+
+let s:id = g:ctrlp_builtins + len(g:ctrlp_ext_vars)
+
+let s:filecounts = {}
+" Utilities {{{1
+fu! s:nocache()
+	retu g:ctrlp_newrts ||
+		\ !s:caching || ( s:caching > 1 && get(s:filecounts, s:cwd) < s:caching )
+endf
+" Public {{{1
+fu! ctrlp#rtscript#init(caching)
+	let [s:caching, s:cwd] = [a:caching, getcwd()]
+	if s:nocache() ||
+		\ !( exists('g:ctrlp_rtscache') && g:ctrlp_rtscache[0] == &rtp )
+		sil! cal ctrlp#progress('Indexing...')
+		let entries = split(globpath(ctrlp#utils#fnesc(&rtp, 'g'), '**/*.*'), "\n")
+		cal filter(entries, 'count(entries, v:val) == 1')
+		let [entries, echoed] = [ctrlp#dirnfile(entries)[1], 1]
+	el
+		let [entries, results] = g:ctrlp_rtscache[2:3]
+	en
+	if s:nocache() ||
+		\ !( exists('g:ctrlp_rtscache') && g:ctrlp_rtscache[:1] == [&rtp, s:cwd] )
+		if !exists('echoed')
+			sil! cal ctrlp#progress('Processing...')
+		en
+		let results = map(copy(entries), 'fnamemodify(v:val, '':.'')')
+	en
+	let [g:ctrlp_rtscache, g:ctrlp_newrts] = [[&rtp, s:cwd, entries, results], 0]
+	cal extend(s:filecounts, { s:cwd : len(results) })
+	retu results
+endf
+
+fu! ctrlp#rtscript#id()
+	retu s:id
+endf
+"}}}
+
+" vim:fen:fdm=marker:fmr={{{,}}}:fdl=0:fdc=1:ts=2:sw=2:sts=2

+ 128 - 0
bundle/ctrlp/autoload/ctrlp/tag.vim

@@ -0,0 +1,128 @@
+" =============================================================================
+" File:          autoload/ctrlp/tag.vim
+" Description:   Tag file extension
+" Author:        Kien Nguyen <github.com/kien>
+" =============================================================================
+
+" Init {{{1
+if exists('g:loaded_ctrlp_tag') && g:loaded_ctrlp_tag
+	fini
+en
+let g:loaded_ctrlp_tag = 1
+
+cal add(g:ctrlp_ext_vars, {
+	\ 'init': 'ctrlp#tag#init()',
+	\ 'accept': 'ctrlp#tag#accept',
+	\ 'lname': 'tags',
+	\ 'sname': 'tag',
+	\ 'enter': 'ctrlp#tag#enter()',
+	\ 'type': 'tabs',
+	\ })
+
+let s:id = g:ctrlp_builtins + len(g:ctrlp_ext_vars)
+" Utilities {{{1
+fu! s:findcount(str)
+	let [tg, fname] = split(a:str, '\t\+\ze[^\t]\+$')
+	let tgs = taglist('^'.tg.'$')
+	if len(tgs) < 2
+		retu [1, 1]
+	en
+	let bname = fnamemodify(bufname('%'), ':p')
+	let fname = expand(fnamemodify(simplify(fname), ':s?^[.\/]\+??:p:.'), 1)
+	let [fnd, ct, pos, idx] = [0, 0, 0, 0]
+	wh idx < len(tgs)
+		if bname == fnamemodify(tgs[idx]["filename"], ':p')
+			cal insert(tgs, remove(tgs, idx))
+			brea
+		en
+		let idx += 1
+	endw
+	for each in tgs
+		let ct += 1
+		let fulname = fnamemodify(each["filename"], ':p')
+		if stridx(fulname, fname) >= 0
+			\ && strlen(fname) + stridx(fulname, fname) == strlen(fulname)
+			let fnd += 1
+			let pos = ct
+		en
+		if fnd > 1 | brea | en
+	endfo
+	retu [fnd, pos]
+endf
+
+fu! s:filter(tags)
+	let nr = 0
+	wh 0 < 1
+		if a:tags == [] | brea | en
+		if a:tags[nr] =~ '^!' && a:tags[nr] !~# '^!_TAG_'
+			let nr += 1
+			con
+		en
+		if a:tags[nr] =~# '^!_TAG_' && len(a:tags) > nr
+			cal remove(a:tags, nr)
+		el
+			brea
+		en
+	endw
+	retu a:tags
+endf
+
+fu! s:syntax()
+	if !ctrlp#nosy()
+		cal ctrlp#hicheck('CtrlPTabExtra', 'Comment')
+		sy match CtrlPTabExtra '\zs\t.*\ze$'
+	en
+endf
+" Public {{{1
+fu! ctrlp#tag#init()
+	if empty(s:tagfiles) | retu [] | en
+	let g:ctrlp_alltags = []
+	let tagfiles = sort(filter(s:tagfiles, 'count(s:tagfiles, v:val) == 1'))
+	for each in tagfiles
+		let alltags = s:filter(ctrlp#utils#readfile(each))
+		cal extend(g:ctrlp_alltags, alltags)
+	endfo
+	cal s:syntax()
+	retu g:ctrlp_alltags
+endf
+
+fu! ctrlp#tag#accept(mode, str)
+	cal ctrlp#exit()
+	let str = matchstr(a:str, '^[^\t]\+\t\+[^\t]\+\ze\t')
+	let [tg, fnd] = [split(str, '^[^\t]\+\zs\t')[0], s:findcount(str)]
+	let cmds = {
+		\ 't': ['tab sp', 'tab stj'],
+		\ 'h': ['sp', 'stj'],
+		\ 'v': ['vs', 'vert stj'],
+		\ 'e': ['', 'tj'],
+		\ }
+	let cmd = fnd[0] == 1 ? cmds[a:mode][0] : cmds[a:mode][1]
+	let cmd = a:mode == 'e' && ctrlp#modfilecond(!&aw)
+		\ ? ( cmd == 'tj' ? 'stj' : 'sp' ) : cmd
+	let cmd = a:mode == 't' ? ctrlp#tabcount().cmd : cmd
+	if fnd[0] == 1
+		if cmd != ''
+			exe cmd
+		en
+		let save_cst = &cst
+		set cst&
+		cal feedkeys(":".fnd[1]."ta ".tg."\r", 'nt')
+		let &cst = save_cst
+	el
+		cal feedkeys(":".cmd." ".tg."\r", 'nt')
+	en
+	cal ctrlp#setlcdir()
+endf
+
+fu! ctrlp#tag#id()
+	retu s:id
+endf
+
+fu! ctrlp#tag#enter()
+	let tfs = tagfiles()
+	let s:tagfiles = tfs != [] ? filter(map(tfs, 'fnamemodify(v:val, ":p")'),
+		\ 'filereadable(v:val)') : []
+endf
+"}}}
+
+" vim:fen:fdm=marker:fmr={{{,}}}:fdl=0:fdc=1:ts=2:sw=2:sts=2

+ 154 - 0
bundle/ctrlp/autoload/ctrlp/undo.vim

@@ -0,0 +1,154 @@
+" =============================================================================
+" File:          autoload/ctrlp/undo.vim
+" Description:   Undo extension
+" Author:        Kien Nguyen <github.com/kien>
+" =============================================================================
+
+" Init {{{1
+if ( exists('g:loaded_ctrlp_undo') && g:loaded_ctrlp_undo )
+	fini
+en
+let g:loaded_ctrlp_undo = 1
+
+cal add(g:ctrlp_ext_vars, {
+	\ 'init': 'ctrlp#undo#init()',
+	\ 'accept': 'ctrlp#undo#accept',
+	\ 'lname': 'undo',
+	\ 'sname': 'udo',
+	\ 'enter': 'ctrlp#undo#enter()',
+	\ 'exit': 'ctrlp#undo#exit()',
+	\ 'type': 'line',
+	\ 'sort': 0,
+	\ 'nolim': 1,
+	\ })
+
+let s:id = g:ctrlp_builtins + len(g:ctrlp_ext_vars)
+
+let s:text = map(['second', 'seconds', 'minutes', 'hours', 'days', 'weeks',
+	\ 'months', 'years'], '" ".v:val." ago"')
+" Utilities {{{1
+fu! s:getundo()
+	if exists('*undotree')
+		\ && ( v:version > 703 || ( v:version == 703 && has('patch005') ) )
+		retu [1, undotree()]
+	el
+		redi => result
+		sil! undol
+		redi END
+		retu [0, split(result, "\n")[1:]]
+	en
+endf
+
+fu! s:flatten(tree, cur)
+	let flatdict = {}
+	for each in a:tree
+		let saved = has_key(each, 'save') ? 'saved' : ''
+		let current = each['seq'] == a:cur ? 'current' : ''
+		cal extend(flatdict, { each['seq'] : [each['time'], saved, current] })
+		if has_key(each, 'alt')
+			cal extend(flatdict, s:flatten(each['alt'], a:cur))
+		en
+	endfo
+	retu flatdict
+endf
+
+fu! s:elapsed(nr)
+	let [text, time] = [s:text, localtime() - a:nr]
+	let mins = time / 60
+	let hrs  = time / 3600
+	let days = time / 86400
+	let wks  = time / 604800
+	let mons = time / 2592000
+	let yrs  = time / 31536000
+	if yrs > 1
+		retu yrs.text[7]
+	elsei mons > 1
+		retu mons.text[6]
+	elsei wks > 1
+		retu wks.text[5]
+	elsei days > 1
+		retu days.text[4]
+	elsei hrs > 1
+		retu hrs.text[3]
+	elsei mins > 1
+		retu mins.text[2]
+	elsei time == 1
+		retu time.text[0]
+	elsei time < 120
+		retu time.text[1]
+	en
+endf
+
+fu! s:syntax()
+	if ctrlp#nosy() | retu | en
+	for [ke, va] in items({'T': 'Directory', 'Br': 'Comment', 'Nr': 'String',
+		\ 'Sv': 'Comment', 'Po': 'Title'})
+		cal ctrlp#hicheck('CtrlPUndo'.ke, va)
+	endfo
+	sy match CtrlPUndoT '\v\d+ \zs[^ ]+\ze|\d+:\d+:\d+'
+	sy match CtrlPUndoBr '\[\|\]'
+	sy match CtrlPUndoNr '\[\d\+\]' contains=CtrlPUndoBr
+	sy match CtrlPUndoSv 'saved'
+	sy match CtrlPUndoPo 'current'
+endf
+
+fu! s:dict2list(dict)
+	for ke in keys(a:dict)
+		let a:dict[ke][0] = s:elapsed(a:dict[ke][0])
+	endfo
+	retu map(keys(a:dict), 'eval(''[v:val, a:dict[v:val]]'')')
+endf
+
+fu! s:compval(...)
+	retu a:2[0] - a:1[0]
+endf
+
+fu! s:format(...)
+	let saved = !empty(a:1[1][1]) ? ' '.a:1[1][1] : ''
+	let current = !empty(a:1[1][2]) ? ' '.a:1[1][2] : ''
+	retu a:1[1][0].' ['.a:1[0].']'.saved.current
+endf
+
+fu! s:formatul(...)
+	let parts = matchlist(a:1,
+		\ '\v^\s+(\d+)\s+\d+\s+([^ ]+\s?[^ ]+|\d+\s\w+\s\w+)(\s*\d*)$')
+	retu parts == [] ? '----'
+		\ : parts[2].' ['.parts[1].']'.( parts[3] != '' ? ' saved' : '' )
+endf
+" Public {{{1
+fu! ctrlp#undo#init()
+	let entries = s:undos[0] ? s:undos[1]['entries'] : s:undos[1]
+	if empty(entries) | retu [] | en
+	if !exists('s:lines')
+		if s:undos[0]
+			let entries = s:dict2list(s:flatten(entries, s:undos[1]['seq_cur']))
+			let s:lines = map(sort(entries, 's:compval'), 's:format(v:val)')
+		el
+			let s:lines = map(reverse(entries), 's:formatul(v:val)')
+		en
+	en
+	cal s:syntax()
+	retu s:lines
+endf
+
+fu! ctrlp#undo#accept(mode, str)
+	let undon = matchstr(a:str, '\[\zs\d\+\ze\]')
+	if empty(undon) | retu | en
+	cal ctrlp#exit()
+	exe 'u' undon
+endf
+
+fu! ctrlp#undo#id()
+	retu s:id
+endf
+
+fu! ctrlp#undo#enter()
+	let s:undos = s:getundo()
+endf
+
+fu! ctrlp#undo#exit()
+	unl! s:lines
+endf
+"}}}
+
+" vim:fen:fdm=marker:fmr={{{,}}}:fdl=0:fdc=1:ts=2:sw=2:sts=2

+ 120 - 0
bundle/ctrlp/autoload/ctrlp/utils.vim

@@ -0,0 +1,120 @@
+" =============================================================================
+" File:          autoload/ctrlp/utils.vim
+" Description:   Utilities
+" Author:        Kien Nguyen <github.com/kien>
+" =============================================================================
+
+" Static variables {{{1
+fu! ctrlp#utils#lash()
+	retu &ssl || !exists('+ssl') ? '/' : '\'
+endf
+
+fu! s:lash(...)
+	retu ( a:0 ? a:1 : getcwd() ) !~ '[\/]$' ? s:lash : ''
+endf
+
+fu! ctrlp#utils#opts()
+	let s:lash = ctrlp#utils#lash()
+	let usrhome = $HOME . s:lash( $HOME )
+	let cahome = exists('$XDG_CACHE_HOME') ? $XDG_CACHE_HOME : usrhome.'.cache'
+	let cadir = isdirectory(usrhome.'.ctrlp_cache')
+		\ ? usrhome.'.ctrlp_cache' : cahome.s:lash(cahome).'ctrlp'
+	if exists('g:ctrlp_cache_dir')
+		let cadir = expand(g:ctrlp_cache_dir, 1)
+		if isdirectory(cadir.s:lash(cadir).'.ctrlp_cache')
+			let cadir = cadir.s:lash(cadir).'.ctrlp_cache'
+		en
+	en
+	let s:cache_dir = cadir
+endf
+cal ctrlp#utils#opts()
+
+let s:wig_cond = v:version > 702 || ( v:version == 702 && has('patch051') )
+" Files and Directories {{{1
+fu! ctrlp#utils#cachedir()
+	retu s:cache_dir
+endf
+
+fu! ctrlp#utils#cachefile(...)
+	let [tail, dir] = [a:0 == 1 ? '.'.a:1 : '', a:0 == 2 ? a:1 : getcwd()]
+	let cache_file = substitute(dir, '\([\/]\|^\a\zs:\)', '%', 'g').tail.'.txt'
+	retu a:0 == 1 ? cache_file : s:cache_dir.s:lash(s:cache_dir).cache_file
+endf
+
+fu! ctrlp#utils#readfile(file)
+	if filereadable(a:file)
+		let data = readfile(a:file)
+		if empty(data) || type(data) != 3
+			unl data
+			let data = []
+		en
+		retu data
+	en
+	retu []
+endf
+
+fu! ctrlp#utils#mkdir(dir)
+	if exists('*mkdir') && !isdirectory(a:dir)
+		sil! cal mkdir(a:dir, 'p')
+	en
+	retu a:dir
+endf
+
+fu! ctrlp#utils#writecache(lines, ...)
+	if isdirectory(ctrlp#utils#mkdir(a:0 ? a:1 : s:cache_dir))
+		sil! cal writefile(a:lines, a:0 >= 2 ? a:2 : ctrlp#utils#cachefile())
+	en
+endf
+
+fu! ctrlp#utils#glob(...)
+	let path = ctrlp#utils#fnesc(a:1, 'g')
+	retu s:wig_cond ? glob(path, a:2) : glob(path)
+endf
+
+fu! ctrlp#utils#globpath(...)
+	retu call('globpath', s:wig_cond ? a:000 : a:000[:1])
+endf
+
+fu! ctrlp#utils#fnesc(path, type, ...)
+	if exists('*fnameescape')
+		if exists('+ssl')
+			if a:type == 'c'
+				let path = escape(a:path, '%#')
+			elsei a:type == 'f'
+				let path = fnameescape(a:path)
+			elsei a:type == 'g'
+				let path = escape(a:path, '?*')
+			en
+			let path = substitute(path, '[', '[[]', 'g')
+		el
+			let path = fnameescape(a:path)
+		en
+	el
+		if exists('+ssl')
+			if a:type == 'c'
+				let path = escape(a:path, '%#')
+			elsei a:type == 'f'
+				let path = escape(a:path, " \t\n%#*?|<\"")
+			elsei a:type == 'g'
+				let path = escape(a:path, '?*')
+			en
+			let path = substitute(path, '[', '[[]', 'g')
+		el
+			let path = escape(a:path, " \t\n*?[{`$\\%#'\"|!<")
+		en
+	en
+	retu a:0 ? escape(path, a:1) : path
+endf
+
+fu! ctrlp#utils#dircompl(...)
+	let [hsl, str] = [match(a:1, '[\/]'), '']
+	let par = substitute(a:1, '[^\/]*$', '', '')
+	let path = !hsl ? par : hsl > 0 ? getcwd().s:lash().par : getcwd()
+	for dir in split(globpath(ctrlp#utils#fnesc(path, 'g', ','), '*/'), '\n')
+		let str .= par.split(dir, '[\/]')[-1]."\n"
+	endfo
+	retu str
+endf
+"}}}
+
+" vim:fen:fdm=marker:fmr={{{,}}}:fdl=0:fdc=1:ts=2:sw=2:sts=2

File diff suppressed because it is too large
+ 1406 - 0
bundle/ctrlp/doc/ctrlp.txt


+ 69 - 0
bundle/ctrlp/plugin/ctrlp.vim

@@ -0,0 +1,69 @@
+" =============================================================================
+" File:          plugin/ctrlp.vim
+" Description:   Fuzzy file, buffer, mru, tag, etc finder.
+" Author:        Kien Nguyen <github.com/kien>
+" =============================================================================
+" GetLatestVimScripts: 3736 1 :AutoInstall: ctrlp.zip
+
+if ( exists('g:loaded_ctrlp') && g:loaded_ctrlp ) || v:version < 700 || &cp
+	fini
+en
+let g:loaded_ctrlp = 1
+
+let [g:ctrlp_lines, g:ctrlp_allfiles, g:ctrlp_alltags, g:ctrlp_alldirs,
+	\ g:ctrlp_allmixes, g:ctrlp_buftags, g:ctrlp_ext_vars, g:ctrlp_builtins]
+	\ = [[], [], [], [], {}, {}, [], 2]
+
+if !exists('g:ctrlp_map') | let g:ctrlp_map = '<c-p>' | en
+if !exists('g:ctrlp_cmd') | let g:ctrlp_cmd = 'CtrlP' | en
+
+com! -n=? -com=custom,ctrlp#utils#dircompl CtrlP
+	\ cal ctrlp#init(0, { 'dir': <q-args> })
+
+com! -n=? -com=custom,ctrlp#utils#dircompl CtrlPMRUFiles
+	\ cal ctrlp#init(2, { 'dir': <q-args> })
+
+com! -bar CtrlPBuffer   cal ctrlp#init(1)
+com! -n=? CtrlPLastMode cal ctrlp#init(-1, { 'args': <q-args> })
+
+com! -bar CtrlPClearCache     cal ctrlp#clr()
+com! -bar CtrlPClearAllCaches cal ctrlp#clra()
+
+com! -bar ClearCtrlPCache     cal ctrlp#clr()
+com! -bar ClearAllCtrlPCaches cal ctrlp#clra()
+
+com! -bar CtrlPCurWD   cal ctrlp#init(0, { 'mode': '' })
+com! -bar CtrlPCurFile cal ctrlp#init(0, { 'mode': 'c' })
+com! -bar CtrlPRoot    cal ctrlp#init(0, { 'mode': 'r' })
+
+if g:ctrlp_map != '' && !hasmapto(':<c-u>'.g:ctrlp_cmd.'<cr>', 'n')
+	exe 'nn <silent>' g:ctrlp_map ':<c-u>'.g:ctrlp_cmd.'<cr>'
+en
+
+cal ctrlp#mrufiles#init()
+
+com! -bar CtrlPTag      cal ctrlp#init(ctrlp#tag#id())
+com! -bar CtrlPQuickfix cal ctrlp#init(ctrlp#quickfix#id())
+
+com! -n=? -com=custom,ctrlp#utils#dircompl CtrlPDir
+	\ cal ctrlp#init(ctrlp#dir#id(), { 'dir': <q-args> })
+
+com! -n=? -com=buffer CtrlPBufTag
+	\ cal ctrlp#init(ctrlp#buffertag#cmd(0, <q-args>))
+
+com! -bar CtrlPBufTagAll cal ctrlp#init(ctrlp#buffertag#cmd(1))
+com! -bar CtrlPRTS       cal ctrlp#init(ctrlp#rtscript#id())
+com! -bar CtrlPUndo      cal ctrlp#init(ctrlp#undo#id())
+com! -bar CtrlPLine      cal ctrlp#init(ctrlp#line#id())
+
+com! -n=? -com=buffer CtrlPChange
+	\ cal ctrlp#init(ctrlp#changes#cmd(0, <q-args>))
+
+com! -bar CtrlPChangeAll   cal ctrlp#init(ctrlp#changes#cmd(1))
+com! -bar CtrlPMixed       cal ctrlp#init(ctrlp#mixed#id())
+com! -bar CtrlPBookmarkDir cal ctrlp#init(ctrlp#bookmarkdir#id())
+
+com! -n=? -com=custom,ctrlp#utils#dircompl CtrlPBookmarkDirAdd
+	\ cal ctrlp#call('ctrlp#bookmarkdir#add', <q-args>)
+
+" vim:ts=2:sw=2:sts=2

+ 8 - 0
bundle/ctrlp/readme.md

@@ -0,0 +1,8 @@
+# ctrlp.vim
+Fuzzy __file__, __buffer__, __mru__, __tag__, ... finder for Vim.
+
+* [**Project's homepage**][1]
+* [**Main git repository**][2]
+
+[1]: http://kien.github.com/ctrlp.vim
+[2]: https://github.com/kien/ctrlp.vim

+ 1 - 0
bundle/neocomplete

@@ -0,0 +1 @@
+Subproject commit 5f3e213c629b7fe1aa3723bf56fe3ead5555a526

+ 1 - 0
bundle/nerdtree

@@ -0,0 +1 @@
+Subproject commit 184fbb6ffea6dc69726b229a08153c9d08522386

+ 1 - 0
bundle/pydiction

@@ -0,0 +1 @@
+Subproject commit 41c7143133f67e17a18317f6e45d12ac220d2736

+ 3 - 0
bundle/self_vim/1.py

@@ -0,0 +1,3 @@
+#!/usr/bin/python
+print (1)
+

+ 30 - 0
bundle/self_vim/srech.sh

@@ -0,0 +1,30 @@
+#!/bin/bash
+conent_dir=~/.vim/bundle/self_vim/content.txt
+
+rm -rf $content_dir
+
+sou=$(whiptail --title "search content" --inputbox "input search content" 10 60 "" 3>&1 1>&2 2>&3)
+dir=$(whiptail --title "search directory" --inputbox "directory" 10 60 "/" 3>&1 1>&2 2>&3)
+
+for i in `find $dir -type f -name "*"`
+do
+	if [ ${i} != $content_dir ];then
+		# echo "1-2"|awk 'BEGIN{FS="-";OFS=","}{print $1,$2}
+		echo "search directory ---" $i
+		echo `grep    -n ${sou} $i|awk -F ':' -v k=$i '{print k}'|sed 's/ /\n/g'|sort |uniq -c` >> $content_dir
+	fi
+done
+
+R=`cat $content_dir|awk '{print $2,$1}'`
+
+if [ -z $R ];then
+	echo "file not exist"
+	exit
+fi
+
+O=$(whiptail --title "search result" --menu "select open" 15 60 0 $R 3>&1 1>&2 2>&3)
+
+index=`grep "$O" $content_dir|awk '{print $1}'`
+echo "open file $O index"
+vim $O -c $index
+

+ 19 - 0
bundle/self_vim/srech.vim

@@ -0,0 +1,19 @@
+"function! Go(cmd,...)
+	""%这个是获取当前名字
+"	exec "!time echo $GOROOT"
+"	echo  a:cmd
+"call Srech()
+"endfunction
+function! Srech()
+	!command cd ~/.vim/bundle/self_vim/ && ./srech.sh
+endfunction
+
+"function! Start_go(start,...)
+"   !command  /bin/bash -c
+ "echo 1;echo 2;echo $GOPATH"
+""第一个参数
+"    echo a:start
+""第二个参数
+"  echo a:{1}
+"endfunction
+

+ 1 - 0
bundle/self_vim/test.sh

@@ -0,0 +1 @@
+echo 11 

+ 1 - 0
bundle/tabular

@@ -0,0 +1 @@
+Subproject commit 339091ac4dd1f17e225fe7d57b48aff55f99b23a

+ 1 - 0
bundle/vim-colors-solarized

@@ -0,0 +1 @@
+Subproject commit 528a59f26d12278698bb946f8fb82a63711eec21

+ 276 - 0
colors/molokai.vim

@@ -0,0 +1,276 @@
+" Vim color file
+"
+" Author: Tomas Restrepo <tomas@winterdom.com>
+" https://github.com/tomasr/molokai
+"
+" Note: Based on the Monokai theme for TextMate
+" by Wimer Hazenberg and its darker variant
+" by Hamish Stuart Macpherson
+"
+
+hi clear
+
+if version > 580
+    " no guarantees for version 5.8 and below, but this makes it stop
+    " complaining
+    hi clear
+    if exists("syntax_on")
+        syntax reset
+    endif
+endif
+let g:colors_name="molokai"
+
+if exists("g:molokai_original")
+    let s:molokai_original = g:molokai_original
+else
+    let s:molokai_original = 0
+endif
+
+
+hi Boolean         guifg=#AE81FF
+hi Character       guifg=#E6DB74
+hi Number          guifg=#AE81FF
+hi String          guifg=#E6DB74
+hi Conditional     guifg=#F92672               gui=bold
+hi Constant        guifg=#AE81FF               gui=bold
+hi Cursor          guifg=#000000 guibg=#F8F8F0
+hi iCursor         guifg=#000000 guibg=#F8F8F0
+hi Debug           guifg=#BCA3A3               gui=bold
+hi Define          guifg=#66D9EF
+hi Delimiter       guifg=#8F8F8F
+hi DiffAdd                       guibg=#13354A
+hi DiffChange      guifg=#89807D guibg=#4C4745
+hi DiffDelete      guifg=#960050 guibg=#1E0010
+hi DiffText                      guibg=#4C4745 gui=italic,bold
+
+hi Directory       guifg=#A6E22E               gui=bold
+hi Error           guifg=#E6DB74 guibg=#1E0010
+hi ErrorMsg        guifg=#F92672 guibg=#232526 gui=bold
+hi Exception       guifg=#A6E22E               gui=bold
+hi Float           guifg=#AE81FF
+hi FoldColumn      guifg=#465457 guibg=#000000
+hi Folded          guifg=#465457 guibg=#000000
+hi Function        guifg=#A6E22E
+hi Identifier      guifg=#FD971F
+hi Ignore          guifg=#808080 guibg=bg
+hi IncSearch       guifg=#C4BE89 guibg=#000000
+
+hi Keyword         guifg=#F92672               gui=bold
+hi Label           guifg=#E6DB74               gui=none
+hi Macro           guifg=#C4BE89               gui=italic
+hi SpecialKey      guifg=#66D9EF               gui=italic
+
+hi MatchParen      guifg=#000000 guibg=#FD971F gui=bold
+hi ModeMsg         guifg=#E6DB74
+hi MoreMsg         guifg=#E6DB74
+hi Operator        guifg=#F92672
+
+" complete menu
+hi Pmenu           guifg=#66D9EF guibg=#000000
+hi PmenuSel                      guibg=#808080
+hi PmenuSbar                     guibg=#080808
+hi PmenuThumb      guifg=#66D9EF
+
+hi PreCondit       guifg=#A6E22E               gui=bold
+hi PreProc         guifg=#A6E22E
+hi Question        guifg=#66D9EF
+hi Repeat          guifg=#F92672               gui=bold
+hi Search          guifg=#000000 guibg=#FFE792
+" marks
+hi SignColumn      guifg=#A6E22E guibg=#232526
+hi SpecialChar     guifg=#F92672               gui=bold
+hi SpecialComment  guifg=#7E8E91               gui=bold
+hi Special         guifg=#66D9EF guibg=bg      gui=italic
+if has("spell")
+    hi SpellBad    guisp=#FF0000 gui=undercurl
+    hi SpellCap    guisp=#7070F0 gui=undercurl
+    hi SpellLocal  guisp=#70F0F0 gui=undercurl
+    hi SpellRare   guisp=#FFFFFF gui=undercurl
+endif
+hi Statement       guifg=#F92672               gui=bold
+hi StatusLine      guifg=#455354 guibg=fg
+hi StatusLineNC    guifg=#808080 guibg=#080808
+hi StorageClass    guifg=#FD971F               gui=italic
+hi Structure       guifg=#66D9EF
+hi Tag             guifg=#F92672               gui=italic
+hi Title           guifg=#ef5939
+hi Todo            guifg=#FFFFFF guibg=bg      gui=bold
+
+hi Typedef         guifg=#66D9EF
+hi Type            guifg=#66D9EF               gui=none
+hi Underlined      guifg=#808080               gui=underline
+
+hi VertSplit       guifg=#808080 guibg=#080808 gui=bold
+hi VisualNOS                     guibg=#403D3D
+hi Visual                        guibg=#403D3D
+hi WarningMsg      guifg=#FFFFFF guibg=#333333 gui=bold
+hi WildMenu        guifg=#66D9EF guibg=#000000
+
+hi TabLineFill     guifg=#1B1D1E guibg=#1B1D1E
+hi TabLine         guibg=#1B1D1E guifg=#808080 gui=none
+
+if s:molokai_original == 1
+   hi Normal          guifg=#F8F8F2 guibg=#272822
+   hi Comment         guifg=#75715E
+   hi CursorLine                    guibg=#3E3D32
+   hi CursorLineNr    guifg=#FD971F               gui=none
+   hi CursorColumn                  guibg=#3E3D32
+   hi ColorColumn                   guibg=#3B3A32
+   hi LineNr          guifg=#BCBCBC guibg=#3B3A32
+   hi NonText         guifg=#75715E
+   hi SpecialKey      guifg=#75715E
+else
+   hi Normal          guifg=#F8F8F2 guibg=#1B1D1E
+   hi Comment         guifg=#7E8E91
+   hi CursorLine                    guibg=#293739
+   hi CursorLineNr    guifg=#FD971F               gui=none
+   hi CursorColumn                  guibg=#293739
+   hi ColorColumn                   guibg=#232526
+   hi LineNr          guifg=#465457 guibg=#232526
+   hi NonText         guifg=#465457
+   hi SpecialKey      guifg=#465457
+end
+
+"
+" Support for 256-color terminal
+"
+if &t_Co > 255
+   if s:molokai_original == 1
+      hi Normal                   ctermbg=234
+      hi CursorLine               ctermbg=235   cterm=none
+      hi CursorLineNr ctermfg=208               cterm=none
+   else
+      hi Normal       ctermfg=252 ctermbg=233
+      hi CursorLine               ctermbg=234   cterm=none
+      hi CursorLineNr ctermfg=208               cterm=none
+   endif
+   hi Boolean         ctermfg=135
+   hi Character       ctermfg=144
+   hi Number          ctermfg=135
+   hi String          ctermfg=144
+   hi Conditional     ctermfg=161               cterm=bold
+   hi Constant        ctermfg=135               cterm=bold
+   hi Cursor          ctermfg=16  ctermbg=253
+   hi Debug           ctermfg=225               cterm=bold
+   hi Define          ctermfg=81
+   hi Delimiter       ctermfg=241
+
+   hi DiffAdd                     ctermbg=24
+   hi DiffChange      ctermfg=181 ctermbg=239
+   hi DiffDelete      ctermfg=162 ctermbg=53
+   hi DiffText                    ctermbg=102 cterm=bold
+
+   hi Directory       ctermfg=118               cterm=bold
+   hi Error           ctermfg=219 ctermbg=89
+   hi ErrorMsg        ctermfg=199 ctermbg=16    cterm=bold
+   hi Exception       ctermfg=118               cterm=bold
+   hi Float           ctermfg=135
+   hi FoldColumn      ctermfg=67  ctermbg=16
+   hi Folded          ctermfg=67  ctermbg=16
+   hi Function        ctermfg=118
+   hi Identifier      ctermfg=208               cterm=none
+   hi Ignore          ctermfg=244 ctermbg=232
+   hi IncSearch       ctermfg=193 ctermbg=16
+
+   hi keyword         ctermfg=161               cterm=bold
+   hi Label           ctermfg=229               cterm=none
+   hi Macro           ctermfg=193
+   hi SpecialKey      ctermfg=81
+
+   hi MatchParen      ctermfg=233  ctermbg=208 cterm=bold
+   hi ModeMsg         ctermfg=229
+   hi MoreMsg         ctermfg=229
+   hi Operator        ctermfg=161
+
+   " complete menu
+   hi Pmenu           ctermfg=81  ctermbg=16
+   hi PmenuSel        ctermfg=255 ctermbg=242
+   hi PmenuSbar                   ctermbg=232
+   hi PmenuThumb      ctermfg=81
+
+   hi PreCondit       ctermfg=118               cterm=bold
+   hi PreProc         ctermfg=118
+   hi Question        ctermfg=81
+   hi Repeat          ctermfg=161               cterm=bold
+   hi Search          ctermfg=0   ctermbg=222   cterm=NONE
+
+   " marks column
+   hi SignColumn      ctermfg=118 ctermbg=235
+   hi SpecialChar     ctermfg=161               cterm=bold
+   hi SpecialComment  ctermfg=245               cterm=bold
+   hi Special         ctermfg=81
+   if has("spell")
+       hi SpellBad                ctermbg=52
+       hi SpellCap                ctermbg=17
+       hi SpellLocal              ctermbg=17
+       hi SpellRare  ctermfg=none ctermbg=none  cterm=reverse
+   endif
+   hi Statement       ctermfg=161               cterm=bold
+   hi StatusLine      ctermfg=238 ctermbg=253
+   hi StatusLineNC    ctermfg=244 ctermbg=232
+   hi StorageClass    ctermfg=208
+   hi Structure       ctermfg=81
+   hi Tag             ctermfg=161
+   hi Title           ctermfg=166
+   hi Todo            ctermfg=231 ctermbg=232   cterm=bold
+
+   hi Typedef         ctermfg=81
+   hi Type            ctermfg=81                cterm=none
+   hi Underlined      ctermfg=244               cterm=underline
+
+   hi VertSplit       ctermfg=244 ctermbg=232   cterm=bold
+   hi VisualNOS                   ctermbg=238
+   hi Visual                      ctermbg=235
+   hi WarningMsg      ctermfg=231 ctermbg=238   cterm=bold
+   hi WildMenu        ctermfg=81  ctermbg=16
+
+   hi Comment         ctermfg=59
+   hi CursorColumn                ctermbg=236
+   hi ColorColumn                 ctermbg=236
+   hi LineNr          ctermfg=250 ctermbg=236
+   hi NonText         ctermfg=59
+
+   hi SpecialKey      ctermfg=59
+
+   if exists("g:rehash256") && g:rehash256 == 1
+       hi Normal       ctermfg=252 ctermbg=234
+       hi CursorLine               ctermbg=236   cterm=none
+       hi CursorLineNr ctermfg=208               cterm=none
+
+       hi Boolean         ctermfg=141
+       hi Character       ctermfg=222
+       hi Number          ctermfg=141
+       hi String          ctermfg=222
+       hi Conditional     ctermfg=197               cterm=bold
+       hi Constant        ctermfg=141               cterm=bold
+
+       hi DiffDelete      ctermfg=125 ctermbg=233
+
+       hi Directory       ctermfg=154               cterm=bold
+       hi Error           ctermfg=222 ctermbg=233
+       hi Exception       ctermfg=154               cterm=bold
+       hi Float           ctermfg=141
+       hi Function        ctermfg=154
+       hi Identifier      ctermfg=208
+
+       hi Keyword         ctermfg=197               cterm=bold
+       hi Operator        ctermfg=197
+       hi PreCondit       ctermfg=154               cterm=bold
+       hi PreProc         ctermfg=154
+       hi Repeat          ctermfg=197               cterm=bold
+
+       hi Statement       ctermfg=197               cterm=bold
+       hi Tag             ctermfg=197
+       hi Title           ctermfg=203
+       hi Visual                      ctermbg=238
+
+       hi Comment         ctermfg=244
+       hi LineNr          ctermfg=239 ctermbg=235
+       hi NonText         ctermfg=239
+       hi SpecialKey      ctermfg=239
+   endif
+end
+
+" Must be at the end, because of ctermbg=234 bug.
+" https://groups.google.com/forum/#!msg/vim_dev/afPqwAFNdrU/nqh6tOM87QUJ
+set background=dark

File diff suppressed because it is too large
+ 1117 - 0
colors/solarized.vim


+ 8 - 0
install.sh

@@ -0,0 +1,8 @@
+yum -y install gcc gcc-c++ python-devel lua-devel
+tar xvf ./v8.1.1835
+cd ./v8.1.1835
+
+cd vim-8.1.1835/
+./configure          --enable-pythoninterp=yes                       --enable-python3interp=yes              --enable-luainterp=yes       --enable-pythoninterp=yes --with-python-config-dir=/usr/lib64/python2.7/config --prefix=/usr
+
+make && make install 

+ 63 - 0
plugin/neocomplete.vim

@@ -0,0 +1,63 @@
+"=============================================================================
+" FILE: neocomplete.vim
+" AUTHOR:  Shougo Matsushita <Shougo.Matsu@gmail.com>
+" License: MIT license  {{{
+"     Permission is hereby granted, free of charge, to any person obtaining
+"     a copy of this software and associated documentation files (the
+"     "Software"), to deal in the Software without restriction, including
+"     without limitation the rights to use, copy, modify, merge, publish,
+"     distribute, sublicense, and/or sell copies of the Software, and to
+"     permit persons to whom the Software is furnished to do so, subject to
+"     the following conditions:
+"
+"     The above copyright notice and this permission notice shall be included
+"     in all copies or substantial portions of the Software.
+"
+"     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+"     OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+"     MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+"     IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+"     CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+"     TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+"     SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+" }}}
+"=============================================================================
+
+if exists('g:loaded_neocomplete')
+  finish
+endif
+let g:loaded_neocomplete = 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+command! -nargs=0 -bar NeoCompleteEnable
+      \ call neocomplete#init#enable()
+command! -nargs=0 -bar NeoCompleteDisable
+      \ call neocomplete#init#disable()
+command! -nargs=0 -bar NeoCompleteLock
+      \ call neocomplete#commands#_lock()
+command! -nargs=0 -bar NeoCompleteUnlock
+      \ call neocomplete#commands#_unlock()
+command! -nargs=0 -bar NeoCompleteToggle
+      \ call neocomplete#commands#_toggle_lock()
+command! -nargs=1 -bar -complete=filetype NeoCompleteSetFileType
+      \ call neocomplete#commands#_set_file_type(<q-args>)
+command! -nargs=0 -bar NeoCompleteClean
+      \ call neocomplete#commands#_clean()
+
+" Global options definition. "{{{
+let g:neocomplete#enable_debug =
+      \ get(g:, 'neocomplete#enable_debug', 0)
+if get(g:, 'neocomplete#enable_at_startup', 0)
+  augroup neocomplete
+    " Enable startup.
+    autocmd CursorHold,InsertEnter
+          \ * call neocomplete#init#enable()
+  augroup END
+endif"}}}
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: foldmethod=marker

+ 24 - 0
plugin/neocomplete/buffer.vim

@@ -0,0 +1,24 @@
+"=============================================================================
+" FILE: buffer.vim
+" AUTHOR:  Shougo Matsushita <Shougo.Matsu@gmail.com>
+"=============================================================================
+
+if exists('g:loaded_neocomplete_buffer')
+  finish
+endif
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+" Add commands. "{{{
+command! -nargs=? -complete=file -bar
+      \ NeoCompleteBufferMakeCache
+      \ call neocomplete#sources#buffer#make_cache(<q-args>)
+"}}}
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+let g:loaded_neocomplete_buffer = 1
+
+" vim: foldmethod=marker

+ 24 - 0
plugin/neocomplete/dictionary.vim

@@ -0,0 +1,24 @@
+"=============================================================================
+" FILE: dictionary.vim
+" AUTHOR:  Shougo Matsushita <Shougo.Matsu@gmail.com>
+"=============================================================================
+
+if exists('g:loaded_neocomplete_dictionary')
+  finish
+endif
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+" Add commands. "{{{
+command! -nargs=? -complete=customlist,neocomplete#filetype_complete
+      \ NeoCompleteDictionaryMakeCache
+      \ call neocomplete#sources#dictionary#remake_cache(<q-args>)
+"}}}
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+let g:loaded_neocomplete_dictionary = 1
+
+" vim: foldmethod=marker

+ 24 - 0
plugin/neocomplete/member.vim

@@ -0,0 +1,24 @@
+"=============================================================================
+" FILE: member.vim
+" AUTHOR:  Shougo Matsushita <Shougo.Matsu@gmail.com>
+"=============================================================================
+
+if exists('g:loaded_neocomplete_member')
+  finish
+endif
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+" Add commands. "{{{
+command! -nargs=? -complete=file -bar
+      \ NeoCompleteMemberMakeCache
+      \ call neocomplete#sources#member#remake_cache(&l:filetype)
+"}}}
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+let g:loaded_neocomplete_member = 1
+
+" vim: foldmethod=marker

+ 24 - 0
plugin/neocomplete/tag.vim

@@ -0,0 +1,24 @@
+"=============================================================================
+" FILE: tag.vim
+" AUTHOR:  Shougo Matsushita <Shougo.Matsu@gmail.com>
+"=============================================================================
+
+if exists('g:loaded_neocomplete_tag')
+  finish
+endif
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+" Add commands. "{{{
+command! -nargs=0 -bar
+      \ NeoCompleteTagMakeCache
+      \ call neocomplete#sources#tag#make_cache(1)
+"}}}
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+let g:loaded_neocomplete_tag = 1
+
+" vim: foldmethod=marker

BIN
v8.1.1835