From a2e85e048926fa47e9f88c4d402c0aaeec141661 Mon Sep 17 00:00:00 2001 From: Anthony Perkins Date: Wed, 12 Apr 2017 11:51:18 +0100 Subject: [PATCH] Remove CtrlP and NeoComplete --- pack/acp/README.md | 2 - pack/acp/start/ctrlp.vim/.gitignore | 7 - pack/acp/start/ctrlp.vim/autoload/ctrlp.vim | 2634 ----------------- .../ctrlp.vim/autoload/ctrlp/autoignore.vim | 173 -- .../ctrlp.vim/autoload/ctrlp/bookmarkdir.vim | 147 - .../ctrlp.vim/autoload/ctrlp/buffertag.vim | 277 -- .../ctrlp.vim/autoload/ctrlp/changes.vim | 98 - .../start/ctrlp.vim/autoload/ctrlp/dir.vim | 95 - .../start/ctrlp.vim/autoload/ctrlp/line.vim | 72 - .../start/ctrlp.vim/autoload/ctrlp/mixed.vim | 88 - .../ctrlp.vim/autoload/ctrlp/mrufiles.vim | 158 - .../ctrlp.vim/autoload/ctrlp/quickfix.vim | 59 - .../ctrlp.vim/autoload/ctrlp/rtscript.vim | 59 - .../start/ctrlp.vim/autoload/ctrlp/tag.vim | 146 - .../start/ctrlp.vim/autoload/ctrlp/undo.vim | 154 - .../start/ctrlp.vim/autoload/ctrlp/utils.vim | 110 - pack/acp/start/ctrlp.vim/doc/ctrlp.cnx | 1571 ---------- pack/acp/start/ctrlp.vim/doc/ctrlp.txt | 1683 ----------- pack/acp/start/ctrlp.vim/plugin/ctrlp.vim | 70 - pack/acp/start/ctrlp.vim/readme.md | 105 - .../neocomplete.vim/.github/ISSUE_TEMPLATE.md | 31 - pack/acp/start/neocomplete.vim/.gitignore | 1 - pack/acp/start/neocomplete.vim/.travis.yml | 8 - .../acp/start/neocomplete.vim/CONTRIBUTING.md | 27 - pack/acp/start/neocomplete.vim/README.md | 197 -- .../neocomplete.vim/autoload/neocomplete.vim | 329 -- .../autoload/neocomplete/async_cache.vim | 276 -- .../autoload/neocomplete/cache.vim | 298 -- .../autoload/neocomplete/commands.vim | 100 - .../autoload/neocomplete/complete.vim | 348 --- .../autoload/neocomplete/context_filetype.vim | 67 - .../autoload/neocomplete/custom.vim | 54 - .../autoload/neocomplete/filters.vim | 48 - .../neocomplete/filters/converter_abbr.vim | 66 - .../filters/converter_add_paren.vim | 53 - .../neocomplete/filters/converter_case.vim | 80 - .../filters/converter_delimiter.vim | 114 - .../filters/converter_disable_abbr.vim | 49 - .../filters/converter_remove_last_paren.vim | 50 - .../filters/converter_remove_overlap.vim | 122 - .../neocomplete/filters/matcher_fuzzy.vim | 89 - .../neocomplete/filters/matcher_head.vim | 72 - .../neocomplete/filters/matcher_length.vim | 63 - .../neocomplete/filters/matcher_nothing.vim | 45 - .../neocomplete/filters/sorter_filename.vim | 50 - .../neocomplete/filters/sorter_length.vim | 53 - .../neocomplete/filters/sorter_rank.vim | 74 - .../neocomplete/filters/sorter_word.vim | 49 - .../autoload/neocomplete/handler.vim | 367 --- .../autoload/neocomplete/helper.vim | 357 --- .../autoload/neocomplete/init.vim | 659 ----- .../autoload/neocomplete/mappings.vim | 269 -- .../autoload/neocomplete/sources/buffer.vim | 400 --- .../neocomplete/sources/dictionary.vim | 150 - .../autoload/neocomplete/sources/file.vim | 159 - .../autoload/neocomplete/sources/member.vim | 277 -- .../autoload/neocomplete/sources/omni.vim | 294 -- .../autoload/neocomplete/sources/tag.vim | 120 - .../autoload/neocomplete/util.vim | 264 -- .../autoload/neocomplete/variables.vim | 67 - .../autoload/unite/sources/neocomplete.vim | 144 - .../start/neocomplete.vim/autoload/vital.vim | 12 - .../autoload/vital/_neocomplete.vim | 5 - .../autoload/vital/_neocomplete/Data/List.vim | 457 --- .../vital/_neocomplete/Data/String.vim | 633 ---- .../autoload/vital/_neocomplete/Prelude.vim | 430 --- .../autoload/vital/_neocomplete/Process.vim | 181 -- .../_neocomplete/System/Cache/Deprecated.vim | 101 - .../autoload/vital/neocomplete.vim | 339 --- .../autoload/vital/neocomplete.vital | 8 - .../start/neocomplete.vim/doc/neocomplete.txt | 1861 ------------ .../neocomplete.vim/plugin/neocomplete.vim | 63 - .../plugin/neocomplete/buffer.vim | 24 - .../plugin/neocomplete/dictionary.vim | 24 - .../plugin/neocomplete/member.vim | 24 - .../plugin/neocomplete/tag.vim | 24 - .../neocomplete.vim/test/neocomplete.vim | 58 - 77 files changed, 18292 deletions(-) delete mode 100644 pack/acp/start/ctrlp.vim/.gitignore delete mode 100644 pack/acp/start/ctrlp.vim/autoload/ctrlp.vim delete mode 100644 pack/acp/start/ctrlp.vim/autoload/ctrlp/autoignore.vim delete mode 100644 pack/acp/start/ctrlp.vim/autoload/ctrlp/bookmarkdir.vim delete mode 100644 pack/acp/start/ctrlp.vim/autoload/ctrlp/buffertag.vim delete mode 100644 pack/acp/start/ctrlp.vim/autoload/ctrlp/changes.vim delete mode 100644 pack/acp/start/ctrlp.vim/autoload/ctrlp/dir.vim delete mode 100644 pack/acp/start/ctrlp.vim/autoload/ctrlp/line.vim delete mode 100644 pack/acp/start/ctrlp.vim/autoload/ctrlp/mixed.vim delete mode 100644 pack/acp/start/ctrlp.vim/autoload/ctrlp/mrufiles.vim delete mode 100644 pack/acp/start/ctrlp.vim/autoload/ctrlp/quickfix.vim delete mode 100644 pack/acp/start/ctrlp.vim/autoload/ctrlp/rtscript.vim delete mode 100644 pack/acp/start/ctrlp.vim/autoload/ctrlp/tag.vim delete mode 100644 pack/acp/start/ctrlp.vim/autoload/ctrlp/undo.vim delete mode 100644 pack/acp/start/ctrlp.vim/autoload/ctrlp/utils.vim delete mode 100644 pack/acp/start/ctrlp.vim/doc/ctrlp.cnx delete mode 100644 pack/acp/start/ctrlp.vim/doc/ctrlp.txt delete mode 100644 pack/acp/start/ctrlp.vim/plugin/ctrlp.vim delete mode 100644 pack/acp/start/ctrlp.vim/readme.md delete mode 100644 pack/acp/start/neocomplete.vim/.github/ISSUE_TEMPLATE.md delete mode 100644 pack/acp/start/neocomplete.vim/.gitignore delete mode 100644 pack/acp/start/neocomplete.vim/.travis.yml delete mode 100644 pack/acp/start/neocomplete.vim/CONTRIBUTING.md delete mode 100644 pack/acp/start/neocomplete.vim/README.md delete mode 100644 pack/acp/start/neocomplete.vim/autoload/neocomplete.vim delete mode 100644 pack/acp/start/neocomplete.vim/autoload/neocomplete/async_cache.vim delete mode 100644 pack/acp/start/neocomplete.vim/autoload/neocomplete/cache.vim delete mode 100644 pack/acp/start/neocomplete.vim/autoload/neocomplete/commands.vim delete mode 100644 pack/acp/start/neocomplete.vim/autoload/neocomplete/complete.vim delete mode 100644 pack/acp/start/neocomplete.vim/autoload/neocomplete/context_filetype.vim delete mode 100644 pack/acp/start/neocomplete.vim/autoload/neocomplete/custom.vim delete mode 100644 pack/acp/start/neocomplete.vim/autoload/neocomplete/filters.vim delete mode 100644 pack/acp/start/neocomplete.vim/autoload/neocomplete/filters/converter_abbr.vim delete mode 100644 pack/acp/start/neocomplete.vim/autoload/neocomplete/filters/converter_add_paren.vim delete mode 100644 pack/acp/start/neocomplete.vim/autoload/neocomplete/filters/converter_case.vim delete mode 100644 pack/acp/start/neocomplete.vim/autoload/neocomplete/filters/converter_delimiter.vim delete mode 100644 pack/acp/start/neocomplete.vim/autoload/neocomplete/filters/converter_disable_abbr.vim delete mode 100644 pack/acp/start/neocomplete.vim/autoload/neocomplete/filters/converter_remove_last_paren.vim delete mode 100644 pack/acp/start/neocomplete.vim/autoload/neocomplete/filters/converter_remove_overlap.vim delete mode 100644 pack/acp/start/neocomplete.vim/autoload/neocomplete/filters/matcher_fuzzy.vim delete mode 100644 pack/acp/start/neocomplete.vim/autoload/neocomplete/filters/matcher_head.vim delete mode 100644 pack/acp/start/neocomplete.vim/autoload/neocomplete/filters/matcher_length.vim delete mode 100644 pack/acp/start/neocomplete.vim/autoload/neocomplete/filters/matcher_nothing.vim delete mode 100644 pack/acp/start/neocomplete.vim/autoload/neocomplete/filters/sorter_filename.vim delete mode 100644 pack/acp/start/neocomplete.vim/autoload/neocomplete/filters/sorter_length.vim delete mode 100644 pack/acp/start/neocomplete.vim/autoload/neocomplete/filters/sorter_rank.vim delete mode 100644 pack/acp/start/neocomplete.vim/autoload/neocomplete/filters/sorter_word.vim delete mode 100644 pack/acp/start/neocomplete.vim/autoload/neocomplete/handler.vim delete mode 100644 pack/acp/start/neocomplete.vim/autoload/neocomplete/helper.vim delete mode 100644 pack/acp/start/neocomplete.vim/autoload/neocomplete/init.vim delete mode 100644 pack/acp/start/neocomplete.vim/autoload/neocomplete/mappings.vim delete mode 100644 pack/acp/start/neocomplete.vim/autoload/neocomplete/sources/buffer.vim delete mode 100644 pack/acp/start/neocomplete.vim/autoload/neocomplete/sources/dictionary.vim delete mode 100644 pack/acp/start/neocomplete.vim/autoload/neocomplete/sources/file.vim delete mode 100644 pack/acp/start/neocomplete.vim/autoload/neocomplete/sources/member.vim delete mode 100644 pack/acp/start/neocomplete.vim/autoload/neocomplete/sources/omni.vim delete mode 100644 pack/acp/start/neocomplete.vim/autoload/neocomplete/sources/tag.vim delete mode 100644 pack/acp/start/neocomplete.vim/autoload/neocomplete/util.vim delete mode 100644 pack/acp/start/neocomplete.vim/autoload/neocomplete/variables.vim delete mode 100644 pack/acp/start/neocomplete.vim/autoload/unite/sources/neocomplete.vim delete mode 100644 pack/acp/start/neocomplete.vim/autoload/vital.vim delete mode 100644 pack/acp/start/neocomplete.vim/autoload/vital/_neocomplete.vim delete mode 100644 pack/acp/start/neocomplete.vim/autoload/vital/_neocomplete/Data/List.vim delete mode 100644 pack/acp/start/neocomplete.vim/autoload/vital/_neocomplete/Data/String.vim delete mode 100644 pack/acp/start/neocomplete.vim/autoload/vital/_neocomplete/Prelude.vim delete mode 100644 pack/acp/start/neocomplete.vim/autoload/vital/_neocomplete/Process.vim delete mode 100644 pack/acp/start/neocomplete.vim/autoload/vital/_neocomplete/System/Cache/Deprecated.vim delete mode 100644 pack/acp/start/neocomplete.vim/autoload/vital/neocomplete.vim delete mode 100644 pack/acp/start/neocomplete.vim/autoload/vital/neocomplete.vital delete mode 100644 pack/acp/start/neocomplete.vim/doc/neocomplete.txt delete mode 100644 pack/acp/start/neocomplete.vim/plugin/neocomplete.vim delete mode 100644 pack/acp/start/neocomplete.vim/plugin/neocomplete/buffer.vim delete mode 100644 pack/acp/start/neocomplete.vim/plugin/neocomplete/dictionary.vim delete mode 100644 pack/acp/start/neocomplete.vim/plugin/neocomplete/member.vim delete mode 100644 pack/acp/start/neocomplete.vim/plugin/neocomplete/tag.vim delete mode 100644 pack/acp/start/neocomplete.vim/test/neocomplete.vim diff --git a/pack/acp/README.md b/pack/acp/README.md index fb24646..c1ada00 100644 --- a/pack/acp/README.md +++ b/pack/acp/README.md @@ -4,10 +4,8 @@ Git submodules are slow, so handle this manually. * [opt/vim-pathogen](https://github.com/tpope/vim-pathogen) * [start/TextFormat](https://github.com/vim-scripts/TextFormat) -* [start/ctrlp.vim](https://github.com/ctrlpvim/ctrlp.vim) * [start/jellybeans.vim](https://github.com/nanotech/jellybeans.vim) * [start/mom.vim](https://github.com/vim-scripts/mom.vim) -* [start/neocomplete.vim](https://github.com/Shougo/neocomplete.vim) * [start/rust.vim](https://github.com/rust-lang/rust.vim) * [start/vim-ps1](https://github.com/PProvost/vim-ps1) * [start/vim-surround](https://github.com/tpope/vim-surround) diff --git a/pack/acp/start/ctrlp.vim/.gitignore b/pack/acp/start/ctrlp.vim/.gitignore deleted file mode 100644 index 3dc7cfe..0000000 --- a/pack/acp/start/ctrlp.vim/.gitignore +++ /dev/null @@ -1,7 +0,0 @@ -*.markdown -*.zip -note.txt -tags -tags-cn -.hg* -tmp/* diff --git a/pack/acp/start/ctrlp.vim/autoload/ctrlp.vim b/pack/acp/start/ctrlp.vim/autoload/ctrlp.vim deleted file mode 100644 index 7b2d660..0000000 --- a/pack/acp/start/ctrlp.vim/autoload/ctrlp.vim +++ /dev/null @@ -1,2634 +0,0 @@ -" ============================================================================= -" File: autoload/ctrlp.vim -" Description: Fuzzy file, buffer, mru, tag, etc finder. -" Author: CtrlP Dev Team -" Original: Kien Nguyen -" Version: 1.80 -" ============================================================================= - -" ** Static variables {{{1 -" s:ignore() {{{2 -fu! s:ignore() - let igdirs = [ - \ '\.git', - \ '\.hg', - \ '\.svn', - \ '_darcs', - \ '\.bzr', - \ '\.cdv', - \ '\~\.dep', - \ '\~\.dot', - \ '\~\.nib', - \ '\~\.plst', - \ '\.pc', - \ '_MTN', - \ 'blib', - \ 'CVS', - \ 'RCS', - \ 'SCCS', - \ '_sgbak', - \ 'autom4te\.cache', - \ 'cover_db', - \ '_build', - \ ] - let igfiles = [ - \ '\~$', - \ '#.+#$', - \ '[._].*\.swp$', - \ 'core\.\d+$', - \ '\.exe$', - \ '\.so$', - \ '\.bak$', - \ '\.png$', - \ '\.jpg$', - \ '\.gif$', - \ '\.zip$', - \ '\.rar$', - \ '\.tar\.gz$', - \ ] - retu { - \ 'dir': '\v[\/]('.join(igdirs, '|').')$', - \ 'file': '\v'.join(igfiles, '|'), - \ } -endf -" Script local vars {{{2 -let [s:pref, s:bpref, s:opts, s:new_opts, s:lc_opts] = - \ ['g:ctrlp_', 'b:ctrlp_', { - \ 'abbrev': ['s:abbrev', {}], - \ 'arg_map': ['s:argmap', 0], - \ 'buffer_func': ['s:buffunc', {}], - \ 'by_filename': ['s:byfname', 0], - \ 'custom_ignore': ['s:usrign', s:ignore()], - \ 'default_input': ['s:deftxt', 0], - \ 'dont_split': ['s:nosplit', 'netrw'], - \ 'dotfiles': ['s:showhidden', 0], - \ 'extensions': ['s:extensions', []], - \ 'follow_symlinks': ['s:folsym', 0], - \ 'highlight_match': ['s:mathi', [1, 'CtrlPMatch']], - \ 'jump_to_buffer': ['s:jmptobuf', 'Et'], - \ 'key_loop': ['s:keyloop', 0], - \ 'lazy_update': ['s:lazy', 0], - \ 'match_func': ['s:matcher', {}], - \ 'match_window': ['s:mw', ''], - \ 'match_window_bottom': ['s:mwbottom', 1], - \ 'match_window_reversed': ['s:mwreverse', 1], - \ 'max_depth': ['s:maxdepth', 40], - \ 'max_files': ['s:maxfiles', 10000], - \ 'max_height': ['s:mxheight', 10], - \ 'max_history': ['s:maxhst', exists('+hi') ? &hi : 20], - \ 'mruf_default_order': ['s:mrudef', 0], - \ 'open_func': ['s:openfunc', {}], - \ 'open_multi': ['s:opmul', '1v'], - \ 'open_new_file': ['s:newfop', 'v'], - \ 'prompt_mappings': ['s:urprtmaps', 0], - \ 'regexp_search': ['s:regexp', 0], - \ 'root_markers': ['s:rmarkers', []], - \ 'split_window': ['s:splitwin', 0], - \ 'status_func': ['s:status', {}], - \ 'tabpage_position': ['s:tabpage', 'ac'], - \ 'use_caching': ['s:caching', 1], - \ 'user_command': ['s:usrcmd', ''], - \ 'validate': ['s:validate', ''], - \ 'working_path_mode': ['s:pathmode', 'ra'], - \ 'line_prefix': ['s:lineprefix', '> '], - \ 'open_single_match': ['s:opensingle', []], - \ 'brief_prompt': ['s:brfprt', 0], - \ 'match_current_file': ['s:matchcrfile', 0], - \ 'match_natural_name': ['s:matchnatural', 0], - \ 'compare_lim': ['s:compare_lim', 3000], - \ 'bufname_mod': ['s:bufname_mod', ':t'], - \ 'bufpath_mod': ['s:bufpath_mod', ':~:.:h'], - \ 'formatline_func': ['s:flfunc', 's:formatline(v:val)'], - \ 'user_command_async': ['s:usrcmdasync', 0], - \ }, { - \ 'open_multiple_files': 's:opmul', - \ 'regexp': 's:regexp', - \ 'reuse_window': 's:nosplit', - \ 'show_hidden': 's:showhidden', - \ 'switch_buffer': 's:jmptobuf', - \ }, { - \ 'root_markers': 's:rmarkers', - \ 'user_command': 's:usrcmd', - \ 'working_path_mode': 's:pathmode', - \ }] - -" Global options -let s:glbs = { 'magic': 1, 'to': 1, 'tm': 0, 'sb': 1, 'hls': 0, 'im': 0, - \ 'report': 9999, 'sc': 0, 'ss': 0, 'siso': 0, 'mfd': 200, 'ttimeout': 0, - \ 'gcr': 'a:blinkon0', 'ic': 1, 'lmap': '', 'mousef': 0, 'imd': 1 } - -" Keymaps -let [s:lcmap, s:prtmaps] = ['nn ', { - \ 'PrtBS()': ['', ''], - \ 'PrtDelete()': [''], - \ 'PrtDeleteWord()': [''], - \ 'PrtClear()': [''], - \ 'PrtSelectMove("j")': ['', ''], - \ 'PrtSelectMove("k")': ['', ''], - \ 'PrtSelectMove("t")': ['', ''], - \ 'PrtSelectMove("b")': ['', ''], - \ 'PrtSelectMove("u")': ['', ''], - \ 'PrtSelectMove("d")': ['', ''], - \ 'PrtHistory(-1)': [''], - \ 'PrtHistory(1)': [''], - \ 'AcceptSelection("e")': ['', '<2-LeftMouse>'], - \ 'AcceptSelection("h")': ['', '', ''], - \ 'AcceptSelection("t")': [''], - \ 'AcceptSelection("v")': ['', ''], - \ 'ToggleFocus()': [''], - \ 'ToggleRegex()': [''], - \ 'ToggleByFname()': [''], - \ 'ToggleType(1)': ['', ''], - \ 'ToggleType(-1)': ['', ''], - \ 'PrtExpandDir()': [''], - \ 'PrtInsert("c")': ['', ''], - \ 'PrtInsert()': [''], - \ 'PrtCurStart()': [''], - \ 'PrtCurEnd()': [''], - \ 'PrtCurLeft()': ['', '', ''], - \ 'PrtCurRight()': ['', ''], - \ 'PrtClearCache()': [''], - \ 'PrtDeleteEnt()': [''], - \ 'CreateNewFile()': [''], - \ 'MarkToOpen()': [''], - \ 'OpenMulti()': [''], - \ 'YankLine()': [], - \ 'PrtExit()': ['', '', ''], - \ }] - -if !has('gui_running') - cal add(s:prtmaps['PrtBS()'], remove(s:prtmaps['PrtCurLeft()'], 0)) -en - -let s:ficounts = {} - -let s:ccex = s:pref.'clear_cache_on_exit' - -" Regexp -let s:fpats = { - \ '^\(\\|\)\|\(\\|\)$': '\\|', - \ '^\\\(zs\|ze\|<\|>\)': '^\\\(zs\|ze\|<\|>\)', - \ '^\S\*$': '\*', - \ '^\S\\?$': '\\?', - \ } - -let s:has_conceal = has('conceal') -let s:bufnr_width = 3 - -" Keypad -let s:kprange = { - \ 'Plus': '+', - \ 'Minus': '-', - \ 'Divide': '/', - \ 'Multiply': '*', - \ 'Point': '.', - \ } - -" Highlight groups -let s:hlgrps = { - \ 'NoEntries': 'Error', - \ 'Mode1': 'Character', - \ 'Mode2': 'LineNr', - \ 'Stats': 'Function', - \ 'Match': 'Identifier', - \ 'PrtBase': 'Comment', - \ 'PrtText': 'Normal', - \ 'PrtCursor': 'Constant', - \ 'BufferNr': 'Constant', - \ 'BufferInd': 'Normal', - \ 'BufferHid': 'Comment', - \ 'BufferHidMod': 'String', - \ 'BufferVis': 'Normal', - \ 'BufferVisMod': 'Identifier', - \ 'BufferCur': 'Question', - \ 'BufferCurMod': 'WarningMsg', - \ 'BufferPath': 'Comment', - \ } - -" lname, sname of the basic(non-extension) modes -let s:types = ['fil', 'buf', 'mru'] -if !exists('g:ctrlp_types') - let g:ctrlp_types = s:types -el - call filter(g:ctrlp_types, "index(['fil', 'buf', 'mru'], v:val)!=-1") -en -let g:ctrlp_builtins = len(g:ctrlp_types)-1 - -let s:coretype_names = { - \ 'fil' : 'files', - \ 'buf' : 'buffers', - \ 'mru' : 'mru files', - \ } - -let s:coretypes = map(copy(g:ctrlp_types), '[s:coretype_names[v:val], v:val]') - -" Get the options {{{2 -fu! s:opts(...) - unl! s:usrign s:usrcmd s:urprtmaps - for each in ['byfname', 'regexp', 'extensions'] | if exists('s:'.each) - let {each} = s:{each} - en | endfo - for [ke, va] in items(s:opts) - let {va[0]} = exists(s:pref.ke) ? {s:pref.ke} : va[1] - endfo - unl va - for [ke, va] in items(s:new_opts) - let {va} = {exists(s:pref.ke) ? s:pref.ke : va} - endfo - unl va - for [ke, va] in items(s:lc_opts) - if exists(s:bpref.ke) - unl {va} - let {va} = {s:bpref.ke} - en - endfo - " Match window options - cal s:match_window_opts() - " One-time values - if a:0 && a:1 != {} - unl va - for [ke, va] in items(a:1) - let opke = substitute(ke, '\(\w:\)\?ctrlp_', '', '') - if has_key(s:lc_opts, opke) - let sva = s:lc_opts[opke] - unl {sva} - let {sva} = va - en - endfo - en - for each in ['byfname', 'regexp'] | if exists(each) - let s:{each} = {each} - en | endfo - if !exists('g:ctrlp_tilde_homedir') | let g:ctrlp_tilde_homedir = 0 | en - if !exists('g:ctrlp_newcache') | let g:ctrlp_newcache = 0 | en - let s:maxdepth = min([s:maxdepth, 100]) - let s:glob = s:showhidden ? '.*\|*' : '*' - let s:igntype = empty(s:usrign) ? -1 : type(s:usrign) - let s:lash = ctrlp#utils#lash() - if s:keyloop - let [s:lazy, s:glbs['imd']] = [0, 0] - en - if s:lazy - cal extend(s:glbs, { 'ut': ( s:lazy > 1 ? s:lazy : 250 ) }) - en - " Extensions - if !( exists('extensions') && extensions == s:extensions ) - for each in s:extensions - exe 'ru autoload/ctrlp/'.each.'.vim' - endfo - en - " Keymaps - if type(s:urprtmaps) == 4 - cal extend(s:prtmaps, s:urprtmaps) - en -endf - -fu! s:match_window_opts() - let s:mw_pos = - \ s:mw =~ 'top\|bottom' ? matchstr(s:mw, 'top\|bottom') : - \ exists('g:ctrlp_match_window_bottom') ? ( s:mwbottom ? 'bottom' : 'top' ) - \ : 'bottom' - let s:mw_order = - \ s:mw =~ 'order:[^,]\+' ? matchstr(s:mw, 'order:\zs[^,]\+') : - \ exists('g:ctrlp_match_window_reversed') ? ( s:mwreverse ? 'btt' : 'ttb' ) - \ : 'btt' - let s:mw_max = - \ s:mw =~ 'max:[^,]\+' ? str2nr(matchstr(s:mw, 'max:\zs\d\+')) : - \ exists('g:ctrlp_max_height') ? s:mxheight - \ : 10 - let s:mw_min = - \ s:mw =~ 'min:[^,]\+' ? str2nr(matchstr(s:mw, 'min:\zs\d\+')) : 1 - let [s:mw_max, s:mw_min] = [max([s:mw_max, 1]), max([s:mw_min, 1])] - let s:mw_min = min([s:mw_min, s:mw_max]) - let s:mw_res = - \ s:mw =~ 'results:[^,]\+' ? str2nr(matchstr(s:mw, 'results:\zs\d\+')) - \ : min([s:mw_max, &lines]) -endf -"}}}1 -" * Open & Close {{{1 -fu! s:Open() - cal s:log(1) - cal s:getenv() - cal s:execextvar('enter') - sil! exe 'keepa' ( s:mw_pos == 'top' ? 'to' : 'bo' ) '1new ControlP' - cal s:buffunc(1) - let [s:bufnr, s:winw] = [bufnr('%'), winwidth(0)] - let [s:focus, s:prompt] = [1, ['', '', '']] - abc - if !exists('s:hstry') - let hst = filereadable(s:gethistloc()[1]) ? s:gethistdata() : [''] - let s:hstry = empty(hst) || !s:maxhst ? [''] : hst - en - for [ke, va] in items(s:glbs) | if exists('+'.ke) - sil! exe 'let s:glb_'.ke.' = &'.ke.' | let &'.ke.' = '.string(va) - en | endfo - if s:opmul != '0' && has('signs') - sign define ctrlpmark text=+> texthl=CtrlPMark - hi def link CtrlPMark Search - en - cal s:setupblank() -endf - -fu! s:Close() - cal s:buffunc(0) - if winnr('$') == 1 - bw! - el - try | bun! - cat | clo! | endt - cal s:unmarksigns() - en - for key in keys(s:glbs) | if exists('+'.key) - sil! exe 'let &'.key.' = s:glb_'.key - en | endfo - if exists('s:glb_acd') | let &acd = s:glb_acd | en - let g:ctrlp_lines = [] - if s:winres[1] >= &lines && s:winres[2] == winnr('$') - exe s:winres[0].s:winres[0] - en - unl! s:focus s:hisidx s:hstgot s:marked s:statypes s:init s:savestr - \ s:mrbs s:did_exp - cal ctrlp#recordhist() - cal s:execextvar('exit') - cal s:log(0) - let v:errmsg = s:ermsg - ec -endf -" * Clear caches {{{1 -fu! ctrlp#clr(...) - let [s:matches, g:ctrlp_new{ a:0 ? a:1 : 'cache' }] = [1, 1] -endf - -fu! ctrlp#clra() - let cadir = ctrlp#utils#cachedir() - if isdirectory(cadir) - let cafiles = split(s:glbpath(s:fnesc(cadir, 'g', ','), '**', 1), "\n") - let eval = '!isdirectory(v:val) && v:val !~ ''\v[\/]cache[.a-z]+$|\.log$''' - sil! cal map(s:ifilter(cafiles, eval), 'delete(v:val)') - en - cal ctrlp#clr() -endf - -fu! s:Reset(args) - let opts = has_key(a:args, 'opts') ? [a:args['opts']] : [] - cal call('s:opts', opts) - cal s:autocmds() - cal ctrlp#utils#opts() - cal s:execextvar('opts') -endf -" * Files {{{1 -fu! ctrlp#files() - let cafile = ctrlp#utils#cachefile() - if g:ctrlp_newcache || !filereadable(cafile) || s:nocache(cafile) - let [lscmd, s:initcwd, g:ctrlp_allfiles] = [s:lsCmd(), s:dyncwd, []] - " Get the list of files - if empty(lscmd) - if !ctrlp#igncwd(s:dyncwd) - cal s:InitCustomFuncs() - cal s:GlobPath(s:fnesc(s:dyncwd, 'g', ','), 0) - cal s:CloseCustomFuncs() - en - el - sil! cal ctrlp#progress('Indexing...') - try | cal s:UserCmd(lscmd) - cat | retu [] | endt - en - " Remove base directory - cal ctrlp#rmbasedir(g:ctrlp_allfiles) - if len(g:ctrlp_allfiles) <= s:compare_lim - cal sort(g:ctrlp_allfiles, 'ctrlp#complen') - en - cal s:writecache(cafile) - let catime = getftime(cafile) - el - let catime = getftime(cafile) - if !( exists('s:initcwd') && s:initcwd == s:dyncwd ) - \ || get(s:ficounts, s:dyncwd, [0, catime])[1] != catime - let s:initcwd = s:dyncwd - let g:ctrlp_allfiles = ctrlp#utils#readfile(cafile) - en - en - cal extend(s:ficounts, { s:dyncwd : [len(g:ctrlp_allfiles), catime] }) - retu g:ctrlp_allfiles -endf - -fu! s:InitCustomFuncs() - if s:igntype == 4 && has_key(s:usrign, 'func-init') && s:usrign['func-init'] != '' - exe call(s:usrign['func-init'], []) - en -endf - -fu! s:CloseCustomFuncs() - if s:igntype == 4 && has_key(s:usrign, 'func-close') && s:usrign['func-close'] != '' - exe call(s:usrign['func-close'], []) - en -endf - -fu! s:GlobPath(dirs, depth) - let entries = split(globpath(a:dirs, s:glob), "\n") - let [dnf, depth] = [ctrlp#dirnfile(entries), a:depth + 1] - cal extend(g:ctrlp_allfiles, dnf[1]) - if !empty(dnf[0]) && !s:maxf(len(g:ctrlp_allfiles)) && depth <= s:maxdepth - sil! cal ctrlp#progress(len(g:ctrlp_allfiles), 1) - cal s:GlobPath(join(map(dnf[0], 's:fnesc(v:val, "g", ",")'), ','), depth) - en -endf - -fu! ctrlp#addfile(ch, file) - call add(g:ctrlp_allfiles, a:file) - cal s:BuildPrompt(1) -endf - -fu! s:UserCmd(lscmd) - let [path, lscmd] = [s:dyncwd, a:lscmd] - let do_ign = - \ type(s:usrcmd) == 4 && has_key(s:usrcmd, 'ignore') && s:usrcmd['ignore'] - if do_ign && ctrlp#igncwd(s:cwd) | retu | en - if exists('+ssl') && &ssl && &shell !~ 'sh' - let [ssl, &ssl, path] = [&ssl, 0, tr(path, '/', '\')] - en - if (has('win32') || has('win64')) && match(&shellcmdflag, "/") != -1 - let lscmd = substitute(lscmd, '\v(^|\&\&\s*)\zscd (/d)@!', 'cd /d ', '') - en - let path = exists('*shellescape') ? shellescape(path) : path - if (has('win32') || has('win64')) && match(&shell, 'sh') != -1 - let path = tr(path, '\', '/') - en - if s:usrcmdasync && v:version >= 800 && exists('*job_start') - if exists('s:job') - call job_stop(s:job) - en - let g:ctrlp_allfiles = [] - let s:job = job_start([&shell, &shellcmdflag, printf(lscmd, path)], {'callback': 'ctrlp#addfile'}) - elsei has('patch-7.4-597') && !(has('win32') || has('win64')) - let g:ctrlp_allfiles = systemlist(printf(lscmd, path)) - el - let g:ctrlp_allfiles = split(system(printf(lscmd, path)), "\n") - en - if exists('+ssl') && exists('ssl') - let &ssl = ssl - cal map(g:ctrlp_allfiles, 'tr(v:val, "\\", "/")') - en - if exists('s:vcscmd') && s:vcscmd - cal map(g:ctrlp_allfiles, 'tr(v:val, "/", "\\")') - en - if do_ign - if !empty(s:usrign) - let g:ctrlp_allfiles = ctrlp#dirnfile(g:ctrlp_allfiles)[1] - en - if &wig != '' - cal filter(g:ctrlp_allfiles, 'glob(v:val) != ""') - en - en -endf - -fu! s:lsCmd() - let cmd = s:usrcmd - if type(cmd) == 1 - retu cmd - elsei type(cmd) == 3 && len(cmd) >= 2 && cmd[:1] != ['', ''] - if s:findroot(s:dyncwd, cmd[0], 0, 1) == [] - retu len(cmd) == 3 ? cmd[2] : '' - en - let s:vcscmd = s:lash == '\' - retu cmd[1] - elsei type(cmd) == 4 && ( has_key(cmd, 'types') || has_key(cmd, 'fallback') ) - let fndroot = [] - if has_key(cmd, 'types') && cmd['types'] != {} - let [markrs, cmdtypes] = [[], values(cmd['types'])] - for pair in cmdtypes - cal add(markrs, pair[0]) - endfo - let fndroot = s:findroot(s:dyncwd, markrs, 0, 1) - en - if fndroot == [] - retu has_key(cmd, 'fallback') ? cmd['fallback'] : '' - en - for pair in cmdtypes - if pair[0] == fndroot[0] | brea | en - endfo - let s:vcscmd = s:lash == '\' - retu pair[1] - en -endf -" - Buffers {{{1 -fu! s:bufparts(bufnr) - let idc = (a:bufnr == bufnr('#') ? '#' : '') " alternative - let idc .= (getbufvar(a:bufnr, '&mod') ? '+' : '') " modified - let idc .= (getbufvar(a:bufnr, '&ma') ? '' : '-') " nomodifiable - let idc .= (getbufvar(a:bufnr, '&ro') ? '=' : '') " readonly - - " flags for highlighting - let hiflags = (bufwinnr(a:bufnr) != -1 ? '*' : '') " visible - let hiflags .= (getbufvar(a:bufnr, '&mod') ? '+' : '') " modified - let hiflags .= (a:bufnr == s:crbufnr ? '!' : '') " current - - let bname = bufname(a:bufnr) - let bname = (bname == '' ? '[No Name]' : fnamemodify(bname, s:bufname_mod)) - - let bpath = empty(s:bufpath_mod) ? '' : fnamemodify(bufname(a:bufnr), s:bufpath_mod).s:lash() - - retu [idc, hiflags, bname, bpath] -endf -fu! ctrlp#buffers(...) - let ids = sort(filter(range(1, bufnr('$')), '(empty(getbufvar(v:val, "&bt"))' - \ .' || s:isneovimterminal(v:val)) && getbufvar(v:val, "&bl")'), 's:compmreb') - if a:0 && a:1 == 'id' - retu ids - el - let bufs = [[], []] - for id in ids - let bname = bufname(id) - let ebname = bname == '' - let fname = fnamemodify(ebname ? '['.id.'*No Name]' : bname, ':.') - cal add(bufs[ebname], fname) - endfo - retu bufs[0] + bufs[1] - en -endf -" * MatchedItems() {{{1 -fu! s:MatchIt(items, pat, limit, exc) - let [lines, id] = [[], 0] - let pat = - \ s:byfname() ? map(split(a:pat, '^[^;]\+\\\@= 0 - cal add(lines, item) - en - cat | brea | endt - if a:limit > 0 && len(lines) >= a:limit | brea | en - endfo - let s:mdata = [s:dyncwd, s:itemtype, s:regexp, s:sublist(a:items, id, -1)] - retu lines -endf - -fu! s:MatchedItems(items, pat, limit) - let exc = exists('s:crfilerel') ? s:crfilerel : '' - let items = s:narrowable() ? s:matched + s:mdata[3] : a:items - if s:matcher != {} - let argms = - \ has_key(s:matcher, 'arg_type') && s:matcher['arg_type'] == 'dict' ? [{ - \ 'items': items, - \ 'str': a:pat, - \ 'limit': a:limit, - \ 'mmode': s:mmode(), - \ 'ispath': s:ispath, - \ 'crfile': exc, - \ 'regex': s:regexp, - \ }] : [items, a:pat, a:limit, s:mmode(), s:ispath, exc, s:regexp] - let lines = call(s:matcher['match'], argms, s:matcher) - el - let lines = s:MatchIt(items, a:pat, a:limit, exc) - en - let s:matches = len(lines) - unl! s:did_exp - retu lines -endf - -fu! s:SplitPattern(str) - let str = a:str - let s:savestr = str - if s:regexp - let pat = s:regexfilter(str) - el - let lst = split(str, '\zs') - if exists('+ssl') && !&ssl - cal map(lst, 'escape(v:val, ''\'')') - en - for each in ['^', '$', '.'] - cal map(lst, 'escape(v:val, each)') - endfo - en - if exists('lst') - let pat = '' - if !empty(lst) - if s:byfname() && index(lst, ';') > 0 - let fbar = index(lst, ';') - let lst_1 = s:sublist(lst, 0, fbar - 1) - let lst_2 = len(lst) - 1 > fbar ? s:sublist(lst, fbar + 1, -1) : [''] - let pat = s:buildpat(lst_1).';'.s:buildpat(lst_2) - el - let pat = s:buildpat(lst) - en - en - en - retu escape(pat, '~') -endf -" * BuildPrompt() {{{1 -fu! s:Render(lines, pat) - let [&ma, lines, s:res_count] = [1, a:lines, len(a:lines)] - let height = min([max([s:mw_min, s:res_count]), s:winmaxh]) - let pat = s:byfname() ? split(a:pat, '^[^;]\+\\\@' ).( s:byfname() ? 'd' : '>' ).'> ' - let str = escape(s:getinput(), '\') - let lazy = str == '' || exists('s:force') || !has('autocmd') ? 0 : s:lazy - if a:upd && !lazy && ( s:matches || s:regexp || exists('s:did_exp') - \ || str =~ '\(\\\(<\|>\)\|[*|]\)\|\(\\\:\([^:]\|\\:\)*$\)' ) - sil! cal s:Update(str) - en - sil! cal ctrlp#statusline() - " Toggling - let [hiactive, hicursor, base] = s:focus - \ ? ['CtrlPPrtText', 'CtrlPPrtCursor', base] - \ : ['CtrlPPrtBase', 'CtrlPPrtBase', tr(base, '>', '-')] - let hibase = 'CtrlPPrtBase' - " Build it - redr - let prt = copy(s:prompt) - cal map(prt, 'escape(v:val, ''"\'')') - exe 'echoh' hibase '| echon "'.base.'" - \ | echoh' hiactive '| echon "'.prt[0].'" - \ | echoh' hicursor '| echon "'.prt[1].'" - \ | echoh' hiactive '| echon "'.prt[2].'" | echoh None' - " Append the cursor at the end - if empty(prt[1]) && s:focus - exe 'echoh' hibase '| echon "_" | echoh None' - en -endf -" - SetDefTxt() {{{1 -fu! s:SetDefTxt() - if s:deftxt == '0' || ( s:deftxt == 1 && !s:ispath ) | retu | en - let txt = s:deftxt - if !type(txt) - let path = s:crfpath.s:lash(s:crfpath) - let txt = txt && !stridx(path, s:dyncwd) ? ctrlp#rmbasedir([path])[0] : '' - en - let s:prompt[0] = txt -endf -" ** Prt Actions {{{1 -" Editing {{{2 -fu! s:PrtClear() - if !s:focus | retu | en - unl! s:hstgot - let [s:prompt, s:matches] = [['', '', ''], 1] - cal s:BuildPrompt(1) -endf - -fu! s:PrtAdd(char) - unl! s:hstgot - let s:act_add = 1 - let s:prompt[0] .= a:char - cal s:BuildPrompt(1) - unl s:act_add -endf - -fu! s:PrtBS() - if !s:focus | retu | en - if empty(s:prompt[0]) && s:brfprt != 0 - cal s:PrtExit() - retu - en - unl! s:hstgot - let [s:prompt[0], s:matches] = [substitute(s:prompt[0], '.$', '', ''), 1] - cal s:BuildPrompt(1) -endf - -fu! s:PrtDelete() - if !s:focus | retu | en - unl! s:hstgot - let [prt, s:matches] = [s:prompt, 1] - let prt[1] = matchstr(prt[2], '^.') - let prt[2] = substitute(prt[2], '^.', '', '') - cal s:BuildPrompt(1) -endf - -fu! s:PrtDeleteWord() - if !s:focus | retu | en - unl! s:hstgot - let [str, s:matches] = [s:prompt[0], 1] - let str = str =~ '\W\w\+$' ? matchstr(str, '^.\+\W\ze\w\+$') - \ : str =~ '\w\W\+$' ? matchstr(str, '^.\+\w\ze\W\+$') - \ : str =~ '\s\+$' ? matchstr(str, '^.*\S\ze\s\+$') - \ : str =~ '\v^(\S+|\s+)$' ? '' : str - let s:prompt[0] = str - cal s:BuildPrompt(1) -endf - -fu! s:PrtInsert(...) - if !s:focus | retu | en - let type = !a:0 ? '' : a:1 - if !a:0 - let type = s:insertstr() - if type == 'cancel' | retu | en - en - if type ==# 'r' - let regcont = s:getregs() - if regcont < 0 | retu | en - en - unl! s:hstgot - let s:act_add = 1 - let s:prompt[0] .= type ==# 'w' ? s:crword - \ : type ==# 'f' ? s:crgfile - \ : type ==# 's' ? s:regisfilter('/') - \ : type ==# 'v' ? s:crvisual - \ : type ==# 'c' ? s:regisfilter('+') - \ : type ==# 'r' ? regcont : '' - cal s:BuildPrompt(1) - unl s:act_add -endf - -fu! s:PrtExpandDir() - if !s:focus | retu | en - let str = s:getinput('c') - if str =~ '\v^\@(cd|lc[hd]?|chd)\s.+' && s:spi - let hasat = split(str, '\v^\@(cd|lc[hd]?|chd)\s*\zs') - let str = get(hasat, 1, '') - if str =~# '\v^[~$]\i{-}[\/]?|^#(\):(p|h|8|\~|\.|g?s+)' - let spc = str =~# '^%' ? s:crfile - \ : str =~# '^' ? s:crgfile - \ : str =~# '^' ? s:crword - \ : str =~# '^' ? s:crnbword : '' - let pat = '(:(p|h|8|\~|\.|g?s(.)[^\3]*\3[^\3]*\3))+' - let mdr = matchstr(str, '\v^[^:]+\zs'.pat) - let nmd = matchstr(str, '\v^[^:]+'.pat.'\zs.{-}$') - let str = fnamemodify(s:fnesc(spc, 'g'), mdr).nmd - en - en - if str == '' | retu | en - unl! s:hstgot - let s:act_add = 1 - let [base, seed] = s:headntail(str) - if str =~# '^[\/]' - let base = expand('/').base - en - let dirs = s:dircompl(base, seed) - if len(dirs) == 1 - let str = dirs[0] - elsei len(dirs) > 1 - let str .= s:findcommon(dirs, str) - en - let s:prompt[0] = exists('hasat') ? hasat[0].str : str - cal s:BuildPrompt(1) - unl s:act_add -endf -" Movement {{{2 -fu! s:PrtCurLeft() - if !s:focus | retu | en - let prt = s:prompt - if !empty(prt[0]) - let s:prompt = [substitute(prt[0], '.$', '', ''), matchstr(prt[0], '.$'), - \ prt[1] . prt[2]] - en - cal s:BuildPrompt(0) -endf - -fu! s:PrtCurRight() - if !s:focus | retu | en - let prt = s:prompt - let s:prompt = [prt[0] . prt[1], matchstr(prt[2], '^.'), - \ substitute(prt[2], '^.', '', '')] - cal s:BuildPrompt(0) -endf - -fu! s:PrtCurStart() - if !s:focus | retu | en - let str = join(s:prompt, '') - let s:prompt = ['', matchstr(str, '^.'), substitute(str, '^.', '', '')] - cal s:BuildPrompt(0) -endf - -fu! s:PrtCurEnd() - if !s:focus | retu | en - let s:prompt = [join(s:prompt, ''), '', ''] - cal s:BuildPrompt(0) -endf - -fu! s:PrtSelectMove(dir) - let wht = winheight(0) - let dirs = {'t': 'gg','b': 'G','j': 'j','k': 'k','u': wht.'k','d': wht.'j'} - exe 'keepj norm!' dirs[a:dir] - let pos = exists('*getcurpos') ? getcurpos() : getpos('.') - cal s:BuildPrompt(0) - cal setpos('.', pos) -endf - -fu! s:PrtSelectJump(char) - let lines = copy(s:lines) - if s:byfname() - cal map(lines, 'split(v:val, ''[\/]\ze[^\/]\+$'')[-1]') - en - " Cycle through matches, use s:jmpchr to store last jump - let chr = escape(matchstr(a:char, '^.'), '.~') - let smartcs = &scs && chr =~ '\u' ? '\C' : '' - if match(lines, smartcs.'^'.chr) >= 0 - " If not exists or does but not for the same char - let pos = match(lines, smartcs.'^'.chr) - if !exists('s:jmpchr') || ( exists('s:jmpchr') && s:jmpchr[0] != chr ) - let [jmpln, s:jmpchr] = [pos, [chr, pos]] - elsei exists('s:jmpchr') && s:jmpchr[0] == chr - " Start of lines - if s:jmpchr[1] == -1 | let s:jmpchr[1] = pos | en - let npos = match(lines, smartcs.'^'.chr, s:jmpchr[1] + 1) - let [jmpln, s:jmpchr] = [npos == -1 ? pos : npos, [chr, npos]] - en - exe 'keepj norm!' ( jmpln + 1 ).'G' - let pos = exists('*getcurpos') ? getcurpos() : getpos('.') - cal s:BuildPrompt(0) - cal setpos('.', pos) - en -endf -" Misc {{{2 -fu! s:PrtFocusMap(char) - cal call(( s:focus ? 's:PrtAdd' : 's:PrtSelectJump' ), [a:char]) -endf - -fu! s:PrtClearCache() - let ct = s:curtype() - if ct == 'fil' - cal ctrlp#clr() - elsei s:itemtype >= len(s:coretypes) - cal ctrlp#clr(s:statypes[s:itemtype][1]) - en - if ct == 'mru' - let g:ctrlp_lines = ctrlp#mrufiles#refresh() - el - cal ctrlp#setlines() - en - let s:force = 1 - cal s:BuildPrompt(1) - unl s:force -endf - -fu! s:PrtDeleteEnt() - let ct = s:curtype() - if ct == 'mru' - cal s:PrtDeleteMRU() - elsei ct == 'buf' - cal s:delbuf() - elsei type(s:getextvar('wipe')) == 1 - cal s:delent(s:getextvar('wipe')) - en -endf - -fu! s:PrtDeleteMRU() - if s:curtype() == 'mru' - cal s:delent('ctrlp#mrufiles#remove') - en -endf - -fu! s:PrtExit() - let bw = bufwinnr('%') - exe bufwinnr(s:bufnr).'winc w' - if bufnr('%') == s:bufnr && bufname('%') == 'ControlP' - noa cal s:Close() - noa winc p - els - exe bw.'winc w' - en -endf - -fu! s:PrtHistory(...) - if !s:focus || !s:maxhst | retu | en - let [str, hst, s:matches] = [join(s:prompt, ''), s:hstry, 1] - " Save to history if not saved before - let [hst[0], hslen] = [exists('s:hstgot') ? hst[0] : str, len(hst)] - let idx = exists('s:hisidx') ? s:hisidx + a:1 : a:1 - " Limit idx within 0 and hslen - let idx = idx < 0 ? 0 : idx >= hslen ? hslen > 1 ? hslen - 1 : 0 : idx - let s:prompt = [hst[idx], '', ''] - let [s:hisidx, s:hstgot, s:force] = [idx, 1, 1] - cal s:BuildPrompt(1) - unl s:force -endf -"}}}1 -" * Mappings {{{1 -fu! s:MapNorms() - if exists('s:nmapped') && s:nmapped == s:bufnr | retu | en - let pcmd = "nn \ \ \ :\cal \%s(\"%s\")\" - let cmd = substitute(pcmd, 'k%s', 'char-%d', '') - let pfunc = 'PrtFocusMap' - let ranges = [32, 33, 125, 126] + range(35, 91) + range(93, 123) - for each in [34, 92, 124] - exe printf(cmd, each, pfunc, escape(nr2char(each), '"|\')) - endfo - for each in ranges - exe printf(cmd, each, pfunc, nr2char(each)) - endfo - for each in range(0, 9) - exe printf(pcmd, each, pfunc, each) - endfo - for [ke, va] in items(s:kprange) - exe printf(pcmd, ke, pfunc, va) - endfo - let s:nmapped = s:bufnr -endf - -fu! s:MapSpecs() - if !( exists('s:smapped') && s:smapped == s:bufnr ) - " Correct arrow keys in terminal - if ( has('termresponse') && v:termresponse =~ "\" ) - \ || &term =~? '\vxterm|','\B ','\C ','\D '] - exe s:lcmap.' ['.each - endfo - en - en - for [ke, va] in items(s:prtmaps) | for kp in va - exe s:lcmap kp ':cal '.ke.'' - endfo | endfo - let s:smapped = s:bufnr -endf - -fu! s:KeyLoop() - let [t_ve, guicursor] = [&t_ve, &guicursor] - wh exists('s:init') && s:keyloop - try - set t_ve= - set guicursor=a:NONE - let nr = getchar() - fina - let &t_ve = t_ve - let &guicursor = guicursor - endt - let chr = !type(nr) ? nr2char(nr) : nr - if nr >=# 0x20 - cal s:PrtFocusMap(chr) - el - let cmd = matchstr(maparg(chr), ':\zs.\+\ze$') - try - exe ( cmd != '' ? cmd : 'norm '.chr ) - cat - endt - en - endw -endf -" * Toggling {{{1 -fu! s:ToggleFocus() - let s:focus = !s:focus - cal s:BuildPrompt(0) -endf - -fu! s:ToggleRegex() - let s:regexp = !s:regexp - cal s:PrtSwitcher() -endf - -fu! s:ToggleByFname() - if s:ispath - let s:byfname = !s:byfname - let s:mfunc = s:mfunc() - cal s:PrtSwitcher() - en -endf - -fu! s:ToggleType(dir) - let max = len(g:ctrlp_ext_vars) + len(s:coretypes) - 1 - let next = s:walker(max, s:itemtype, a:dir) - cal ctrlp#setlines(next) - cal ctrlp#syntax() - cal s:PrtSwitcher() -endf - -fu! s:ToggleKeyLoop() - let s:keyloop = !s:keyloop - if exists('+imd') - let &imd = !s:keyloop - en - if s:keyloop - let [&ut, s:lazy] = [0, 0] - cal s:KeyLoop() - elsei has_key(s:glbs, 'ut') - let [&ut, s:lazy] = [s:glbs['ut'], 1] - en -endf - -fu! s:ToggleMRURelative() - cal ctrlp#mrufiles#tgrel() - cal s:PrtClearCache() -endf - -fu! s:PrtSwitcher() - let [s:force, s:matches] = [1, 1] - cal s:BuildPrompt(1) - unl s:force -endf -" - SetWD() {{{1 -fu! s:SetWD(args) - if has_key(a:args, 'args') && stridx(a:args['args'], '--dir') >= 0 - \ && exists('s:dyncwd') - cal ctrlp#setdir(s:dyncwd) | retu - en - if has_key(a:args, 'dir') && a:args['dir'] != '' - cal ctrlp#setdir(a:args['dir']) | retu - en - let pmodes = has_key(a:args, 'mode') ? a:args['mode'] : s:pathmode - let [s:crfilerel, s:dyncwd] = [fnamemodify(s:crfile, ':.'), getcwd()] - if (!type(pmodes)) - let pmodes = - \ pmodes == 0 ? '' : - \ pmodes == 1 ? 'a' : - \ pmodes == 2 ? 'r' : - \ 'c' - en - let spath = pmodes =~ 'd' ? s:dyncwd : pmodes =~ 'w' ? s:cwd : s:crfpath - for pmode in split(pmodes, '\zs') - if ctrlp#setpathmode(pmode, spath) | retu | en - endfo -endf -" * AcceptSelection() {{{1 -fu! ctrlp#acceptfile(...) - let useb = 0 - if a:0 == 1 && type(a:1) == 4 - let [md, line] = [a:1['action'], a:1['line']] - let atl = has_key(a:1, 'tail') ? a:1['tail'] : '' - el - let [md, line] = [a:1, a:2] - let atl = a:0 > 2 ? a:3 : '' - en - if !type(line) - let [filpath, bufnr, useb] = [line, line, 1] - el - let [bufnr, filpath] = s:bufnrfilpath(line) - if bufnr == filpath - let useb = 1 - en - en - cal s:PrtExit() - let tail = s:tail() - let j2l = atl != '' ? atl : matchstr(tail, '^ +\zs\d\+$') - if bufnr > 0 && ( !empty(s:jmptobuf) && s:jmptobuf =~ md ) - \ && !( md == 'e' && bufnr == bufnr('%') ) - let [jmpb, bufwinnr] = [1, bufwinnr(bufnr)] - let buftab = ( s:jmptobuf =~# '[tTVH]' || s:jmptobuf > 1 ) - \ ? s:buftab(bufnr, md) : [0, 0] - en - " Switch to existing buffer or open new one - if exists('jmpb') && bufwinnr > 0 - \ && !( md == 't' && ( s:jmptobuf !~# toupper(md) || buftab[0] ) ) - exe bufwinnr.'winc w' - if j2l | cal ctrlp#j2l(j2l) | en - elsei exists('jmpb') && buftab[0] - \ && !( md =~ '[evh]' && s:jmptobuf !~# toupper(md) ) - exe 'tabn' buftab[0] - exe buftab[1].'winc w' - if j2l | cal ctrlp#j2l(j2l) | en - el - " Determine the command to use - let useb = bufnr > 0 && buflisted(bufnr) && ( empty(tail) || useb ) - let cmd = - \ md == 't' || s:splitwin == 1 ? ( useb ? 'tab sb' : 'tabe' ) : - \ md == 'h' || s:splitwin == 2 ? ( useb ? 'sb' : 'new' ) : - \ md == 'v' || s:splitwin == 3 ? ( useb ? 'vert sb' : 'vne' ) : - \ call('ctrlp#normcmd', useb ? ['b', 'bo vert sb'] : ['e']) - " Reset &switchbuf option - let [swb, &swb] = [&swb, ''] - " Open new window/buffer - let [fid, tail] = [( useb ? bufnr : filpath ), ( atl != '' ? ' +'.atl : tail )] - let args = [cmd, fid, tail, 1, [useb, j2l]] - cal call('s:openfile', args) - let &swb = swb - en -endf - -fu! s:SpecInputs(str) - if a:str =~ '\v^(\.\.([\/]\.\.)*[\/]?[.\/]*)$' && s:spi - let cwd = s:dyncwd - cal ctrlp#setdir(a:str =~ '^\.\.\.*$' ? - \ '../'.repeat('../', strlen(a:str) - 2) : a:str) - if cwd != s:dyncwd | cal ctrlp#setlines() | en - cal s:PrtClear() - retu 1 - elsei a:str == s:lash && s:spi - cal s:SetWD({ 'mode': 'rd' }) - cal ctrlp#setlines() - cal s:PrtClear() - retu 1 - elsei a:str =~ '^@.\+' && s:spi - retu s:at(a:str) - elsei a:str == '?' - cal s:PrtExit() - let hlpwin = &columns > 159 ? '| vert res 80' : '' - sil! exe 'bo vert h ctrlp-mappings' hlpwin '| norm! 0' - retu 1 - en - retu 0 -endf - -fu! s:AcceptSelection(action) - let [md, icr] = [a:action[0], match(a:action, 'r') >= 0] - let subm = icr || ( !icr && md == 'e' ) - if !subm && s:OpenMulti(md) != -1 | retu | en - let str = s:getinput() - if subm | if s:SpecInputs(str) | retu | en | en - " Get the selected line - let line = ctrlp#getcline() - if !subm && s:curtype() != 'fil' && line == '' && line('.') > s:offset - \ && str !~ '\v^(\.\.([\/]\.\.)*[\/]?[.\/]*|/|\\|\?|\@.+)$' - cal s:CreateNewFile(md) | retu - en - if empty(line) | retu | en - " Do something with it - if s:openfunc != {} && has_key(s:openfunc, s:ctype) - let actfunc = s:openfunc[s:ctype] - let type = has_key(s:openfunc, 'arg_type') ? s:openfunc['arg_type'] : 'list' - el - if s:itemtype < len(s:coretypes) - let [actfunc, type] = ['ctrlp#acceptfile', 'dict'] - el - let [actfunc, exttype] = [s:getextvar('accept'), s:getextvar('act_farg')] - let type = exttype == 'dict' ? exttype : 'list' - en - en - let actargs = type == 'dict' ? [{ 'action': md, 'line': line, 'icr': icr }] - \ : [md, line] - cal call(actfunc, actargs) -endf -" - CreateNewFile() {{{1 -fu! s:CreateNewFile(...) - let [md, str] = ['', s:getinput('n')] - if empty(str) | retu | en - if s:argmap && !a:0 - " Get the extra argument - let md = s:argmaps(md, 1) - if md == 'cancel' | retu | en - en - let str = s:sanstail(str) - let [base, fname] = s:headntail(str) - if fname =~ '^[\/]$' | retu | en - if exists('s:marked') && len(s:marked) - " Use the first marked file's path - let path = fnamemodify(values(s:marked)[0], ':p:h') - let base = path.s:lash(path).base - let str = fnamemodify(base.s:lash.fname, ':.') - en - if base != '' | if isdirectory(ctrlp#utils#mkdir(base)) - let optyp = str | en | el | let optyp = fname - en - if !exists('optyp') | retu | en - let [filpath, tail] = [fnamemodify(optyp, ':p'), s:tail()] - if !stridx(filpath, s:dyncwd) | cal s:insertcache(str) | en - cal s:PrtExit() - let cmd = md == 'r' ? ctrlp#normcmd('e') : - \ s:newfop =~ '1\|t' || ( a:0 && a:1 == 't' ) || md == 't' ? 'tabe' : - \ s:newfop =~ '2\|h' || ( a:0 && a:1 == 'h' ) || md == 'h' ? 'new' : - \ s:newfop =~ '3\|v' || ( a:0 && a:1 == 'v' ) || md == 'v' ? 'vne' : - \ ctrlp#normcmd('e') - cal s:openfile(cmd, filpath, tail, 1) -endf -" * OpenMulti() {{{1 -fu! s:MarkToOpen() - let ct = s:curtype() - if s:bufnr <= 0 || s:opmul == '0' - \ || ( s:itemtype >= len(s:coretypes) && s:getextvar('opmul') != 1 ) - retu - en - let line = ctrlp#getcline() - - " Do not allow to mark modified or current buffer - let bufnr = s:bufnrfilpath(line)[0] - if (ct == 'buf' && s:delbufcond(bufnr)) - retu - en - - if empty(line) | retu | en - let filpath = s:ispath ? fnamemodify(line, ':p') : line - if exists('s:marked') && s:dictindex(s:marked, filpath) > 0 - " Unmark and remove the file from s:marked - let key = s:dictindex(s:marked, filpath) - cal remove(s:marked, key) - if empty(s:marked) | unl s:marked | en - if has('signs') - exe 'sign unplace' key 'buffer='.s:bufnr - en - el - " Add to s:marked and place a new sign - if exists('s:marked') - let vac = s:vacantdict(s:marked) - let key = empty(vac) ? len(s:marked) + 1 : vac[0] - let s:marked = extend(s:marked, { key : filpath }) - el - let [key, s:marked] = [1, { 1 : filpath }] - en - if has('signs') - exe 'sign place' key 'line='.line('.').' name=ctrlpmark buffer='.s:bufnr - en - en - sil! cal ctrlp#statusline() -endf - -fu! s:OpenMulti(...) - let has_marked = exists('s:marked') - if ( !has_marked && a:0 ) || s:opmul == '0' || !s:ispath - \ || ( s:itemtype >= len(s:coretypes) && s:getextvar('opmul') != 1 ) - retu -1 - en - " Get the options - let [nr, md] = [matchstr(s:opmul, '\d\+'), matchstr(s:opmul, '[thvi]')] - let [ur, jf] = [s:opmul =~ 'r', s:opmul =~ 'j'] - let md = a:0 ? a:1 : ( md == '' ? 'v' : md ) - let nopt = exists('g:ctrlp_open_multiple_files') - if !has_marked - let line = ctrlp#getcline() - if line == '' | retu | en - let marked = { 1 : fnamemodify(line, ':p') } - let [nr, ur, jf, nopt] = ['1', 0, 0, 1] - en - if ( s:argmap || !has_marked ) && !a:0 - let md = s:argmaps(md, !has_marked ? 2 : 0) - if md == 'c' - cal s:unmarksigns() - unl! s:marked - cal s:BuildPrompt(0) - elsei !has_marked && md =~ '[axd]' - retu s:OpenNoMarks(md, line) - en - if md =~ '\v^c(ancel)?$' | retu | en - let nr = nr == '0' ? ( nopt ? '' : '1' ) : nr - let ur = !has_marked && md == 'r' ? 1 : ur - en - let mkd = values(has_marked ? s:marked : marked) - cal s:sanstail(join(s:prompt, '')) - cal s:PrtExit() - if nr == '0' || md == 'i' - retu map(mkd, "s:openfile('bad', v:val, '', 0)") - en - let tail = s:tail() - let [emptytail, bufnr] = [empty(tail), bufnr('^'.mkd[0].'$')] - let useb = bufnr > 0 && buflisted(bufnr) && emptytail - " Move to a replaceable window - let ncmd = ( useb ? ['b', 'bo vert sb'] : ['e', 'bo vne'] ) - \ + ( ur ? [] : ['ignruw'] ) - let fst = call('ctrlp#normcmd', ncmd) - " Check if the current window has a replaceable buffer - let repabl = !( md == 't' && !ur ) && empty(bufname('%')) && empty(&l:ft) - " Commands for the rest of the files - let [ic, cmds] = [1, { 'v': ['vert sb', 'vne'], 'h': ['sb', 'new'], - \ 't': ['tab sb', 'tabe'] }] - let [swb, &swb] = [&swb, ''] - if md == 't' && ctrlp#tabcount() < tabpagenr() - let s:tabct = ctrlp#tabcount() - en - " Open the files - for va in mkd - let bufnr = bufnr('^'.va.'$') - if bufnr < 0 && getftype(va) == '' | con | en - let useb = bufnr > 0 && buflisted(bufnr) && emptytail - let snd = md != '' && has_key(cmds, md) ? - \ ( useb ? cmds[md][0] : cmds[md][1] ) : ( useb ? 'vert sb' : 'vne' ) - let cmd = ic == 1 && ( !( !ur && fst =~ '^[eb]$' ) || repabl ) ? fst : snd - let conds = [( nr != '' && nr > 1 && nr < ic ) || ( nr == '' && ic > 1 ), - \ nr != '' && nr < ic] - if conds[nopt] - if !buflisted(bufnr) | cal s:openfile('bad', va, '', 0) | en - el - cal s:openfile(cmd, useb ? bufnr : va, tail, ic == 1) - if jf | if ic == 1 - let crpos = [tabpagenr(), winnr()] - el - let crpos[0] += tabpagenr() <= crpos[0] - let crpos[1] += winnr() <= crpos[1] - en | en - let ic += 1 - en - endfo - if jf && exists('crpos') && ic > 2 - exe ( md == 't' ? 'tabn '.crpos[0] : crpos[1].'winc w' ) - en - let &swb = swb - unl! s:tabct -endf - -fu! s:YankLine(...) - let @" = s:getinput() - let has_marked = exists('s:marked') - if !has_marked - let line = ctrlp#getcline() - if line == '' | retu | en - let marked = { 1 : fnamemodify(line, ':p') } - en - let @" = join(values(has_marked ? s:marked : marked), "\n") - cal s:PrtExit() -endf - -fu! s:OpenNoMarks(md, line) - if a:md == 'a' - let [s:marked, key] = [{}, 1] - for line in s:lines - let s:marked = extend(s:marked, { key : fnamemodify(line, ':p') }) - let key += 1 - endfo - cal s:remarksigns() - cal s:BuildPrompt(0) - elsei a:md == 'x' - let type = has_key(s:openfunc, 'arg_type') ? s:openfunc['arg_type'] : 'dict' - let argms = type == 'dict' ? [{ 'action': a:md, 'line': a:line }] - \ : [a:md, a:line] - cal call(s:openfunc[s:ctype], argms, s:openfunc) - elsei a:md == 'd' - let dir = fnamemodify(a:line, ':h') - if isdirectory(dir) - cal ctrlp#setdir(dir) - cal ctrlp#switchtype(0) - cal ctrlp#recordhist() - cal s:PrtClear() - en - en -endf -" ** Helper functions {{{1 -" Sorting {{{2 -fu! ctrlp#complen(...) - " By length - let [len1, len2] = [strlen(a:1), strlen(a:2)] - retu len1 == len2 ? 0 : len1 > len2 ? 1 : -1 -endf - -fu! s:compmatlen(...) - " By match length - let mln1 = s:shortest(s:matchlens(a:1, s:compat)) - let mln2 = s:shortest(s:matchlens(a:2, s:compat)) - retu mln1 == mln2 ? 0 : mln1 > mln2 ? 1 : -1 -endf - -fu! s:comptime(...) - " By last modified time - let [time1, time2] = [getftime(a:1), getftime(a:2)] - retu time1 == time2 ? 0 : time1 < time2 ? 1 : -1 -endf - -fu! s:compmreb(...) - " By last entered time (bufnr) - let [id1, id2] = [index(s:mrbs, a:1), index(s:mrbs, a:2)] - if id1 == id2 - return 0 - endif - if id1 < 0 - return 1 - endif - if id2 < 0 - return -1 - endif - return id1 > id2 ? 1 : -1 -endf - -fu! s:compmref(...) - " By last entered time (MRU) - let [id1, id2] = [index(g:ctrlp_lines, a:1), index(g:ctrlp_lines, a:2)] - retu id1 == id2 ? 0 : id1 > id2 ? 1 : -1 -endf - -fu! s:comparent(...) - " By same parent dir - if !stridx(s:crfpath, s:dyncwd) - let [as1, as2] = [s:dyncwd.s:lash().a:1, s:dyncwd.s:lash().a:2] - let [loc1, loc2] = [s:getparent(as1), s:getparent(as2)] - if loc1 == s:crfpath && loc2 != s:crfpath | retu -1 | en - if loc2 == s:crfpath && loc1 != s:crfpath | retu 1 | en - retu 0 - en - retu 0 -endf - -fu! s:compfnlen(...) - " By filename length - let len1 = strlen(split(a:1, s:lash)[-1]) - let len2 = strlen(split(a:2, s:lash)[-1]) - retu len1 == len2 ? 0 : len1 > len2 ? 1 : -1 -endf - -fu! s:matchlens(str, pat, ...) - if empty(a:pat) || index(['^', '$'], a:pat) >= 0 | retu {} | en - let st = a:0 ? a:1 : 0 - let lens = a:0 >= 2 ? a:2 : {} - let nr = a:0 >= 3 ? a:3 : 0 - if nr > 20 | retu {} | en - if match(a:str, a:pat, st) >= 0 - let [mst, mnd] = [matchstr(a:str, a:pat, st), matchend(a:str, a:pat, st)] - let lens = extend(lens, { nr : [strlen(mst), mst] }) - let lens = s:matchlens(a:str, a:pat, mnd, lens, nr + 1) - en - retu lens -endf - -fu! s:shortest(lens) - retu min(map(values(a:lens), 'v:val[0]')) -endf - -fu! s:mixedsort(...) - let ct = s:curtype() - if ct == 'buf' - let pat = '[\/]\?\[\d\+\*No Name\]$' - if a:1 =~# pat && a:2 =~# pat | retu 0 - elsei a:1 =~# pat | retu 1 - elsei a:2 =~# pat | retu -1 | en - en - let [cln, cml] = [ctrlp#complen(a:1, a:2), s:compmatlen(a:1, a:2)] - if s:ispath - let ms = [] - if s:res_count < 21 - let ms += [s:compfnlen(a:1, a:2)] - if ct !~ '^\(buf\|mru\)$' | let ms += [s:comptime(a:1, a:2)] | en - if !s:itemtype | let ms += [s:comparent(a:1, a:2)] | en - en - if ct =~ '^\(buf\|mru\)$' - let ms += [s:compmref(a:1, a:2)] - let cln = cml ? cln : 0 - en - let ms += [cml, 0, 0, 0] - let mp = call('s:multipliers', ms[:3]) - retu cln + ms[0] * mp[0] + ms[1] * mp[1] + ms[2] * mp[2] + ms[3] * mp[3] - en - retu cln + cml * 2 -endf - -fu! s:multipliers(...) - let mp0 = !a:1 ? 0 : 2 - let mp1 = !a:2 ? 0 : 1 + ( !mp0 ? 1 : mp0 ) - let mp2 = !a:3 ? 0 : 1 + ( !( mp0 + mp1 ) ? 1 : ( mp0 + mp1 ) ) - let mp3 = !a:4 ? 0 : 1 + ( !( mp0 + mp1 + mp2 ) ? 1 : ( mp0 + mp1 + mp2 ) ) - retu [mp0, mp1, mp2, mp3] -endf - -fu! s:compval(...) - retu a:1 - a:2 -endf -" Statusline {{{2 -fu! ctrlp#statusline() - if !exists('s:statypes') - let s:statypes = copy(s:coretypes) - if !empty(g:ctrlp_ext_vars) - cal map(copy(g:ctrlp_ext_vars), - \ 'add(s:statypes, [ v:val["lname"], v:val["sname"] ])') - en - en - let tps = s:statypes - let max = len(tps) - 1 - let nxt = tps[s:walker(max, s:itemtype, 1)][1] - let prv = tps[s:walker(max, s:itemtype, -1)][1] - let s:ctype = tps[s:itemtype][0] - let focus = s:focus ? 'prt' : 'win' - let byfname = s:ispath ? s:byfname ? 'file' : 'path' : 'line' - let marked = s:opmul != '0' ? - \ exists('s:marked') ? ' <'.s:dismrk().'>' : ' <->' : '' - if s:status != {} - let argms = - \ has_key(s:status, 'arg_type') && s:status['arg_type'] == 'dict' ? [{ - \ 'focus': focus, - \ 'byfname': byfname, - \ 'regex': s:regexp, - \ 'prev': prv, - \ 'item': s:ctype, - \ 'next': nxt, - \ 'marked': marked, - \ }] : [focus, byfname, s:regexp, prv, s:ctype, nxt, marked] - let &l:stl = call(s:status['main'], argms, s:status) - el - let item = '%#CtrlPMode1# '.s:ctype.' %*' - let focus = '%#CtrlPMode2# '.focus.' %*' - let byfname = '%#CtrlPMode1# '.byfname.' %*' - let regex = s:regexp ? '%#CtrlPMode2# regex %*' : '' - let slider = ' <'.prv.'>={'.item.'}=<'.nxt.'>' - let dir = ' %=%<%#CtrlPMode2# %{getcwd()} %*' - let &l:stl = focus.byfname.regex.slider.marked.dir - en -endf - -fu! s:dismrk() - retu has('signs') ? len(s:marked) : - \ '%<'.join(values(map(copy(s:marked), 'split(v:val, "[\\/]")[-1]')), ', ') -endf - -fu! ctrlp#progress(enum, ...) - if has('macunix') || has('mac') | sl 1m | en - let txt = a:0 ? '(press ctrl-c to abort)' : '' - if s:status != {} - let argms = has_key(s:status, 'arg_type') && s:status['arg_type'] == 'dict' - \ ? [{ 'str': a:enum }] : [a:enum] - let &l:stl = call(s:status['prog'], argms, s:status) - el - let &l:stl = '%#CtrlPStats# '.a:enum.' %* '.txt.'%=%<%#CtrlPMode2# %{getcwd()} %*' - en - redraws -endf -" *** Paths {{{2 -" Line formatting {{{3 -fu! s:formatline(str) - let str = a:str - let ct = s:curtype() - if ct == 'buf' - let bufnr = s:bufnrfilpath(str)[0] - let parts = s:bufparts(bufnr) - let str = printf('%'.s:bufnr_width.'s', bufnr) - if s:has_conceal - let str .= printf(' %-13s %s%-36s', - \ ''.parts[0].'', - \ ''.parts[1], '{'.parts[2].'}') - if (!empty(s:bufpath_mod)) - let str .= printf(' %s', ''.parts[3].'') - en - el - let str .= printf(' %-5s %-30s', - \ parts[0], - \ parts[2]) - if (!empty(s:bufpath_mod)) - let str .= printf(' %s', parts[3]) - en - en - en - let cond = ct != 'buf' &&s:ispath && ( s:winw - 4 ) < s:strwidth(str) - retu s:lineprefix.( cond ? s:pathshorten(str) : str ) -endf - -fu! s:pathshorten(str) - retu matchstr(a:str, '^.\{9}').'...' - \ .matchstr(a:str, '.\{'.( s:winw - 16 ).'}$') -endf - -fu! s:offset(lines, height) - let s:offset = s:mw_order == 'btt' ? ( a:height - s:res_count ) : 0 - retu s:offset > 0 ? ( repeat([''], s:offset) + a:lines ) : a:lines -endf -" Directory completion {{{3 -fu! s:dircompl(be, sd) - if a:sd == '' | retu [] | en - if a:be == '' - let [be, sd] = [s:dyncwd, a:sd] - el - let be = a:be.s:lash(a:be) - let sd = be.a:sd - en - let dirs = split(globpath(s:fnesc(be, 'g', ','), a:sd.'*/'), "\n") - if a:be == '' - let dirs = ctrlp#rmbasedir(dirs) - en - cal filter(dirs, '!match(v:val, escape(sd, ''~$.\''))' - \ . ' && v:val !~ ''\v(^|[\/])\.{1,2}[\/]$''') - retu dirs -endf - -fu! s:findcommon(items, seed) - let [items, id, cmn, ic] = [copy(a:items), strlen(a:seed), '', 0] - cal map(items, 'strpart(v:val, id)') - for char in split(items[0], '\zs') - for item in items[1:] - if item[ic] != char | let brk = 1 | brea | en - endfo - if exists('brk') | brea | en - let cmn .= char - let ic += 1 - endfo - retu cmn -endf -" Misc {{{3 -fu! s:headntail(str) - let parts = split(a:str, '[\/]\ze[^\/]\+[\/:]\?$') - retu len(parts) == 1 ? ['', parts[0]] : len(parts) == 2 ? parts : [] -endf - -fu! s:lash(...) - retu ( a:0 ? a:1 : s:dyncwd ) !~ '[\/]$' ? s:lash : '' -endf - -fu! s:ispathitem() - retu s:itemtype < len(s:coretypes) || s:getextvar('type') == 'path' -endf - -fu! ctrlp#igncwd(cwd) - retu ctrlp#utils#glob(a:cwd, 0) == '' || - \ ( s:igntype >= 0 && s:usrign(a:cwd, getftype(a:cwd)) ) -endf - -fu! ctrlp#dirnfile(entries) - let [items, cwd] = [[[], []], s:dyncwd.s:lash()] - for each in a:entries - let etype = getftype(each) - if s:igntype >= 0 && s:usrign(each, etype) | con | en - if etype == 'dir' - if s:showhidden | if each !~ '[\/]\.\{1,2}$' - cal add(items[0], each) - en | el - cal add(items[0], each) - en - elsei etype == 'link' - if s:folsym - let isfile = !isdirectory(each) - if s:folsym == 2 || !s:samerootsyml(each, isfile, cwd) - cal add(items[isfile], each) - en - en - elsei etype == 'file' - cal add(items[1], each) - en - endfo - retu items -endf - -fu! s:usrign(item, type) - if s:igntype == 1 | retu a:item =~ s:usrign | en - if s:igntype == 2 - if call(s:usrign, [a:item, a:type]) - retu 1 - en - elsei s:igntype == 4 - if has_key(s:usrign, a:type) && s:usrign[a:type] != '' - \ && a:item =~ s:usrign[a:type] - retu 1 - elsei has_key(s:usrign, 'func') && s:usrign['func'] != '' - \ && call(s:usrign['func'], [a:item, a:type]) - retu 1 - en - en - retu 0 -endf - -fu! s:samerootsyml(each, isfile, cwd) - let resolve = fnamemodify(resolve(a:each), ':p:h') - let resolve .= s:lash(resolve) - retu !( stridx(resolve, a:cwd) && ( stridx(a:cwd, resolve) || a:isfile ) ) -endf - -fu! ctrlp#rmbasedir(items) - if a:items == [] - retu a:items - en - let cwd = s:dyncwd.s:lash() - let first = a:items[0] - if has('win32') || has('win64') - let cwd = tr(cwd, '\', '/') - let first = tr(first, '\', '/') - en - if !stridx(first, cwd) - let idx = strlen(cwd) - retu map(a:items, 'strpart(v:val, idx)') - en - retu a:items -endf -" Working directory {{{3 -fu! s:getparent(item) - let parent = substitute(a:item, '[\/][^\/]\+[\/:]\?$', '', '') - if parent == '' || parent !~ '[\/]' - let parent .= s:lash - en - retu parent -endf - -fu! s:findroot(curr, mark, depth, type) - let [depth, fnd] = [a:depth + 1, 0] - if type(a:mark) == 1 - let fnd = s:glbpath(s:fnesc(a:curr, 'g', ','), a:mark, 1) != '' - elsei type(a:mark) == 3 - for markr in a:mark - if s:glbpath(s:fnesc(a:curr, 'g', ','), markr, 1) != '' - let fnd = 1 - brea - en - endfo - en - if fnd - if !a:type | cal ctrlp#setdir(a:curr) | en - retu [exists('markr') ? markr : a:mark, a:curr] - elsei depth > s:maxdepth - cal ctrlp#setdir(s:cwd) - el - let parent = s:getparent(a:curr) - if parent != a:curr - retu s:findroot(parent, a:mark, depth, a:type) - en - en - retu [] -endf - -fu! ctrlp#setpathmode(pmode, ...) - if a:pmode == 'c' || ( a:pmode == 'a' && stridx(s:crfpath, s:cwd) < 0 ) - if exists('+acd') | let [s:glb_acd, &acd] = [&acd, 0] | en - cal ctrlp#setdir(s:crfpath) - retu 1 - elsei a:pmode == 'r' - let spath = a:0 ? a:1 : s:crfpath - let markers = ['.git', '.hg', '.svn', '.bzr', '_darcs'] - if type(s:rmarkers) == 3 && !empty(s:rmarkers) - if s:findroot(spath, s:rmarkers, 0, 0) != [] | retu 1 | en - cal filter(markers, 'index(s:rmarkers, v:val) < 0') - let markers = s:rmarkers + markers - en - if s:findroot(spath, markers, 0, 0) != [] | retu 1 | en - en - retu 0 -endf - -fu! ctrlp#setdir(path, ...) - let cmd = a:0 ? a:1 : 'lc!' - sil! exe cmd s:fnesc(a:path, 'c') - let [s:crfilerel, s:dyncwd] = [fnamemodify(s:crfile, ':.'), getcwd()] -endf -" Fallbacks {{{3 -fu! s:glbpath(...) - retu call('ctrlp#utils#globpath', a:000) -endf - -fu! s:fnesc(...) - retu call('ctrlp#utils#fnesc', a:000) -endf - -fu! ctrlp#setlcdir() - if exists('*haslocaldir') - cal ctrlp#setdir(getcwd(), haslocaldir() ? 'lc!' : 'cd!') - en -endf -" Highlighting {{{2 -fu! ctrlp#syntax() - if ctrlp#nosy() | retu | en - for [ke, va] in items(s:hlgrps) | cal ctrlp#hicheck('CtrlP'.ke, va) | endfo - let bgColor=synIDattr(synIDtrans(hlID('Normal')), 'bg') - if bgColor !~ '^-1$\|^$' - sil! exe 'hi CtrlPLinePre guifg='.bgColor.' ctermfg='.bgColor - en - sy match CtrlPNoEntries '^ == NO ENTRIES ==$' - if hlexists('CtrlPLinePre') - exe "sy match CtrlPLinePre '^".escape(get(g:, 'ctrlp_line_prefix', '>'),'^$.*~\')."'" - en - - if s:curtype() == 'buf' && s:has_conceal - sy region CtrlPBufferNr matchgroup=CtrlPLinePre start='^>\s\+' end='\s' - sy region CtrlPBufferInd concealends matchgroup=Ignore start='' end='' - sy region CtrlPBufferRegion concealends matchgroup=Ignore start='' end='' - \ contains=CtrlPBufferHid,CtrlPBufferHidMod,CtrlPBufferVis,CtrlPBufferVisMod,CtrlPBufferCur,CtrlPBufferCurMod - sy region CtrlPBufferHid concealends matchgroup=Ignore start='\s*{' end='}' contained - sy region CtrlPBufferHidMod concealends matchgroup=Ignore start='+\s*{' end='}' contained - sy region CtrlPBufferVis concealends matchgroup=Ignore start='\*\s*{' end='}' contained - sy region CtrlPBufferVisMod concealends matchgroup=Ignore start='\*+\s*{' end='}' contained - sy region CtrlPBufferCur concealends matchgroup=Ignore start='\*!\s*{' end='}' contained - sy region CtrlPBufferCurMod concealends matchgroup=Ignore start='\*+!\s*{' end='}' contained - sy region CtrlPBufferPath concealends matchgroup=Ignore start='' end='' - en -endf - -fu! s:highlight(pat, grp) - if s:matcher != {} | retu | en - cal clearmatches() - if !empty(a:pat) && s:ispath - if s:regexp - let pat = substitute(a:pat, '\\\@ \\zs', 'g') - cal matchadd(a:grp, ( s:martcs == '' ? '\c' : '\C' ).pat) - el - let pat = a:pat - - " get original characters so we can rebuild pat - let chars = split(pat, '\[\^\\\?.\]\\{-}') - - " Build a pattern like /a.*b.*c/ from abc (but with .\{-} non-greedy - " matchers instead) - let pat = join(chars, '.\{-}') - " Ensure we match the last version of our pattern - let ending = '\(.*'.pat.'\)\@!' - " Case sensitive? - let beginning = ( s:martcs == '' ? '\c' : '\C' ).'^.*' - if s:byfname() - " Make sure there are no slashes in our match - let beginning = beginning.'\([^\/]*$\)\@=' - en - - for i in range(len(chars)) - " Surround our current target letter with \zs and \ze so it only - " actually matches that one letter, but has all preceding and trailing - " letters as well. - " \zsa.*b.*c - " a\(\zsb\|.*\zsb)\ze.*c - let charcopy = copy(chars) - if i == 0 - let charcopy[i] = '\zs'.charcopy[i].'\ze' - let middle = join(charcopy, '.\{-}') - el - let before = join(charcopy[0:i-1], '.\{-}') - let after = join(charcopy[i+1:-1], '.\{-}') - let c = charcopy[i] - " for abc, match either ab.\{-}c or a.*b.\{-}c in that order - let cpat = '\(\zs'.c.'\|'.'.*\zs'.c.'\)\ze.*' - let middle = before.cpat.after - en - - " Now we matchadd for each letter, the basic form being: - " ^.*\zsx\ze.*$, but with our pattern we built above for the letter, - " and a negative lookahead ensuring that we only highlight the last - " occurrence of our letters. We also ensure that our matcher is case - " insensitive or sensitive depending. - cal matchadd(a:grp, beginning.middle.ending) - endfo - en - - cal matchadd('CtrlPLinePre', '^>') - en -endf - -fu! s:dohighlight() - retu s:mathi[0] && exists('*clearmatches') && !ctrlp#nosy() -endf -" Prompt history {{{2 -fu! s:gethistloc() - let utilcadir = ctrlp#utils#cachedir() - let cache_dir = utilcadir.s:lash(utilcadir).'hist' - retu [cache_dir, cache_dir.s:lash(cache_dir).'cache.txt'] -endf - -fu! s:gethistdata() - retu ctrlp#utils#readfile(s:gethistloc()[1]) -endf - -fu! ctrlp#recordhist() - let str = join(s:prompt, '') - if empty(str) || !s:maxhst | retu | en - let hst = s:hstry - if len(hst) > 1 && hst[1] == str | retu | en - cal extend(hst, [str], 1) - if len(hst) > s:maxhst | cal remove(hst, s:maxhst, -1) | en - cal ctrlp#utils#writecache(hst, s:gethistloc()[0], s:gethistloc()[1]) -endf -" Signs {{{2 -fu! s:unmarksigns() - if !s:dosigns() | retu | en - for key in keys(s:marked) - exe 'sign unplace' key 'buffer='.s:bufnr - endfo -endf - -fu! s:remarksigns() - if !s:dosigns() | retu | en - for ic in range(1, len(s:lines)) - let line = s:ispath ? fnamemodify(s:lines[ic - 1], ':p') : s:lines[ic - 1] - let key = s:dictindex(s:marked, line) - if key > 0 - exe 'sign place' key 'line='.ic.' name=ctrlpmark buffer='.s:bufnr - en - endfo -endf - -fu! s:dosigns() - retu exists('s:marked') && s:bufnr > 0 && s:opmul != '0' && has('signs') -endf -" Lists & Dictionaries {{{2 -fu! s:ifilter(list, str) - let [rlist, estr] = [[], substitute(a:str, 'v:val', 'each', 'g')] - for each in a:list - try - if eval(estr) - cal add(rlist, each) - en - cat | con | endt - endfo - retu rlist -endf - -fu! s:dictindex(dict, expr) - for key in keys(a:dict) - if a:dict[key] == a:expr | retu key | en - endfo - retu -1 -endf - -fu! s:vacantdict(dict) - retu filter(range(1, max(keys(a:dict))), '!has_key(a:dict, v:val)') -endf - -fu! s:sublist(l, s, e) - retu v:version > 701 ? a:l[(a:s):(a:e)] : s:sublist7071(a:l, a:s, a:e) -endf - -fu! s:sublist7071(l, s, e) - let [newlist, id, ae] = [[], a:s, a:e == -1 ? len(a:l) - 1 : a:e] - wh id <= ae - cal add(newlist, get(a:l, id)) - let id += 1 - endw - retu newlist -endf -" Buffers {{{2 -fu! s:buftab(bufnr, md) - for tabnr in range(1, tabpagenr('$')) - if tabpagenr() == tabnr && a:md == 't' | con | en - let buflist = tabpagebuflist(tabnr) - if index(buflist, a:bufnr) >= 0 - for winnr in range(1, tabpagewinnr(tabnr, '$')) - if buflist[winnr - 1] == a:bufnr | retu [tabnr, winnr] | en - endfo - en - endfo - retu [0, 0] -endf - -fu! s:bufwins(bufnr) - let winns = 0 - for tabnr in range(1, tabpagenr('$')) - let winns += count(tabpagebuflist(tabnr), a:bufnr) - endfo - retu winns -endf - -fu! s:isabs(path) - if (has('win32') || has('win64')) - return a:path =~ '^\([a-zA-Z]:\)\{-}[/\\]' - el - return a:path =~ '^[/\\]' - en -endf - -fu! s:bufnrfilpath(line) - if s:isabs(a:line) || a:line =~ '^\~[/\\]' || a:line =~ '^\w\+:\/\/' - let filpath = a:line - el - let filpath = s:dyncwd.s:lash().a:line - en - let filpath = fnamemodify(filpath, ':p') - let bufnr = bufnr('^'.filpath.'$') - if (!filereadable(filpath) && bufnr < 1) - if (a:line =~ '[\/]\?\[\d\+\*No Name\]$') - let bufnr = str2nr(matchstr(a:line, '[\/]\?\[\zs\d\+\ze\*No Name\]$')) - let filpath = bufnr - else - let bufnr = bufnr(a:line) - retu [bufnr, a:line] - en - en - retu [bufnr, filpath] -endf - -fu! ctrlp#normcmd(cmd, ...) - let buftypes = [ 'quickfix', 'help' ] - if a:0 < 2 && s:nosplit() | retu a:cmd | en - let norwins = filter(range(1, winnr('$')), - \ 'index(buftypes, getbufvar(winbufnr(v:val), "&bt")) == -1 || s:isneovimterminal(winbufnr(v:val))') - for each in norwins - let bufnr = winbufnr(each) - if empty(bufname(bufnr)) && empty(getbufvar(bufnr, '&ft')) - let fstemp = each | brea - en - endfo - let norwin = empty(norwins) ? 0 : norwins[0] - if norwin - if index(norwins, winnr()) < 0 - exe ( exists('fstemp') ? fstemp : norwin ).'winc w' - en - retu a:cmd - en - retu a:0 ? a:1 : 'bo vne' -endf - -fu! ctrlp#modfilecond(w) - retu &mod && !&hid && &bh != 'hide' && s:bufwins(bufnr('%')) == 1 && !&cf && - \ ( ( !&awa && a:w ) || filewritable(fnamemodify(bufname('%'), ':p')) != 1 ) -endf - -fu! s:nosplit() - retu !empty(s:nosplit) && match([bufname('%'), &l:ft, &l:bt], s:nosplit) >= 0 -endf - -fu! s:setupblank() - setl noswf nonu nobl nowrap nolist nospell nocuc wfh - setl fdc=0 fdl=99 tw=0 bt=nofile bh=unload - if v:version > 702 - setl nornu noudf cc=0 - en - if s:has_conceal - setl cole=2 cocu=nc - en -endf - -fu! s:leavepre() - if exists('s:bufnr') && s:bufnr == bufnr('%') | bw! | en - if !( exists(s:ccex) && !{s:ccex} ) - \ && !( has('clientserver') && len(split(serverlist(), "\n")) > 1 ) - cal ctrlp#clra() - en -endf - -fu! s:checkbuf() - if !exists('s:init') && exists('s:bufnr') && s:bufnr > 0 - exe s:bufnr.'bw!' - en -endf - -fu! s:iscmdwin() - let [ermsg, v:errmsg] = [v:errmsg, ''] - sil! noa winc p - sil! noa winc p - let [v:errmsg, ermsg] = [ermsg, v:errmsg] - retu ermsg =~ '^E11:' -endf -" Arguments {{{2 -fu! s:at(str) - if a:str =~ '\v^\@(cd|lc[hd]?|chd).*' - let str = substitute(a:str, '\v^\@(cd|lc[hd]?|chd)\s*', '', '') - if str == '' | retu 1 | en - let str = str =~ '^%:.\+' ? fnamemodify(s:crfile, str[1:]) : str - let path = fnamemodify(expand(str, 1), ':p') - if isdirectory(path) - if path != s:dyncwd - cal ctrlp#setdir(path) - cal ctrlp#setlines() - en - cal ctrlp#recordhist() - cal s:PrtClear() - en - retu 1 - en - retu 0 -endf - -fu! s:tail() - if exists('s:optail') && !empty('s:optail') - let tailpref = s:optail !~ '^\s*+' ? ' +' : ' ' - retu tailpref.s:optail - en - retu '' -endf - -fu! s:sanstail(str) - let str = s:spi ? - \ substitute(a:str, '^\(@.*$\|\\\\\ze@\|\.\.\zs[.\/]\+$\)', '', 'g') : a:str - let [str, pat] = [substitute(str, '\\\\', '\', 'g'), '\([^:]\|\\:\)*$'] - unl! s:optail - if str =~ '\\\@= 0 - retu char - elsei char =~# "\\v\|\|\|\|\|\" - cal s:BuildPrompt(0) - retu 'cancel' - elsei char =~# "\" && a:args != [] - retu a:args[0] - en - retu call(a:func, a:args) -endf - -fu! s:getregs() - let char = s:textdialog('Insert from register: ') - if char =~# "\\v\|\|\|\|\|\" - cal s:BuildPrompt(0) - retu -1 - elsei char =~# "\" - retu s:getregs() - en - retu s:regisfilter(char) -endf - -fu! s:regisfilter(reg) - retu substitute(getreg(a:reg), "[\t\n]", ' ', 'g') -endf -" Misc {{{2 -fu! s:modevar() - let s:matchtype = s:mtype() - let s:ispath = s:ispathitem() - let s:mfunc = s:mfunc() - let s:nolim = s:getextvar('nolim') - let s:dosort = s:getextvar('sort') - let s:spi = !s:itemtype || s:getextvar('specinput') > 0 -endf - -fu! s:nosort() - let ct = s:curtype() - retu s:matcher != {} || s:nolim == 1 || ( ct == 'mru' && s:mrudef ) - \ || ( ct =~ '^\(buf\|mru\)$' && s:prompt == ['', '', ''] ) || !s:dosort -endf - -fu! s:byfname() - retu s:curtype() != 'buf' && s:ispath && s:byfname -endf - -fu! s:narrowable() - retu exists('s:act_add') && exists('s:matched') && s:matched != [] - \ && exists('s:mdata') && s:mdata[:2] == [s:dyncwd, s:itemtype, s:regexp] - \ && s:matcher == {} && !exists('s:did_exp') -endf - -fu! s:getinput(...) - let [prt, spi] = [s:prompt, ( a:0 ? a:1 : '' )] - if s:abbrev != {} - let gmd = has_key(s:abbrev, 'gmode') ? s:abbrev['gmode'] : '' - let str = ( gmd =~ 't' && !a:0 ) || spi == 'c' ? prt[0] : join(prt, '') - if gmd =~ 't' && gmd =~ 'k' && !a:0 && matchstr(str, '.$') =~ '\k' - retu join(prt, '') - en - let [pf, rz] = [( s:byfname() ? 'f' : 'p' ), ( s:regexp ? 'r' : 'z' )] - for dict in s:abbrev['abbrevs'] - let dmd = has_key(dict, 'mode') ? dict['mode'] : '' - let pat = escape(dict['pattern'], '~') - if ( dmd == '' || ( dmd =~ pf && dmd =~ rz && !a:0 ) - \ || dmd =~ '['.spi.']' ) && str =~ pat - let [str, s:did_exp] = [join(split(str, pat, 1), dict['expanded']), 1] - en - endfo - if gmd =~ 't' && !a:0 - let prt[0] = str - el - retu str - en - en - retu spi == 'c' ? prt[0] : join(prt, '') -endf - -fu! s:strwidth(str) - retu exists('*strdisplaywidth') ? strdisplaywidth(a:str) : strlen(a:str) -endf - -fu! ctrlp#j2l(nr) - exe 'norm!' a:nr.'G' - sil! norm! zvzz -endf - -fu! s:maxf(len) - retu s:maxfiles && a:len > s:maxfiles -endf - -fu! s:regexfilter(str) - let str = a:str - for key in keys(s:fpats) | if str =~ key - let str = substitute(str, s:fpats[key], '', 'g') - en | endfo - retu str -endf - -fu! s:walker(m, p, d) - retu a:d >= 0 ? a:p < a:m ? a:p + a:d : 0 : a:p > 0 ? a:p + a:d : a:m -endf - -fu! s:delent(rfunc) - if a:rfunc == '' | retu | en - let [s:force, tbrem] = [1, []] - if exists('s:marked') - let tbrem = values(s:marked) - cal s:unmarksigns() - unl s:marked - en - if tbrem == [] && ( has('dialog_gui') || has('dialog_con') ) && - \ confirm("Wipe all entries?", "&OK\n&Cancel") != 1 - unl s:force - cal s:BuildPrompt(0) - retu - en - let g:ctrlp_lines = call(a:rfunc, [tbrem]) - cal s:BuildPrompt(1) - unl s:force -endf - -fu! s:delbufcond(bufnr) - retu getbufvar(a:bufnr, "&mod") || a:bufnr == s:crbufnr -endf - -fu! s:delbuf() - let lines = [] - if exists('s:marked') - let lines = values(s:marked) - cal s:unmarksigns() - unl s:marked - el - let lines += [ctrlp#getcline()] - en - for line in lines - let bufnr = s:bufnrfilpath(line)[0] - if (s:delbufcond(bufnr)) - con - en - exe 'bd '. bufnr - endfo - cal s:PrtClearCache() -endf - -fu! s:isneovimterminal(buf) - retu has('nvim') && getbufvar(a:buf, "&bt") == "terminal" -endf -" Entering & Exiting {{{2 -fu! s:getenv() - let [s:cwd, s:winres] = [getcwd(), [winrestcmd(), &lines, winnr('$')]] - let [s:crword, s:crnbword] = [expand('', 1), expand('', 1)] - let [s:crgfile, s:crline] = [expand('', 1), getline('.')] - let [s:winmaxh, s:crcursor] = [min([s:mw_max, &lines]), getpos('.')] - let [s:crbufnr, s:crvisual] = [bufnr('%'), s:lastvisual()] - let s:crfile = bufname('%') == '' - \ ? '['.s:crbufnr.'*No Name]' : expand('%:p', 1) - let s:crfpath = expand('%:p:h', 1) - let s:mrbs = ctrlp#mrufiles#bufs() -endf - -fu! s:lastvisual() - let cview = winsaveview() - let [ovreg, ovtype] = [getreg('v'), getregtype('v')] - let [oureg, outype] = [getreg('"'), getregtype('"')] - sil! norm! gv"vy - let selected = s:regisfilter('v') - cal setreg('v', ovreg, ovtype) - cal setreg('"', oureg, outype) - cal winrestview(cview) - retu selected -endf - -fu! s:log(m) - if exists('g:ctrlp_log') && g:ctrlp_log | if a:m - let cadir = ctrlp#utils#cachedir() - let apd = g:ctrlp_log > 1 ? '>' : '' - sil! exe 'redi! >'.apd cadir.s:lash(cadir).'ctrlp.log' - el - sil! redi END - en | en -endf - -fu! s:buffunc(e) - if a:e && has_key(s:buffunc, 'enter') - cal call(s:buffunc['enter'], [], s:buffunc) - elsei !a:e && has_key(s:buffunc, 'exit') - cal call(s:buffunc['exit'], [], s:buffunc) - en -endf - -fu! s:openfile(cmd, fid, tail, chkmod, ...) - let cmd = a:cmd - if a:chkmod && cmd =~ '^[eb]$' && ctrlp#modfilecond(!( cmd == 'b' && &aw )) - let cmd = cmd == 'b' ? 'sb' : 'sp' - en - let cmd = cmd =~ '^tab' ? ctrlp#tabcount().cmd : cmd - let j2l = a:0 && a:1[0] ? a:1[1] : 0 - exe cmd.( a:0 && a:1[0] ? '' : a:tail ) s:fnesc(a:fid, 'f') - if j2l - cal ctrlp#j2l(j2l) - en - if !empty(a:tail) - sil! norm! zvzz - en - if cmd != 'bad' - cal ctrlp#setlcdir() - en -endf - -fu! ctrlp#tabcount() - if exists('s:tabct') - let tabct = s:tabct - let s:tabct += 1 - elsei !type(s:tabpage) - let tabct = s:tabpage - elsei type(s:tabpage) == 1 - let tabpos = - \ s:tabpage =~ 'c' ? tabpagenr() : - \ s:tabpage =~ 'f' ? 1 : - \ s:tabpage =~ 'l' ? tabpagenr('$') : - \ tabpagenr() - let tabct = - \ s:tabpage =~ 'a' ? tabpos : - \ s:tabpage =~ 'b' ? tabpos - 1 : - \ tabpos - en - retu tabct < 0 ? 0 : tabct -endf - -fu! s:settype(type) - retu a:type < 0 ? exists('s:itemtype') ? s:itemtype : 0 : a:type -endf -" Matching {{{2 -fu! s:matchfname(item, pat) - let parts = split(a:item, '[\/]\ze[^\/]\+$') - let mfn = match(parts[-1], a:pat[0]) - retu len(a:pat) == 1 ? mfn : len(a:pat) == 2 ? - \ ( mfn >= 0 && ( len(parts) == 2 ? match(parts[0], a:pat[1]) : -1 ) >= 0 - \ ? 0 : -1 ) : -1 -endf - -fu! s:matchbuf(item, pat) - let bufnr = s:bufnrfilpath(a:item)[0] - let parts = s:bufparts(bufnr) - let item = s:byfname ? parts[2] : bufnr.parts[0].parts[2].s:lash().parts[3] - retu match(item, a:pat) -endf - -fu! s:matchtabs(item, pat) - retu match(split(a:item, '\t\+')[0], a:pat) -endf - -fu! s:matchtabe(item, pat) - retu match(split(a:item, '\t\+[^\t]\+$')[0], a:pat) -endf - -fu! s:buildpat(lst) - let pat = a:lst[0] - if s:matchnatural == 1 - for item in range(1, len(a:lst) - 1) - let c = a:lst[item - 1] - let pat .= (c == '/' ? '[^/]\{-}' : '[^'.c.'/]\{-}').a:lst[item] - endfo - else - for item in range(1, len(a:lst) - 1) - let pat .= '[^'.a:lst[item - 1].']\{-}'.a:lst[item] - endfo - en - retu pat -endf - -fu! s:curtype() - return s:CurTypeName()[1] -endf - -fu! s:mfunc() - let mfunc = 'match' - if s:byfname() - let mfunc = 's:matchfname' - elsei s:curtype() == 'buf' - let mfunc = 's:matchbuf' - elsei s:itemtype >= len(s:coretypes) - let matchtypes = { 'tabs': 's:matchtabs', 'tabe': 's:matchtabe' } - if has_key(matchtypes, s:matchtype) - let mfunc = matchtypes[s:matchtype] - en - en - retu mfunc -endf - -fu! s:mmode() - let matchmodes = { - \ 'match': 'full-line', - \ 's:matchfname': 'filename-only', - \ 's:matchbuf': 'full-line', - \ 's:matchtabs': 'first-non-tab', - \ 's:matchtabe': 'until-last-tab', - \ } - retu matchmodes[s:mfunc] -endf -" Cache {{{2 -fu! s:writecache(cafile) - if ( g:ctrlp_newcache || !filereadable(a:cafile) ) && !s:nocache() - cal ctrlp#utils#writecache(g:ctrlp_allfiles) - let g:ctrlp_newcache = 0 - en -endf - -fu! s:nocache(...) - if !s:caching - retu 1 - elsei s:caching > 1 - if !( exists(s:ccex) && !{s:ccex} ) || has_key(s:ficounts, s:dyncwd) - retu get(s:ficounts, s:dyncwd, [0, 0])[0] < s:caching - elsei a:0 && filereadable(a:1) - retu len(ctrlp#utils#readfile(a:1)) < s:caching - en - retu 1 - en - retu 0 -endf - -fu! s:insertcache(str) - let [data, g:ctrlp_newcache, str] = [g:ctrlp_allfiles, 1, a:str] - if data == [] || strlen(str) <= strlen(data[0]) - let pos = 0 - elsei strlen(str) >= strlen(data[-1]) - let pos = len(data) - 1 - el - let pos = 0 - for each in data - if strlen(each) > strlen(str) | brea | en - let pos += 1 - endfo - en - cal insert(data, str, pos) - cal s:writecache(ctrlp#utils#cachefile()) -endf -" Extensions {{{2 -fu! s:mtype() - retu s:itemtype >= len(s:coretypes) ? s:getextvar('type') : 'path' -endf - -fu! s:execextvar(key) - if !empty(g:ctrlp_ext_vars) - cal map(filter(copy(g:ctrlp_ext_vars), - \ 'has_key(v:val, a:key)'), 'eval(v:val[a:key])') - en -endf - -fu! s:getextvar(key) - if s:itemtype >= len(s:coretypes) && len(g:ctrlp_ext_vars) > 0 - let vars = g:ctrlp_ext_vars[s:itemtype - len(s:coretypes)] - retu has_key(vars, a:key) ? vars[a:key] : -1 - en - retu get(g:, 'ctrlp_' . s:matchtype . '_' . a:key, -1) -endf - -fu! ctrlp#getcline() - let [linenr, offset] = [line('.'), ( s:offset > 0 ? s:offset : 0 )] - retu !empty(s:lines) && !( offset && linenr <= offset ) - \ ? s:lines[linenr - 1 - offset] : '' -endf - -fu! ctrlp#getmarkedlist() - retu exists('s:marked') ? values(s:marked) : [] -endf - -fu! ctrlp#clearmarkedlist() - let s:marked = {} -endf - -fu! ctrlp#exit() - cal s:PrtExit() -endf - -fu! ctrlp#prtclear() - cal s:PrtClear() -endf - -fu! ctrlp#switchtype(id) - cal s:ToggleType(a:id - s:itemtype) -endf - -fu! ctrlp#nosy() - retu !( has('syntax') && exists('g:syntax_on') ) -endf - -fu! ctrlp#hicheck(grp, defgrp) - if !hlexists(a:grp) - exe 'hi link' a:grp a:defgrp - en -endf - -fu! ctrlp#call(func, ...) - retu call(a:func, a:000) -endf - -fu! ctrlp#getvar(var) - retu {a:var} -endf -"}}}1 -" * Initialization {{{1 -fu! ctrlp#setlines(...) - if a:0 | let s:itemtype = a:1 | en - cal s:modevar() - let inits = {'fil': 'ctrlp#files()', 'buf': 'ctrlp#buffers()', 'mru': 'ctrlp#mrufiles#list()'} - let types = map(copy(g:ctrlp_types), 'inits[v:val]') - if !empty(g:ctrlp_ext_vars) - cal map(copy(g:ctrlp_ext_vars), 'add(types, v:val["init"])') - en - let g:ctrlp_lines = eval(types[s:itemtype]) -endf - -" Returns [lname, sname] -fu! s:CurTypeName() - if s:itemtype < len(s:coretypes) - return filter(copy(s:coretypes), 'v:val[1]==g:ctrlp_types[s:itemtype]')[0] - el - return [s:getextvar("lname"), s:getextvar('sname')] - en -endfu - -fu! s:ExitIfSingleCandidate() - if len(s:Update(s:prompt[0])) == 1 - call s:AcceptSelection('e') - call ctrlp#exit() - return 1 - en - return 0 -endfu - -fu! ctrlp#init(type, ...) - if exists('s:init') || s:iscmdwin() | retu | en - let [s:ermsg, v:errmsg] = [v:errmsg, ''] - let [s:matches, s:init] = [1, 1] - cal s:Reset(a:0 ? a:1 : {}) - noa cal s:Open() - cal s:SetWD(a:0 ? a:1 : {}) - cal s:MapNorms() - cal s:MapSpecs() - if empty(g:ctrlp_types) && empty(g:ctrlp_ext_vars) - call ctrlp#exit() - retu - en - if type(a:type) == 0 - let type = a:type - el - let type = index(g:ctrlp_types, a:type) - if type == -1 - call ctrlp#exit() - retu - en - en - cal ctrlp#setlines(s:settype(type)) - cal ctrlp#syntax() - cal s:SetDefTxt() - let curName = s:CurTypeName() - let shouldExitSingle = index(s:opensingle, curName[0])>=0 || index(s:opensingle, curName[1])>=0 - if shouldExitSingle && s:ExitIfSingleCandidate() - return 0 - en - cal s:BuildPrompt(1) - if s:keyloop | cal s:KeyLoop() | en - return 1 -endf -" - Autocmds {{{1 -if has('autocmd') - aug CtrlPAug - au! - au BufEnter ControlP cal s:checkbuf() - au BufLeave ControlP noa cal s:Close() - au VimLeavePre * cal s:leavepre() - aug END -en - -fu! s:autocmds() - if !has('autocmd') | retu | en - if exists('#CtrlPLazy') - au! CtrlPLazy - en - if s:lazy - aug CtrlPLazy - au! - au CursorHold ControlP cal s:ForceUpdate() - aug END - en -endf -"}}} - -" vim:fen:fdm=marker:fmr={{{,}}}:fdl=0:fdc=1:ts=2:sw=2:sts=2 diff --git a/pack/acp/start/ctrlp.vim/autoload/ctrlp/autoignore.vim b/pack/acp/start/ctrlp.vim/autoload/ctrlp/autoignore.vim deleted file mode 100644 index ec2329e..0000000 --- a/pack/acp/start/ctrlp.vim/autoload/ctrlp/autoignore.vim +++ /dev/null @@ -1,173 +0,0 @@ -" ============================================================================= -" File: autoload/ctrlp/autoignore.vim -" Description: Auto-ignore Extension -" Author: Ludovic Chabant -" ============================================================================= - - -" Global Settings {{{ - -if exists('g:ctrlp_autoignore_loaded') && g:ctrlp_autoignore_loaded - \ && !g:ctrlp_autoignore_debug - finish -endif -let g:ctrlp_autoignore_loaded = 1 - -if !exists('g:ctrlp_autoignore_debug') - let g:ctrlp_autoignore_debug = 0 -endif - -if !exists('g:ctrlp_autoignore_trace') - let g:ctrlp_autoignore_trace = 0 -endif - -" }}} - -" Initialization {{{ - -if !exists('g:ctrlp_custom_ignore') - let g:ctrlp_custom_ignore = {} -endif -let g:ctrlp_custom_ignore['func'] = 'ctrlp#autoignore#ignore' -let g:ctrlp_custom_ignore['func-init'] = 'ctrlp#autoignore#ignore_init' -let g:ctrlp_custom_ignore['func-close'] = 'ctrlp#autoignore#ignore_close' - -if !exists('g:ctrlp_root_markers') - let g:ctrlp_root_markers = [] -endif -call add(g:ctrlp_root_markers, '.ctrlpignore') - -" }}} - -" Internals {{{ - -function! s:trace(message) abort - if g:ctrlp_autoignore_trace - echom "ctrlp_autoignore: " . a:message - endif -endfunction - -let s:proj_cache = {} -let s:active_cwd = '' -let s:active_cwd_len = 0 -let s:active_patterns = [] -let s:changed_wildignore = 0 -let s:prev_wildignore = '' - -function! s:load_project_patterns(root_dir) abort - let l:ign_path = a:root_dir . '/.ctrlpignore' - if !filereadable(l:ign_path) - call s:trace("No pattern file at: " . l:ign_path) - return [] - endif - let l:cursyntax = 'regexp' - let l:knownsyntaxes = ['regexp', 'wildignore'] - let l:patterns = [] - let l:lines = readfile(l:ign_path) - for line in l:lines - " Comment line? - if match(line, '\v^\s*$') >= 0 || match(line, '\v^\s*#') >= 0 - continue - endif - " Syntax change? - let l:matches = matchlist(line, '\v^syntax:\s?(\w+)\s*$') - if len(l:matches) > 0 - let l:cursyntax = l:matches[1] - if index(l:knownsyntaxes, l:cursyntax) < 0 - echoerr "ctrlp_autoignore: Unknown syntax '".l:cursyntax."' in: ".l:ign_path - endif - continue - endif - " Patterns! - let l:matches = matchlist(line, '\v^((dir|file|link)\:)?(.*)') - let l:mtype = l:matches[2] - let l:mpat = l:matches[3] - call add(l:patterns, {'syn': l:cursyntax, 'type': l:mtype, 'pat': l:mpat}) - endfor - call s:trace("Loaded " . len(l:patterns) . " patterns from: " . l:ign_path) - return l:patterns -endfunction - -function! s:get_project_patterns(root_dir) abort - let l:ign_path = a:root_dir . '/.ctrlpignore' - let l:ign_mtime = getftime(l:ign_path) - let l:patterns = get(s:proj_cache, a:root_dir) - if type(l:patterns) == type({}) - " Check that these patterns are still valid. - if l:ign_mtime < 0 - " File got deleted! :( - let l:patterns['pats'] = [] - return l:patterns['pats'] - elseif l:ign_mtime <= l:patterns['mtime'] - " File hasn't changed! :) - return l:patterns['pats'] - endif - endif - - call s:trace("Loading patterns for project: " . a:root_dir) - let l:loaded = s:load_project_patterns(a:root_dir) - let s:proj_cache[a:root_dir] = { - \'mtime': localtime(), - \'pats': l:loaded} - return l:loaded -endfunction - -" The custom ignore function that CtrlP will be using in addition to -" normal pattern-based matching. -function! ctrlp#autoignore#ignore(item, type) abort - let l:cnv_item = tr(strpart(a:item, s:active_cwd_len), "\\", "/") - for pat in s:active_patterns - if pat['syn'] != 'regexp' - continue - endif - if pat['type'] == '' || pat['type'] == a:type - if match(l:cnv_item, pat['pat']) >= 0 - call s:trace("Ignoring ".l:cnv_item." because of ".pat['pat']) - return 1 - endif - endif - endfor - return 0 -endfunction - -function! ctrlp#autoignore#ignore_init() abort - let l:root = getcwd() - let s:active_cwd = l:root - " len+1 is for including the next separator after the root. - let s:active_cwd_len = len(l:root) + 1 - let s:active_patterns = s:get_project_patterns(l:root) - call s:trace("Got ".len(s:active_patterns)." patterns for ".l:root) - - let s:changed_wildignore = 0 - let s:prev_wildignore = &wildignore - for pat in s:active_patterns - if pat['syn'] == 'wildignore' - execute 'set wildignore+='.pat['pat'] - let s:changed_wildignore = 1 - endif - endfor - if s:changed_wildignore - call s:trace("Set wildignore to ".&wildignore) - endif -endfunction - -function! ctrlp#autoignore#ignore_close() abort - if s:changed_wildignore - execute 'set wildignore='.s:prev_wildignore - let s:prev_wildignore = '' - call s:trace("Set wildignore back to ".&wildignore) - endif -endfunction - -" List patterns for a given project's root. -function! ctrlp#autoignore#get_patterns(root_dir) abort - let l:patterns = s:get_project_patterns(a:root_dir) - for pat in l:patterns - let l:prefix = pat['type'] == '' ? '(all)' : pat['type'] - echom l:prefix . ':' . pat['pat'] - endfor -endfunction - -" }}} - -" vim:fen:fdm=marker:fmr={{{,}}}:fdl=0:fdc=1:ts=2:sw=2:sts=2 diff --git a/pack/acp/start/ctrlp.vim/autoload/ctrlp/bookmarkdir.vim b/pack/acp/start/ctrlp.vim/autoload/ctrlp/bookmarkdir.vim deleted file mode 100644 index f7fc14d..0000000 --- a/pack/acp/start/ctrlp.vim/autoload/ctrlp/bookmarkdir.vim +++ /dev/null @@ -1,147 +0,0 @@ -" ============================================================================= -" File: autoload/ctrlp/bookmarkdir.vim -" Description: Bookmarked directories extension -" Author: Kien Nguyen -" ============================================================================= - -" 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(bang, dir, ...) - let ctrlp_tilde_homedir = get(g:, 'ctrlp_tilde_homedir', 0) - let cwd = fnamemodify(getcwd(), ctrlp_tilde_homedir ? ':p:~' : ':p') - let dir = fnamemodify(a:dir, ctrlp_tilde_homedir ? ':p:~' : ':p') - if a:bang == '!' - let cwd = dir != '' ? dir : cwd - let name = a:0 && a:1 != '' ? a:1 : cwd - el - let str = 'Directory to bookmark: ' - let cwd = dir != '' ? dir : s:getinput(str, cwd, 'dir') - if cwd == '' | retu | en - let name = a:0 && a:1 != '' ? a:1 : s:getinput('Bookmark as: ', cwd) - if name == '' | retu | en - 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 diff --git a/pack/acp/start/ctrlp.vim/autoload/ctrlp/buffertag.vim b/pack/acp/start/ctrlp.vim/autoload/ctrlp/buffertag.vim deleted file mode 100644 index 7894f3f..0000000 --- a/pack/acp/start/ctrlp.vim/autoload/ctrlp/buffertag.vim +++ /dev/null @@ -1,277 +0,0 @@ -" ============================================================================= -" File: autoload/ctrlp/buffertag.vim -" Description: Buffer Tag extension -" Maintainer: Kien Nguyen -" 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 = { - \ 'ant' : '%sant%sant%spt', - \ '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', - \ 'delphi' : '%spascal%spascal%sfp', - \ 'dosbatch': '%sdosbatch%sdosbatch%slv', - \ 'eiffel' : '%seiffel%seiffel%scf', - \ 'erlang' : '%serlang%serlang%sdrmf', - \ 'expect' : '%stcl%stcl%scfp', - \ 'fortran': '%sfortran%sfortran%spbceiklmntvfs', - \ 'go' : '%sgo%sgo%sfctv', - \ 'html' : '%shtml%shtml%saf', - \ 'java' : '%sjava%sjava%spcifm', - \ 'javascript': '%sjavascript%sjavascript%sf', - \ 'lisp' : '%slisp%slisp%sf', - \ 'lua' : '%slua%slua%sf', - \ 'make' : '%smake%smake%sm', - \ 'matlab' : '%smatlab%smatlab%sf', - \ 'ocaml' : '%socaml%socaml%scmMvtfCre', - \ 'pascal' : '%spascal%spascal%sfp', - \ 'perl' : '%sperl%sperl%sclps', - \ 'php' : '%sphp%sphp%scdvf', - \ 'python' : '%spython%spython%scmf', - \ 'rexx' : '%srexx%srexx%ss', - \ 'ruby' : '%sruby%sruby%scfFm', - \ 'rust' : '%srust%srust%sfTgsmctid', - \ 'scheme' : '%sscheme%sscheme%ssf', - \ 'sh' : '%ssh%ssh%sf', - \ 'csh' : '%ssh%ssh%sf', - \ 'zsh' : '%ssh%ssh%sf', - \ 'scala' : '%sscala%sscala%sctTmlp', - \ 'slang' : '%sslang%sslang%snf', - \ 'sml' : '%ssml%ssml%secsrtvf', - \ 'sql' : '%ssql%ssql%scFPrstTvfp', - \ 'tex' : '%stex%stex%sipcsubPGl', - \ 'tcl' : '%stcl%stcl%scfmp', - \ 'vera' : '%svera%svera%scdefgmpPtTvx', - \ 'verilog': '%sverilog%sverilog%smcPertwpvf', - \ 'vhdl' : '%svhdl%svhdl%sPctTrefp', - \ '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 --extra= ', 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) : '' - if (has('win32') || has('win64')) - let cmd = a:bin.' '.a:args.' '.fname - else - let cmd = shellescape(a:bin).' '.a:args.' '.fname - endif - 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, 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:btmode = 0 - let bname = a:1 =~# '^%$\|^#\d*$' ? expand(a:1) : a:1 - let s:bufname = fnamemodify(bname, ':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 diff --git a/pack/acp/start/ctrlp.vim/autoload/ctrlp/changes.vim b/pack/acp/start/ctrlp.vim/autoload/ctrlp/changes.vim deleted file mode 100644 index 313d8c2..0000000 --- a/pack/acp/start/ctrlp.vim/autoload/ctrlp/changes.vim +++ /dev/null @@ -1,98 +0,0 @@ -" ============================================================================= -" File: autoload/ctrlp/changes.vim -" Description: Change list extension -" Author: Kien Nguyen -" ============================================================================= - -" 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 bname = bufname(each) - let fnamet = fnamemodify(bname == '' ? '[No Name]' : bname, ':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, 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:clmode = 0 - let bname = a:1 =~# '^%$\|^#\d*$' ? expand(a:1) : a:1 - let s:bufnr = bufnr('^'.fnamemodify(bname, ':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 diff --git a/pack/acp/start/ctrlp.vim/autoload/ctrlp/dir.vim b/pack/acp/start/ctrlp.vim/autoload/ctrlp/dir.vim deleted file mode 100644 index 4e6d4ad..0000000 --- a/pack/acp/start/ctrlp.vim/autoload/ctrlp/dir.vim +++ /dev/null @@ -1,95 +0,0 @@ -" ============================================================================= -" File: autoload/ctrlp/dir.vim -" Description: Directory extension -" Author: Kien Nguyen -" ============================================================================= - -" 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, []] - if !ctrlp#igncwd(s:cwd) - cal s:globdirs(ctrlp#utils#fnesc(s:cwd, 'g', ','), 0) - en - 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#call('s:lash', s:cwd).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 diff --git a/pack/acp/start/ctrlp.vim/autoload/ctrlp/line.vim b/pack/acp/start/ctrlp.vim/autoload/ctrlp/line.vim deleted file mode 100644 index 5bec47e..0000000 --- a/pack/acp/start/ctrlp.vim/autoload/ctrlp/line.vim +++ /dev/null @@ -1,72 +0,0 @@ -" ============================================================================= -" File: autoload/ctrlp/line.vim -" Description: Line extension -" Author: Kien Nguyen -" ============================================================================= - -" 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(s:crbufnr)', - \ '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(bufnr) - let [lines, bufnr] = [[], exists('s:bufnr') ? s:bufnr : a:bufnr] - let bufs = exists('s:lnmode') && s:lnmode ? ctrlp#buffers('id') : [bufnr] - for bufnr in bufs - let [lfb, bufn] = [getbufline(bufnr, 1, '$'), bufname(bufnr)] - if lfb == [] && bufn != '' - let lfb = ctrlp#utils#readfile(fnamemodify(bufn, ':p')) - en - cal map(lfb, 'tr(v:val, '' '', '' '')') - let [linenr, len_lfb] = [1, len(lfb)] - let buft = bufn == '' ? '[No Name]' : 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, bufnr, get(info, 2)) - en -endf - -fu! ctrlp#line#cmd(mode, ...) - let s:lnmode = a:mode - if a:0 && !empty(a:1) - let s:lnmode = 0 - let bname = a:1 =~# '^%$\|^#\d*$' ? expand(a:1) : a:1 - let s:bufnr = bufnr('^'.fnamemodify(bname, ':p').'$') - en - retu s:id -endf -"}}} - -" vim:fen:fdm=marker:fmr={{{,}}}:fdl=0:fdc=1:ts=2:sw=2:sts=2 diff --git a/pack/acp/start/ctrlp.vim/autoload/ctrlp/mixed.vim b/pack/acp/start/ctrlp.vim/autoload/ctrlp/mixed.vim deleted file mode 100644 index 74d904d..0000000 --- a/pack/acp/start/ctrlp.vim/autoload/ctrlp/mixed.vim +++ /dev/null @@ -1,88 +0,0 @@ -" ============================================================================= -" File: autoload/ctrlp/mixed.vim -" Description: Mixing Files + MRU + Buffers -" Author: Kien Nguyen -" ============================================================================= - -" 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 allbufs = map(ctrlp#buffers(), 'fnamemodify(v:val, ":p")') - let [bufs, ubufs] = [[], []] - for each in allbufs - cal add(filereadable(each) ? bufs : ubufs, each) - endfo - 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 - let mrufs += ubufs - 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 diff --git a/pack/acp/start/ctrlp.vim/autoload/ctrlp/mrufiles.vim b/pack/acp/start/ctrlp.vim/autoload/ctrlp/mrufiles.vim deleted file mode 100644 index 32473da..0000000 --- a/pack/acp/start/ctrlp.vim/autoload/ctrlp/mrufiles.vim +++ /dev/null @@ -1,158 +0,0 @@ -" ============================================================================= -" File: autoload/ctrlp/mrufiles.vim -" Description: Most Recently Used Files extension -" Author: Kien Nguyen -" ============================================================================= - -" Static variables {{{1 -let [s:mrbs, s:mrufs] = [[], []] -let s:mruf_map_string = '!stridx(v:val, cwd) ? strpart(v:val, idx) : v:val' - -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], - \ 'map_string': ['g:ctrlp_mruf_map_string', s:mruf_map_string], - \ }] - 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 - if a:0 && a:1 == 'raw' | retu a:mrufs | 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, g:ctrlp_mruf_map_string) -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, get(g:, 'ctrlp_tilde_homedir', 0) ? ':p:~' : ':p') - let fn = exists('+ssl') ? tr(fn, '/', '\') : fn - let abs_fn = fnamemodify(fn,':p') - if ( !empty({s:in}) && fn !~# {s:in} ) || ( !empty({s:ex}) && fn =~# {s:ex} ) - \ || !empty(getbufvar('^' . abs_fn . '$', '&bt')) || !filereadable(abs_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:reformat(s:mergelists(), a:1) : 0 - \ : s:reformat(s:mergelists()) -endf - -fu! ctrlp#mrufiles#bufs() - retu s:mrbs -endf - -fu! ctrlp#mrufiles#tgrel() - let {s:re} = !{s:re} -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 BufWinEnter,BufWinLeave,BufWritePost * cal s:record(expand('', 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 diff --git a/pack/acp/start/ctrlp.vim/autoload/ctrlp/quickfix.vim b/pack/acp/start/ctrlp.vim/autoload/ctrlp/quickfix.vim deleted file mode 100644 index 03ab921..0000000 --- a/pack/acp/start/ctrlp.vim/autoload/ctrlp/quickfix.vim +++ /dev/null @@ -1,59 +0,0 @@ -" ============================================================================= -" File: autoload/ctrlp/quickfix.vim -" Description: Quickfix extension -" Author: Kien Nguyen -" ============================================================================= - -" 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 diff --git a/pack/acp/start/ctrlp.vim/autoload/ctrlp/rtscript.vim b/pack/acp/start/ctrlp.vim/autoload/ctrlp/rtscript.vim deleted file mode 100644 index eed21c6..0000000 --- a/pack/acp/start/ctrlp.vim/autoload/ctrlp/rtscript.vim +++ /dev/null @@ -1,59 +0,0 @@ -" ============================================================================= -" File: autoload/ctrlp/rtscript.vim -" Description: Runtime scripts extension -" Author: Kien Nguyen -" ============================================================================= - -" 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 diff --git a/pack/acp/start/ctrlp.vim/autoload/ctrlp/tag.vim b/pack/acp/start/ctrlp.vim/autoload/ctrlp/tag.vim deleted file mode 100644 index c229480..0000000 --- a/pack/acp/start/ctrlp.vim/autoload/ctrlp/tag.vim +++ /dev/null @@ -1,146 +0,0 @@ -" ============================================================================= -" File: autoload/ctrlp/tag.vim -" Description: Tag file extension -" Author: Kien Nguyen -" ============================================================================= - -" 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, tgaddr) - let [tg, ofname] = split(a:str, '\t\+\ze[^\t]\+$') - let tgs = taglist('^'.tg.'$') - if len(tgs) < 2 - retu [0, 0, 0, 0] - en - let bname = fnamemodify(bufname('%'), ':p') - let fname = expand(fnamemodify(simplify(ofname), ':s?^[.\/]\+??:p:.'), 1) - let [fnd, cnt, pos, ctgs, otgs] = [0, 0, 0, [], []] - for tgi in tgs - let lst = bname == fnamemodify(tgi["filename"], ':p') ? 'ctgs' : 'otgs' - cal call('add', [{lst}, tgi]) - endfo - let ntgs = ctgs + otgs - for tgi in ntgs - let cnt += 1 - let fulname = fnamemodify(tgi["filename"], ':p') - if stridx(fulname, fname) >= 0 - \ && strlen(fname) + stridx(fulname, fname) == strlen(fulname) - let fnd += 1 - let pos = cnt - en - endfo - let cnt = 0 - for tgi in ntgs - let cnt += 1 - if tgi["filename"] == ofname - if a:tgaddr != "" - if a:tgaddr == tgi["cmd"] - let [fnd, pos] = [0, cnt] - en - else - let [fnd, pos] = [0, cnt] - en - en - endfo - retu [1, fnd, pos, len(ctgs)] -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 tgaddr = matchstr(a:str, '^[^\t]\+\t\+[^\t]\+\t\zs[^\t]\{-1,}\ze\%(;"\)\?\t') - let str = matchstr(a:str, '^[^\t]\+\t\+[^\t]\+\ze\t') - let [tg, fdcnt] = [split(str, '^[^\t]\+\zs\t')[0], s:findcount(str, tgaddr)] - let cmds = { - \ 't': ['tab sp', 'tab stj'], - \ 'h': ['sp', 'stj'], - \ 'v': ['vs', 'vert stj'], - \ 'e': ['', 'tj'], - \ } - let utg = fdcnt[3] < 2 && fdcnt[0] == 1 && fdcnt[1] == 1 - let cmd = !fdcnt[0] || utg ? 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 !fdcnt[0] || utg - if cmd != '' - exe cmd - en - let save_cst = &cst - set cst& - cal feedkeys(":".( utg ? fdcnt[2] : "" )."ta ".tg."\r", 'nt') - let &cst = save_cst - el - let ext = "" - if fdcnt[1] < 2 && fdcnt[2] - let [sav_more, &more] = [&more, 0] - let ext = fdcnt[2]."\r".":let &more = ".sav_more."\r" - en - cal feedkeys(":".cmd." ".tg."\r".ext, 'nt') - en - cal feedkeys('zvzz', 'nt') - cal ctrlp#setlcdir() -endf - -fu! ctrlp#tag#id() - retu s:id -endf - -fu! ctrlp#tag#enter() - let tfs = get(g:, 'ctrlp_custom_tag_files', tagfiles()) - let s:tagfiles = type(tfs) == 3 && 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 diff --git a/pack/acp/start/ctrlp.vim/autoload/ctrlp/undo.vim b/pack/acp/start/ctrlp.vim/autoload/ctrlp/undo.vim deleted file mode 100644 index dee705e..0000000 --- a/pack/acp/start/ctrlp.vim/autoload/ctrlp/undo.vim +++ /dev/null @@ -1,154 +0,0 @@ -" ============================================================================= -" File: autoload/ctrlp/undo.vim -" Description: Undo extension -" Author: Kien Nguyen -" ============================================================================= - -" 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 diff --git a/pack/acp/start/ctrlp.vim/autoload/ctrlp/utils.vim b/pack/acp/start/ctrlp.vim/autoload/ctrlp/utils.vim deleted file mode 100644 index 91b9f24..0000000 --- a/pack/acp/start/ctrlp.vim/autoload/ctrlp/utils.vim +++ /dev/null @@ -1,110 +0,0 @@ -" ============================================================================= -" File: autoload/ctrlp/utils.vim -" Description: Utilities -" Author: Kien Nguyen -" ============================================================================= - -" 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 -"}}} - -" vim:fen:fdm=marker:fmr={{{,}}}:fdl=0:fdc=1:ts=2:sw=2:sts=2 diff --git a/pack/acp/start/ctrlp.vim/doc/ctrlp.cnx b/pack/acp/start/ctrlp.vim/doc/ctrlp.cnx deleted file mode 100644 index c2d6972..0000000 --- a/pack/acp/start/ctrlp.vim/doc/ctrlp.cnx +++ /dev/null @@ -1,1571 +0,0 @@ -*ctrlp.txt* 模糊的 文件, 缓冲区, 最近最多使用, 标签, ... 检索. v1.79 -*CtrlP* *ControlP* *'ctrlp'* *'ctrl-p'* -=============================================================================== -# # -# :::::::: ::::::::::: ::::::::: ::: ::::::::: # -# :+: :+: :+: :+: :+: :+: :+: :+: # -# +:+ +:+ +:+ +:+ +:+ +:+ +:+ # -# +#+ +#+ +#++:++#: +#+ +#++:++#+ # -# +#+ +#+ +#+ +#+ +#+ +#+ # -# #+# #+# #+# #+# #+# #+# #+# # -# ######## ### ### ### ########## ### # -# # -=============================================================================== -名词对照(译注) - - buffer:缓冲区 mapping:按键绑定 - mru:最近最多使用 prompt:提示符面板 - tag:标签 tab:页签 - tab:制表符 - -=============================================================================== -内容 *ctrlp-content* - - 1. 介绍.............................................|ctrlp-intro| - 2. 选项.............................................|ctrlp-options| - 3. 命令.............................................|ctrlp-commands| - 4. 按键绑定.........................................|ctrlp-mappings| - 5. 输入格式.........................................|ctrlp-input-formats| - 6. 扩展.............................................|ctrlp-extensions| - -=============================================================================== -介绍 *ctrlp-intro* - -带有直观接口的全路径模糊文件, 缓冲区, 最近最多使用, 标签, ... 检索。 -使用纯净的Vimscript编写,可以运行在MacVim,gVim和版本号7.0以上的Vim中。 -全面支持Vim的正则表达式 |regexp| 作为搜索模式,内建最近最多使用文件监测, -项目根目录定位和更多特性。 - -开启可选的扩展(标记,目录,rtscript...),参考 |ctrlp-extensions| 。 - -=============================================================================== -OPTIONS *ctrlp-options* - -总览:~ - - |loaded_ctrlp|................禁用插件。 - |ctrlp_map|...................默认按键绑定。 - |ctrlp_cmd|...................默认按键绑定调用的命令。 - |ctrlp_by_filename|...........是否默认开启文件名模式。 - |ctrlp_regexp|................是否默认开启正则表达式模式。 - |ctrlp_match_window|..........匹配窗口的显示位置。 - |ctrlp_switch_buffer|.........如果文件已在缓冲区中打开,跳转到该打开的缓冲区。 - |ctrlp_reuse_window|..........重用特殊窗口(帮助、快速修复 |quickfix| ,等等)。 - |ctrlp_tabpage_position|......新标签页出现的位置。 - |ctrlp_working_path_mode|.....如何设置CtrlP的本地工作目录。 - |ctrlp_root_markers|..........额外的,高优先级的根目录标识。 - |ctrlp_use_caching|...........针对每个会话,设置是否开启缓存的。 - |ctrlp_clear_cache_on_exit|...退出Vim后是否保留缓存。 - |ctrlp_cache_dir|.............缓存目录的位置。 - |ctrlp_show_hidden|...........是否显示隐藏文件和隐藏文件夹。 - |ctrlp_custom_ignore|.........使用 |globpath()| 时自定义忽略的文件或目录。 - |ctrlp_max_files|.............扫描文件的最大数目。 - |ctrlp_max_depth|.............扫描目录的最大层数。 - |ctrlp_user_command|..........使用外部的扫描工具。 - |ctrlp_max_history|...........历史提示符面板中保留的最大条目数。 - |ctrlp_open_new_file|.........由创建的文件的打开方式。 - |ctrlp_open_multiple_files|...由选择的文件的打开方式。 - |ctrlp_arg_map|...............是否拦截 命令。 - |ctrlp_follow_symlinks|.......是否跟随链接。 - |ctrlp_lazy_update|...........停止输入时才更新。 - |ctrlp_default_input|.........为提示符面板提供一个种子。 - |ctrlp_abbrev|................输入缩写。 - |ctrlp_key_loop|..............为多字节输入开启输入事件循环。 - |ctrlp_prompt_mappings|.......改变提示符面板内部的按键绑定。 - |ctrlp_line_prefix|...........ctrlp 窗口中为每一行添加前缀。 - |ctrlp_open_single_match|.....当只有一个候选时自动接受。 - |ctrlp_brief_prompt|..........提示符为空的时候使用退出 CtrlP。 - |ctrlp_match_current_file|....在匹配条目中包含当前文件。 - - 最近最多使用模式: - |ctrlp_mruf_max|..............记录的最近最多使用的最大数据。 - |ctrlp_mruf_exclude|..........需要被排除的文件。 - |ctrlp_mruf_include|..........需要被记录的文件。 - |ctrlp_mruf_relative|.........只显示在工作目录内的最近最多使用。 - |ctrlp_tilde_homedir|.........保存 home 目录中的 MRU 的目录路径为波浪扩展的形式 ~/。 - |ctrlp_mruf_default_order|....禁用排序。 - |ctrlp_mruf_case_sensitive|...最近最多使用文件是否大小写敏感。 - |ctrlp_mruf_save_on_update|...只要有一个新的条目添加,就保存到磁盘。 - - 缓冲模式: - |ctrlp_bufname_mod|...........文件名部分修饰符。 - |ctrlp_bufpath_mod|...........文件路径部分修饰符。 - - 缓冲标签模式: (开启此模式,参考 |ctrlp-extensions| ) - |g:ctrlp_buftag_ctags_bin|....兼容的ctags二进制程序的位置。 - |g:ctrlp_buftag_systemenc|....ctags命令的编码。 - |g:ctrlp_buftag_types|........添加新的文件类型和设置命令行参数。 - - 高级选项: - |ctrlp_open_func|.............使用自定义的打开文件的函数。 - |ctrlp_status_func|...........改变CtrlP的两个状态栏 - |ctrlp_buffer_func|...........在CtrlP的缓冲区内调用自定义的函数。 - |ctrlp_match_func|............替换内建的匹配算法。 - -------------------------------------------------------------------------------- -详细描述和默认值:~ - - *'g:ctrlp_map'* -使用该选项来改变普通模式 |Normal| 下调用CtrlP的按键绑定: > - let g:ctrlp_map = '' -< - - *'g:ctrlp_cmd'* - -设置当按下上面的按键绑定时,使用的默认打开命令: > - let g:ctrlp_cmd = 'CtrlP' -< - - *'g:loaded_ctrlp'* -使用该选项完全禁用插件: > - let g:loaded_ctrlp = 1 -< - - *'g:ctrlp_by_filename'* -修改该选项为1,设置默认为按文件名搜索(否则为全路径): > - let g:ctrlp_by_filename = 0 -< -在提示符面板内可以使用 来切换。 - - *'g:ctrlp_regexp'* -修改该选项为1,设置默认为使用正则表达式匹配。: > - let g:ctrlp_regexp = 0 -< -在提示符面板内可以使用 来切换。 - - *'g:ctrlp_match_window'* -改变匹配窗口的位置,结果的排列顺序,最小和最大高度: > - let g:ctrlp_match_window = '' -< -例子: > - let g:ctrlp_match_window = 'bottom,order:btt,min:1,max:10,results:10' -< -位置: (默认:底部) - top - 在屏幕顶部显示匹配窗口。 - bottom - 在屏幕底部显示匹配窗口。 - -结果的排列顺序: (默认: btt) - order:ttb - 从顶部到底部。 - order:btt - 从底部到顶部。 - -最小和最大高度: - min:{n} - 最少显示 {n} 行 (默认: 1). - max:{n} - 最多显示 {n} 行 (默认: 10). - -结果集的最大数目: - results:{n} - 列出最多 {n} 条结果 (默认: 和最大高度同步). - -注意: 当一个设置项没有被设置时,将会使用默认值。 - - *'g:ctrlp_switch_buffer'* -当尝试打开一个文件时,如果它已经在某个窗口被打开,CtrlP会尝试跳到那个窗口,而 -不是新打开一个实例。: > - let g:ctrlp_switch_buffer = 'Et' -< - e - 当 被按下时跳转,但是只跳转到当前页签内的窗口内。 - t - 当 被按下时跳转, 但是只跳转到其它标签的窗口内。 - v - 类似 "e", 但是当 被按下时跳转。 - h - 类似 "e", 但是当 被按下时跳转。 - E, T, V, H - 行为类似 "e", "t", "v", and "h", 但是跳转到任何地方的窗口中。 - 0 或者 - 禁用这项功能。 - - *'g:ctrlp_reuse_window'* -当使用 打开新文件时,CtrlP避免在插件,帮助,快速修复创建的窗口中打开该文 -件。使用该选项来设置一些例外: > - let g:ctrlp_reuse_window = 'netrw' -< -接受的值可以为特殊缓冲区的名字的一部分,文件类型或者缓冲区类型使用正则表达式来 -指定匹配模式。 -例子: > - let g:ctrlp_reuse_window = 'netrw\|help\|quickfix' -< - - *'g:ctrlp_tabpage_position'* -新打开页签的位置: > - let g:ctrlp_tabpage_position = 'ac' -< - a - 后面。 - b - 前面。 - c - 当前页签。 - l - 最后一个页签。 - f - 第一个页签。 - - *'g:ctrlp_working_path_mode'* -当启动时,CtrlP依据这个变量来设置它的工作目录: > - let g:ctrlp_working_path_mode = 'ra' -< - c - 当前文件所在的目录。 - a - 当前文件所在的目录,除非这个目录为当前工作目录的子目录 - r - 包含下列文件或者目录的最近的祖先目录: - .git .hg .svn .bzr _darcs - w - 用来修饰r:使用当前工作目录而不是当前文件所在目录进行查找 - 0 或者 - 禁用这项功能。 - -注意 #1: 如果 "a" 或者 "c" 和 "r"一起被包含,当无法找到根目录时使用 "a" 或者 -"c" 的行为(作为备选)。 - -注意 #2: 你可以在每个缓冲区内使用 |b:var| 来设置该选项。 - - *'g:ctrlp_root_markers'* -使用该选项来设置自定义的根目录标记作为对默认标记(.hg, .svn, .bzr, and _darcs) -的补充。自定义的标记具有优先权: > - let g:ctrlp_root_markers = [''] -< -注意: 你可以在每个缓冲区内使用 |b:var| 来设置该选项。 - - *'g:ctrlp_use_caching'* -启用/禁用每个会话的缓存: > - let g:ctrlp_use_caching = 1 -< - 0 - 禁用缓存。 - 1 - 启用缓存。 - n - 当大于1时,禁用缓存,使用该数值作为重新启用缓存的限制条件。 - -注意: 当在CtrlP中时你可以使用 来快速的清除缓存。 - - *'g:ctrlp_clear_cache_on_exit'* -设置该选项为0通过退出Vim时不删除缓存文件来启用跨会话的缓存: > - let g:ctrlp_clear_cache_on_exit = 1 -< - - *'g:ctrlp_cache_dir'* -设置存储缓存文件的目录: > - let g:ctrlp_cache_dir = $HOME.'/.cache/ctrlp' -< - - *'g:ctrlp_show_hidden'* -如果你想CtrlP扫描隐藏文件和目录,设置该选项为1: > - let g:ctrlp_show_hidden = 0 -< -注意: 当命令使用 |g:ctrlp_user_command| 定义时该选项无效。 - - *'ctrlp-wildignore'* -你可以使用Vim的 |'wildignore'| 来从结果集中排序文件或目录。 -例子: > - " 排除版本控制文件 - set wildignore+=*/.git/*,*/.hg/*,*/.svn/* " Linux/MacOSX - set wildignore+=*\\.git\\*,*\\.hg\\*,*\\.svn\\* " Windows ('noshellslash') -< -注意 #1: 每个目录设置前的字符 `*/` 是必须的。 - -注意 #2: |wildignore| 影响 |expand()| , |globpath()| 和 |glob()| 的结果,这些函数被很 -多插件用来在系统中执行查找。(例如和版本控制系统有关的插件在查找.git/、.hg/等, -一些其他插件用来在Windows上查找外部的*.exe工具),所以要修改 |wildignore| 时请先 -考虑清楚。 - - *'g:ctrlp_custom_ignore'* -作为对 |'wildignore'| 的补充,用来设置你只是想在CtrlP中隐藏的文件和目录。使用正 -则表达式来指定匹配模式: > - let g:ctrlp_custom_ignore = '' -< -例子: > - let g:ctrlp_custom_ignore = '\v[\/]\.(git|hg|svn)$' - let g:ctrlp_custom_ignore = { - \ 'dir': '\v[\/]\.(git|hg|svn)$', - \ 'file': '\v\.(exe|so|dll)$', - \ 'link': 'SOME_BAD_SYMBOLIC_LINKS', - \ } - let g:ctrlp_custom_ignore = { - \ 'file': '\v(\.cpp|\.h|\.hh|\.cxx)@ - let g:ctrlp_max_files = 10000 -< -注意: 当命令使用 |g:ctrlp_user_command| 定义时该选项无效。 - - *'g:ctrlp_max_depth'* -目录树递归的最大层数: > - let g:ctrlp_max_depth = 40 -< -注意: 当命令使用 |g:ctrlp_user_command| 定义时该选项无效。 - - *'g:ctrlp_user_command'* -指定用来代替Vim的 |globpath()| 的外部工具来列出文件,使用 %s 代表目标目录: > - let g:ctrlp_user_command = '' -< -例子: > - let g:ctrlp_user_command = 'find %s -type f' " MacOSX/Linux - let g:ctrlp_user_command = 'dir %s /-n /b /s /a-d' " Windows -< -你也可以使用 'grep', 'findstr' 或者其它东西来过滤结果集。 -例子: > - let g:ctrlp_user_command = - \ 'find %s -type f | grep -v -P "\.jpg$|/tmp/"' " MacOSX/Linux - let g:ctrlp_user_command = - \ 'dir %s /-n /b /s /a-d | findstr /v /l ".jpg \\tmp\\"' " Windows -< -在扫描一个大型项目时,在仓库目录中使用版本控制系统的列出命令会加快扫描速度: > - let g:ctrlp_user_command = [root_marker, listing_command, fallback_command] - let g:ctrlp_user_command = { - \ 'types': { - \ 1: [root_marker_1, listing_command_1], - \ n: [root_marker_n, listing_command_n], - \ }, - \ 'fallback': fallback_command, - \ 'ignore': 0 or 1 - \ } -< -一些例子: > - " 单个版本控制系统,列出命令不会列出没有被追踪的文件: - let g:ctrlp_user_command = ['.git', 'cd %s && git ls-files'] - let g:ctrlp_user_command = ['.hg', 'hg --cwd %s locate -I .'] - - " 多个版本控制系统: - let g:ctrlp_user_command = { - \ 'types': { - \ 1: ['.git', 'cd %s && git ls-files'], - \ 2: ['.hg', 'hg --cwd %s locate -I .'], - \ }, - \ 'fallback': 'find %s -type f' - \ } - - " 单个版本控制系统,列出命令列出没有被追踪的文件(较慢): - let g:ctrlp_user_command = - \ ['.git', 'cd %s && git ls-files -co --exclude-standard'] - - let g:ctrlp_user_command = - \ ['.hg', 'hg --cwd %s status -numac -I . $(hg root)'] " MacOSX/Linux - - let g:ctrlp_user_command = ['.hg', 'for /f "tokens=1" %%a in (''hg root'') ' - \ . 'do hg --cwd %s status -numac -I . %%a'] " Windows -< -注意 #1: 在 |Dictionary| 格式, 'fallback' 和 'ignore' 是可选的,在 |List| 格式, -备选命令是可选的。 - -注意 #2: 如果备选命令是空的或者属性 'fallback' 没有定义,当扫描仓库之外目录时, -|globpath()| 会被使用。 - -注意 #3: 除非使用了 |Dictionary| 格式并且 'ignore' 被定义并且设置为1,当这些自 -定义的命令被使用时 |wildignore| 和 |g:ctrlp_custom_ignore| 选项不会生效。没有出现 -时,'ignore' 被默认设置为0来保留使用外部命令的性能优势。 - -注意 #4: 当改变了选项的变量类型时,记得先 |:unlet| ,或者重启Vim来避免这个错误: -"E706: Variable type mismatch" 。 - -注意 #5: 你可以在每个缓冲区内使用 |b:var| 来设置该选项。 - - *'g:ctrlp_max_history'* -你希望CtrlP记录的用户输入历史的最大数目。默认值是Vim的全局选项 |'history'| : > - let g:ctrlp_max_history = &history -< -设置为0来禁用提示符面板的历史。使用 来浏览历史。 - - *'g:ctrlp_open_new_file'* -使用该选项指定当使用 打开新建的文件时,文件的打开方式: > - let g:ctrlp_open_new_file = 'v' -< - t - 在新页签中。 - h - 在新的水平分割窗口。 - v - 在新的竖直分割窗口。 - r - 在当前窗口。 - - *'g:ctrlp_open_multiple_files'* -如果非0, 会启用使用 打开多个文件: > - let g:ctrlp_open_multiple_files = 'v' -< -例子: > - let g:ctrlp_open_multiple_files = '2vjr' -< -对于数字: - - 如果指定,会被用来作为打开文件时创建的窗口或者页签的最大数量(剩余的会在隐 - 藏的缓冲区中打开)。 - - 如果没有指定, 会打开所有文件,每个在一个新的窗口或者页签中。 - -对于字母: - t - 每个文件在一个新页签中。 - h - 每个文件在一个新的水平分割窗口中。 - v - 每个文件在一个新的竖直分割窗口中。 - i - 所有的文件在隐藏的缓冲区中。 - j - 打开以后,跳转到第一个打开的页签或者窗口。 - r - 在当前窗口打开第一个文件,其他文件根据同时出现的"h","v"和"t"中的一个, - 在新的分割窗口或者页签中打开。 - - *'g:ctrlp_arg_map'* -当设置为1时, 会接收一个额外的键值作为参数,来覆盖默认行为: > - let g:ctrlp_arg_map = 0 -< -按下 或者 会提示一次按键。按键可以是: - t - 在新标签页中打开。 - h - 每个文件在一个新的水平分割窗口中。 - v - 每个文件在一个新的竖直分割窗口中。 - i - 所有的文件在隐藏的缓冲区中(只有 生效)。 - c - 清楚标记的文件(只有 生效)。 - r - 在当前窗口中打开(只有 生效)。 - , , - 取消并且回到提示符面板。 - - 使用 |g:ctrlp_open_new_file| 和 |g:ctrlp_open_multiple_files| 指定的默 - 认行为。 - - - *'g:ctrlp_follow_symlinks'* -如果非0,当列出文件时CtrlP会跟随链接: > - let g:ctrlp_follow_symlinks = 0 -< - 0 - 不要跟随链接。 - 1 - 跟随但是忽略内部循环的链接,避免重复。 - 2 - 无差别的跟随所有链接。 - -注意: 当命令使用 |g:ctrlp_user_command| 定义时该选项无效。 - - *'g:ctrlp_lazy_update'* -设置为1将开启延迟更新特性:只在输入停止一个确定的时间后才更新匹配窗口: > - let g:ctrlp_lazy_update = 0 -< -如果设置为1,在250毫秒后更新。如果大于1,数字会被作为延迟时间使用。 - - *'g:ctrlp_default_input'* -设置为1将为提示符面板提供当前文件的相对路径作为种子: > - let g:ctrlp_default_input = 0 -< -如果不指定1或0,如果选项的值是字符串,会被用来作为默认输入: > - let g:ctrlp_default_input = 'anystring' -< -这个选项可以和 |g:ctrlp_open_single_match| 配合使用。 - - - *'g:ctrlp_match_current_file'* -在匹配条目中包含当前文件: - let g:ctrlp_match_current_file = 1 - -默认情况下,当前文件不包含在列表中。 - -注意: 当使用 |g:ctrlp_match_func| 时不会应用这个选项。 - - - *'g:ctrlp_abbrev'* -定义可以在提示面包内被扩展(内部的或者可见的)的输入缩写: > - let g:ctrlp_abbrev = {} -< -例子: > - let g:ctrlp_abbrev = { - \ 'gmode': 'i', - \ 'abbrevs': [ - \ { - \ 'pattern': '^cd b', - \ 'expanded': '@cd ~/.vim/bundle', - \ 'mode': 'pfrz', - \ }, - \ { - \ 'pattern': '\(^@.\+\|\\\@ 创建新文件时(使用扩展后的字符串作为文件名)。 - c - 当使用 自动补全目录名时(在自动补全之前立即扩展模式)。 - 或者未定义 - 总是启用。 - -注意: 缩写条目按顺序求值,后求值的条目会覆盖先求值的条目;当 'gmode' 为"t"时, -包括他自己。 - - *'g:ctrlp_key_loop'* -一个实验性的特性。设置该选项为1将为多字节字符开启输入事件循环: > - let g:ctrlp_key_loop = 0 -< -注意 #1: 当设置时,该选项会重置 |g:ctrlp_lazy_update| 选项。 - -注意 #2: 你可以在提示符面板使用自定义的按键绑定切换这个特性: > - let g:ctrlp_prompt_mappings = { 'ToggleKeyLoop()': [''] } -< - - *'g:ctrlp_prompt_mappings'* -使用该选项来自定义CtrlP的提示窗口内的按键绑定为你喜欢的方式。你只需要保留你改 -变值(在[]内部)的行: > - let g:ctrlp_prompt_mappings = { - \ 'PrtBS()': ['', ''], - \ 'PrtDelete()': [''], - \ 'PrtDeleteWord()': [''], - \ 'PrtClear()': [''], - \ 'PrtSelectMove("j")': ['', ''], - \ 'PrtSelectMove("k")': ['', ''], - \ 'PrtSelectMove("t")': ['', ''], - \ 'PrtSelectMove("b")': ['', ''], - \ 'PrtSelectMove("u")': ['', ''], - \ 'PrtSelectMove("d")': ['', ''], - \ 'PrtHistory(-1)': [''], - \ 'PrtHistory(1)': [''], - \ 'AcceptSelection("e")': ['', '<2-LeftMouse>'], - \ 'AcceptSelection("h")': ['', '', ''], - \ 'AcceptSelection("t")': [''], - \ 'AcceptSelection("v")': ['', ''], - \ 'ToggleFocus()': [''], - \ 'ToggleRegex()': [''], - \ 'ToggleByFname()': [''], - \ 'ToggleType(1)': ['', ''], - \ 'ToggleType(-1)': ['', ''], - \ 'PrtExpandDir()': [''], - \ 'PrtInsert("c")': ['', ''], - \ 'PrtInsert()': [''], - \ 'PrtCurStart()': [''], - \ 'PrtCurEnd()': [''], - \ 'PrtCurLeft()': ['', '', ''], - \ 'PrtCurRight()': ['', ''], - \ 'PrtClearCache()': [''], - \ 'PrtDeleteEnt()': [''], - \ 'CreateNewFile()': [''], - \ 'MarkToOpen()': [''], - \ 'OpenMulti()': [''], - \ 'PrtExit()': ['', '', ''], - \ } -< -注意: 如果按 后光标向左移动一个字符而不是删除一个字符,在你的.vimrc中添加 -下面的设置来禁用插件默认的 绑定: > - let g:ctrlp_prompt_mappings = { 'PrtCurLeft()': ['', ''] } -< - - *'g:ctrlp_line_prefix'* -这个前缀会被加到ctrlp的条目列表中每一行的前面。 -默认值: > - let g:ctrlp_line_prefix = '> ' -< - - *'g:ctrlp_open_single_match'* -当CtrlP处于列表中配置的模式中时,如果只有一个候选条目,CtrlP会直接接受该条目。 -例子: > - let g:ctrlp_open_single_match = ['buffer tags', 'buffer'] -< -目前这个选项的作用是和 |g:ctrlp_default_input| 一起,使用类似下面的函数,在使用 -前设置,使用完后还原: > - fu! tagsUnderCursor() - try - let default_input_save = get(g:, 'ctrlp_default_input', '') - let g:ctrlp_default_input = expand('') - CtrlPBufTagAll - finally - if exists('default_input_save') - let g:ctrlp_default_input = default_input_save - endif - endtry - endfu -> -< ----------------------------------------- -MRU mode options:~ - - *'g:ctrlp_mruf_max'* -指定你希望CtrlP记录的最近打开的文件历史的数目: > - let g:ctrlp_mruf_max = 250 -< - - *'g:ctrlp_mruf_exclude'* -你不希望CtrlP记录的文件。使用正则表达式来指定模式: > - let g:ctrlp_mruf_exclude = '' -< -例子: > - let g:ctrlp_mruf_exclude = '/tmp/.*\|/temp/.*' " MacOSX/Linux - let g:ctrlp_mruf_exclude = '^C:\\dev\\tmp\\.*' " Windows -< - - *'g:ctrlp_mruf_include'* -如果你想让CtrlP只记录某些文件,在这里指定: > - let g:ctrlp_mruf_include = '' -< -例子: > - let g:ctrlp_mruf_include = '\.py$\|\.rb$' -< - *'g:ctrlp_tilde_homedir'* -将这个选项设置为1来把所有的 MRU 文件路径中 $HOME 目录下的 $HOME/$filepath 保存 -为 ~/$filepath ,而不是 $HOME/$filepath : > - let g:ctrlp_tilde_homedir = 0 -< -注意: 对所有通过 :CtrlPBookmarkDirAdd! 保存的也有效 - - *'g:ctrlp_mruf_relative'* -设置该选项为1将只显示在当前工作目录内的最近最多使用文件: > - let g:ctrlp_mruf_relative = 0 -< -注意: 你可以在提示符面板使用自定义的按键绑定切换这个特性: > - let g:ctrlp_prompt_mappings = { 'ToggleMRURelative()': [''] } -< - - *'g:ctrlp_mruf_default_order'* -设置该选项为1将在最近最多使用模式搜索时禁用排序: > - let g:ctrlp_mruf_default_order = 0 -< - - *'g:ctrlp_mruf_case_sensitive'* -将该选项和你的文件系统大小写敏感性保持一致来避免重复的最近最多使用条目: > - let g:ctrlp_mruf_case_sensitive = 1 -< - - *'g:ctrlp_mruf_save_on_update'* -设置该选项为 0 禁止 CtrlP 每当有一个新条目增加就把最近最多使用列表保存到磁盘 -文件,而是在退出Vim时才保存: > - let g:ctrlp_mruf_save_on_update = 1 -< - *'g:ctrlp_bufname_mod'* -根据修饰符修改文件名部分。参见 |filename-modifiers| 。 > - let g:ctrlp_bufname_mod = ':t' -< - *'g:ctrlp_bufpath_mod'* -根据修饰符修改文件路径部分。参见 |filename-modifiers| 。 > - let g:ctrlp_bufpath_mod = ':~:.:h' -< ----------------------------------------- -高级选项:~ - - *'g:ctrlp_open_func'* -使用一个自定义函数来打开选定的文件: > - let g:ctrlp_open_func = {} -< -例子: > - let g:ctrlp_open_func = { - \ 'files' : 'Function_Name_1', - \ 'buffers' : 'Function_Name_2', - \ 'mru files' : 'Function_Name_3', - \ } -< -函数结构: > - function! Function_Name(action, line) - " 参数: - " | - " +- a:action : 打开的动作: - " | + 'e' : 用户按下 (默认) - " | + 'h' : 用户按下 (默认) - " | + 'v' : 用户按下 (默认) - " | + 't' : 用户按下 (默认) - " | + 'x' : 用户使用 终端对话框 (默认) 选择"e[x]ternal"。 - " | - " +- a:line : 选择的文件。 - - endfunction -< -注意: 当使用打开多个文件时无效。 - -例子: 当 被按下时在默认浏览器中打开HTML文件,否则在Vim中打开 > - function! HTMLOpenFunc(action, line) - if a:action =~ '^[tx]$' && fnamemodify(a:line, ':e') =~? '^html\?$' - - " 获取文件名 - let filename = fnameescape(fnamemodify(a:line, ':p')) - - " 关闭CtrlP - call ctrlp#exit() - - " 打开文件 - silent! execute '!xdg-open' filename - - elseif a:action == 'x' && fnamemodify(a:line, ':e') !~? '^html\?$' - - " 不是HTML文件,再次模拟 按键并且等待新的输入 - call feedkeys("\") - - else - - " 使用CtrlP的默认的打开文件的函数 - call call('ctrlp#acceptfile', [a:action, a:line]) - - endif - endfunction - - let g:ctrlp_open_func = { 'files': 'HTMLOpenFunc' } -< - - *'g:ctrlp_status_func'* -为CtrlP窗口使用自定义的状态栏: > - let g:ctrlp_status_func = {} -< -例子: > - let g:ctrlp_status_func = { - \ 'main': 'Function_Name_1', - \ 'prog': 'Function_Name_2', - \ } -< -函数结构: > - " 主状态栏 - function! Function_Name_1(focus, byfname, regex, prev, item, next, marked) - " 参数: - " | - " +- a:focus : 提示符面板的焦点: "prt" 或者 "win"。 - " | - " +- a:byfname : 在文件名模式还是全路径模式: "file" 或者 "path"。 - " | - " +- a:regex : 是否在正则表达式模式: 1 or 0。 - " | - " +- a:prev : 前一个搜索模式。 - " | - " +- a:item : 当前的搜索模式。 - " | - " +- a:next : 下一个搜索模式。 - " | - " +- a:marked : 被标记文件的数目,或者一个逗号分隔的被标记的文件名列表。 - - return full_statusline - endfunction - - " 状态栏进度条 - function! Function_Name_2(str) - " a:str : 一个当前已扫描的文件数,或者一个当前扫描目录和用户命令的字符串。 - - return full_statusline - endfunction -< -一个可用的例子,参见 https://gist.github.com/1610859 。 - - *'g:ctrlp_buffer_func'* -指定一个会在启动或者退出CtrlP缓冲区时被调用的函数: > - let g:ctrlp_buffer_func = {} -< -例子: > - let g:ctrlp_buffer_func = { - \ 'enter': 'Function_Name_1', - \ 'exit': 'Function_Name_2', - \ } -< - - *'g:ctrlp_match_func'* -为CtrlP设置一个额外的模糊匹配函数: > - let g:ctrlp_match_func = {} -< -例子: > - let g:ctrlp_match_func = { 'match': 'Function_Name' } -< -函数结构: > - function! Function_Name(items, str, limit, mmode, ispath, crfile, regex) - " 参数: - " | - " +- a:items : 搜索条目的全列表。 - " | - " +- a:str : 用户输入的字符串。 - " | - " +- a:limit : 匹配窗口的最大高度。可以用来限制返回的条目数量。 - " | - " +- a:mmode : 在匹配模式。可以是下列字符串之一: - " | + "full-line": 匹配整行。 - " | + "filename-only": 只匹配文件名。 - " | + "first-non-tab": 匹配到第一个制表符。 - " | + "until-last-tab": 匹配到最后一个制表符。 - " | - " +- a:ispath : 搜索文件,缓冲区,最近最多使用,混合,目录和rtscript模. - " | 式时为1。其它为0。 - " | - " +- a:crfile : 当前窗口中的文件。当a:ispath为1时应该被搜索结果排除在外 - " | - " +- a:regex : 是否在正则表达式模式: 1 or 0. - - return list_of_matched_items - endfunction -< - -注意: 你可以通过 { 'arg_type': 'dict' } 扩展上面的任何选项,这样就可以通过 -一个字典类型的参数来传递所有的函数参数。使用参数名作为字典的键值。 - -例子: > - let g:ctrlp_status_func = { - \ 'arg_type' : 'dict', - \ 'enter': 'Function_Name_1', - \ 'exit': 'Function_Name_2', - \ } - - function! Function_Name_1(dict) - " where dict == { - " \ 'focus': value, - " \ 'byfname': value, - " \ 'regex': value, - " \ ... - " } - endfunction -< - *'g:ctrlp_brief_prompt'* -当设置为 1 时, 提示符后为空时按 会退出 CtrlP 。 - - *ctrlp-default-value* -另外,你可以使用下面的方式来改变默认值。 -例子: > - let g:ctrlp_path_nolim = 1 - -这样可以让无限制模式匹配“路径”类型。 -=============================================================================== -命令 *ctrlp-commands* - - *:CtrlP* -:CtrlP [起始目录] - 用文件搜索模式打开CtrlP。 - - 如果没有给定参数,|g:ctrlp_working_path_mode| 会被用来决定起始目录。 - - 在输入时你可以使用 自动补全[起始目录]。 - - *:CtrlPBuffer* -:CtrlPBuffer - 用缓冲区搜索模式打开CtrlP。 - - *:CtrlPMRU* -:CtrlPMRU - 用最近最多使用模式打开CtrlP。 - - *:CtrlPLastMode* -:CtrlPLastMode [--dir] - 用上一次使用的模式打开CtrlP。当提供了"--dir"参数,也重用上一次的工作目录。 - - *:CtrlPRoot* -:CtrlPRoot - 行为类似使用了 |g:ctrlp_working_path_mode| = 'r' 并且忽略了该变量的当前值的 - |:CtrlP| 命令。 - - *:CtrlPClearCache* -:CtrlPClearCache - 清除当前工作目录的缓存。和在CtrlP内按 效果一样。 - 使用 |g:ctrlp_use_caching| 来启用或禁用缓存。 - - *:CtrlPClearAllCaches* -:CtrlPClearAllCaches - 删除在 |g:ctrlp_cache_dir| 中定义的缓存目录中的所有缓存文件。 - -------------------------------------------------------------------------------- -由扩展提供的命令参见 |ctrlp-extensions| 。 - -=============================================================================== -按键绑定 *ctrlp-mappings* - - *'ctrlp-'* - - 普通模式 |Normal| 下默认以文件搜索模式打开CtrlP提示符面板。 - ----------------------------------------- -已经在提示符面板中:~ - - - 在全路径搜索和文件名搜索间切换。 - 注意: 在文件名搜索模式,提示符面板的提示符是'>d>',而不是'>>>' - - *'ctrlp-fullregexp'* - 在字符串搜索模式和正则表达式模式之间切换。 - 注意: 在全正则表达式模式,提示符面板的提示符是'r>>',而不是'>>>' - - 详细参见: |input-formats| (指引)和 |g:ctrlp_regexp_search| 选项。 - - , 'forward' 前进 - - 切换到序列里面的 'next' 后一个搜索模式。 - - , 'backward' 后退 - - 切换到序列里面的 'previous' 前一个搜索模式。 - - *'ctrlp-autocompletion'* - 自动补全在提示符面板的当前工作路径中的目录名。 - - - 在匹配窗口和提示符面板之间切换焦点。 - - , - , - - 退出CtrlP。 - -移动:~ - - , - - 向下移动。 - - , - - 向上移动。 - - - 移动光标到提示符面板的 'start' 开头。 - - - 移动光标到提示符面板的 'end' 末尾。 - - , - , - - 向左 'left' 移动一个字符。 - - , - - 向右 'right' 移动一个字符。 - -编辑:~ - - , - - 删除前一个字符。 - - - 删除当前字符。 - - - 删除前一个单词。 - - - 清除输入。 - -浏览输入历史:~ - - - 提示符面板历史里的下一个字符串。 - - - 提示符面板历史里的上一个字符串。 - -打开/创建文件:~ - - - 如果可能的话在 'current' 当前窗口打开选择的文件。 - - - 在 'tab' 新标签打开选择的文件。 - Open the selected file in a new 'tab'. - - - 在 'vertical' 竖直分割窗口打开选择的文件。 - - , - , - - 在 'horizontal' 水平分割窗口打开选择的文件。 - - - 创建一个新文件和它的父目录。 - -打开多个文件:~ - - - - 标记/取消标记一个被 打开的文件。 - - 标记/取消标记一个被 在它的目录被创建的文件。 - - - - 打开被 标记的文件。 - - 当没有文件被 标记时,使用下列选项打开一个终端对话框: - - 打开被选择的文件: - t - 在新标签页中打开。 - v - 在一个竖直分割窗口中。 - h - 在一个水平分割窗口中。 - r - 在当前窗口中打开。 - i - 在隐藏的缓冲区中。 - x - (可选的)使用 |g:ctrlp_open_func| 中定义的函数。 - - 其它选项 (未显示): - a - 标记匹配窗口中的所有文件。 - d - 改变CtrlP的工作目录到被选择的文件的目录并切换到文件搜索模式。 - -功能按键绑定:~ - - - - 刷新匹配窗口并且清除当前目录的缓存。 - - 从最近最多使用中移除被删除的文件。 - - - 最近最多使用模式: - - 清除最近最多使用列表。 - - 删除被 标记的最近最多使用条目。 - 缓冲区模式: - - 删除光标下的条目或者删除被 标记的多个条目。 - -粘贴:~ - - , *'ctrlp-pasting'* - - 将剪贴板中的文本粘贴到提示符窗口中。 - - - 打开一个终端对话框来粘贴 ,搜索寄存器的文本,上一次可视 - 化模式的选择,剪贴板或者任何寄存器到提示符面板中。 - -使用 |g:ctrlp_prompt_mappings| 选择你自己的绑定。 - ----------------------------------------- -当焦点在匹配窗口中时(使用 来切换):~ - - a-z - 0-9 - ~^-=;`',.+!@#$%&_(){}[] - 在匹配第一个字符的行中循环。 - -=============================================================================== -输入格式 *ctrlp-input-formats* - -提示符面板的输入格式:~ - -a) 字符串。 - - 例如: 'abc' 被内部理解为 'a[^a]\{-}b[^b]\{-}c' - -b) 在正则表达式模式,输入字符串被按照Vim的正则表达式模式 |pattern| 来对待,不 - 进行任何修改。 - - 例如: 'abc\d*efg' 会被解读为 'abc\d*efg'。 - - 如何启用正则表达式模式参见 |ctrlp-fullregexp| (按键绑定)和 - |g:ctrlp_regexp_search| (选项)。 - -c) 字符串末尾使用一个冒号':'跟随一个Vim命令来在打开那个文件后执行该命令。如果 - 你需要使用':'的字面意思,使用反斜杠转义'\:'。但打开多个文件时,命令会在每 - 个打开文件上执行。 - - 例如: 使用':45'跳转到第45行。 - - 使用':/any\:string'跳转到'any:string'第一次出现的地方。 - - 使用':+setf\ myfiletype|50'来设置文件类型为 'myfiletype',然后跳转 - 到第50行。 - - 使用':diffthis'当打开多个文件时在前四个文件上调用 |:diffthis| 。 - - 参见: Vim的 |++opt| 和 |+cmd|. - -d) 提交两个点号 '..' 来进入上级目录。如果想进入向上多级目录,每多一级使用一个 - 额外的点号: -> - 输入 解释为 - .. ../ - ... ../../ - .... ../../../ -< - 注意: 如果父目录很大并且没有被缓存,可能会很慢。 - - 你可以使用'@cd path/'来改变CtrlP的工作目录为path/。使用'@cd %:h'来改变为当 - 前文件的目录。 - -e) 类似的,提交'/'或者'\'来查找或者跳转到项目的根目录。 - - 如果项目很大,使用版本控制系统的列出命令来寻找文件可能会加速初始化扫描。( - 更多细节参见 |g:ctrlp_user_command| )。 - - 注意: d) 和 e) 只在文件,目录和混合模式生效。 - -f) 输入一个不存在的文件名并且按下 来创建文件。如果使用 标记了一个 - 文件,将会在被标记的文件的目录下创建这个新文件。 - - 例如: 使用 'newdir/newfile.txt' 会创建一个名为'newdir'的目录和一个名为 - 'newfile.txt'的文件。 - - 如果一个条目'some/old/dirs/oldfile.txt'被 标记,然后 'newdir' - 和'newfile.txt'会在'some/old/dirs'下被创建。最终的路径会像下面这样 - 'some/old/dirs/newdir/newfile.txt'. - - 注意: 在Windows下使用 '\' 代替 '/' (如果 |'shellslash'| 选项没有设置)。 - -g) 在文件名模式(使用 切换)下,你可以使用被逗号分隔的一个主要的模式和 - 一个改善的模式。两个模式在正则表达式模式下像(a)或(b)那样工作。 - -h) 使用?打开帮助文件。 - -=============================================================================== -扩展 *ctrlp-extensions* - -扩展是可选的。把它的名字添加到变量g:ctrlp_extensions中来开启扩展: > - let g:ctrlp_extensions = ['tag', 'buffertag', 'quickfix', 'dir', 'rtscript', - \ 'undo', 'line', 'changes', 'mixed', 'bookmarkdir'] -< -扩展的名字在变量中出现的顺序会是在使用命令 切换时扩展在状态栏中出 -现的顺序。 - -可用的扩展:~ - - *:CtrlPTag* - * 标记模式:~ - - 名称: 'tag' - - 命令: ":CtrlPTag" - - 在一个生成的标记文件中搜索标签,跳转到标签定义。使用Vim的 |'tags'| 来指定 - 标签文件的位置和名称。 - 例如: set tags+=doc/tags - - *:CtrlPBufTag* - *:CtrlPBufTagAll* - * 缓冲区标签模式:~ - - 名称: 'buffertag' - - 命令: ":CtrlPBufTag [缓冲区]", - ":CtrlPBufTagAll"。 - - 在当前缓冲区或者所有列出的缓冲区中搜索标签并且跳转到定义。需要 - |exuberant_ctags| 或者兼容的程序。 - - *:CtrlPQuickfix* - * 快速修复模式:~ - - 名称: 'quickfix' - - 命令: ":CtrlPQuickfix" - - 在当前的快速修复错误列表中搜索条目并且跳转过去。 - - *:CtrlPDir* - * 目录模式:~ - - 名称: 'dir' - - 命令: ":CtrlPDir [起始muu]" - - 搜索目录并且将其作为工作目录。 - - 按键绑定: - + 为CtrlP修改工作目录并且保持打开状态。 - + 修改全局的工作目录(退出)。 - + 为当前窗口修改工作目录(退出)。 - + 修改全局工作目录为CtrlP的当前工作目录(退出)。 - - *:CtrlPRTS* - * 运行时脚本模式:~ - - 名称: 'rtscript' - - 命令: ":CtrlPRTS" - - 在运行时路径中寻找文件(vimscripts, docs, snippets...)。 - - *:CtrlPUndo* - * 撤销模式:~ - - 名称: 'undo' - - 命令: ":CtrlPUndo" - - 浏览撤销历史。 - - *:CtrlPLine* - * 行模式:~ - - 名称: 'line' - - 命令: ":CtrlPLine [缓冲区]" - - 在所有列出的缓冲区或者在指定的 [buffer] 缓冲区内搜索一行内容。 - - *:CtrlPChange* - *:CtrlPChangeAll* - * 修改列表模式:~ - - 名称: 'changes' - - 命令: ":CtrlPChange [缓冲区]", - ":CtrlPChangeAll". - - 在当前缓冲区或者在所有列出的缓冲区内搜索最近的修改并跳转。 - - *:CtrlPMixed* - * 混合模式:~ - - 名称: 'mixed' - - 命令: ":CtrlPMixed" - - 同时在文件,缓冲区和最近最多修改中搜索。 - - *:CtrlPBookmarkDir* - *:CtrlPBookmarkDirAdd* - * 书签目录模式:~ - - 名称: 'bookmarkdir' - - 命令: ":CtrlPBookmarkDir", - ":CtrlPBookmarkDirAdd [目录] [标题]". - ":CtrlPBookmarkDirAdd! [目录] [标题]". - - 搜索一个被书签标记的目录并将其作为工作目录。 - - 以指定的[标题]添加[目录]到 CtrlPBookmarkDir 中,如果没有给出[标题]或 - 者[目录],会请求用户输入。 - - 以指定的[标题]添加[目录]到 CtrlPBookmarkDir 中,如果没有给出目录,则 - 默认为当前目录( [CWD] ),如果没有给出[标题] ,会请求用户输入。 - - 最新的用来添加所有最近使用过的目录到 CtrlPBookmarkDir 列表中的自动命令 - 如下 - > - augroup CtrlPDirMRU - autocmd! - autocmd FileType * if &modifiable | execute 'silent CtrlPBookmarkDirAdd! %:p:h' | endif - augroup END -< - - - 按键绑定: - + 为CtrlP修改工作目录并且保持打开状态,并且切换到文件搜索模式。 - + 修改全局的工作目录(退出)。 - + 为当前窗口修改工作目录(退出)。 - + - - 清除书签列表。 - - 删除被 标记的书签条目。 - - *ctrlp-autoignore-extension* - * 自动忽略模式:~ - - 名称: 'autoignore' - - - 这个扩展并不会添加新命令。它支持通过项目根目录中的 `.ctrlpignore` 文件为 - 每个项目设置忽略模式 (就像属于单个项目的 |ctrlp_custom_ignore|)。基本 - 上就像 CtrlP 的 `.gitignore` 或者 `.hgignore`。 - - 注意: 当使用 |g:ctrlp_user_command| 自动忽略模式不起作用。 - - 注意: `.ctrlpignore` 会被当做根目录的标识(参见 |g:ctrlp_root_markers|). - - - 忽略文件的语法: - 空行,以 `#` (注释)开头的行会被忽略。 - - 其他行会被当做正则表达式。 匹配模式如何被使用参见 *string-match* 。 - 任意条目,只要匹配到任意匹配模式,就会从 CtrlP 中搜索结果中忽略。 - - 例子: - - \.tmp$ - ^generated/ - local\.cfg - - 注意: 即使在 Windows 上模式也应该使用反斜线。 - - 你也可以像下面那样使用 glob 命令风格的语法: - - syntax:wildignore - *.tar.gz - *.tmp - - 这样会在搜索文件时临时的把每一个匹配模式添加到 |'wildignore'| - 中,结束时移除。 - - 你也可以通过下面的方式切换回默认的正则表达式为基础的模式: - - syntax:regexp - - 你也可以只为某一条目类型(文件、目录...)设置匹配模式: - - dir:build - file:foo\.txt - - 这样只会忽略包含 "build" 的目录和包含 "foo.txt" 的文件。不会忽略带 - 有 "build" 的文件或者反过来。 - - 注意: 如果为了忽略名为 "build" 的目录,而不是『任何』包含 "build" - 的目录,你可以使用下面的正则: ^build$ - - - 常见问题: - 问: 为什么 CtrlP 不能直接支持原生的 `.gitignore` or `.hgignore` ? - - 答: 这些文件初看起来好像已经包含了所有你想从 CtrlP 中排除的文件。但是 - 通常情况下,这些文件和你想在 CtrlP 中的配置会有一些不同。这些配置文件 - 列出了不能被包含到版本控制中的文件。这些不能被包含到版本控制中的文件 - 包括了你想忽略的,但是同时可能也包含了你不想忽略的:本地设置,外部包 - 和依赖,等等。作者觉得支持多种语法与只是简单的复制/粘贴几行忽略规则比 - 起来比较麻烦。如果你不这么觉得可以随时提交补丁 :) - - 问: 我开启了 |ctrlp-autoignore-extension|, 或者编辑了 `.ctrlpignore` - 但是这些新模式并没有起作用。我哪里做错了? - - 答: 可能什么都没做错!CtrlP 可以为了快速的响应缓存搜索结果。你可以按 - 强制刷新。如果 `.ctrlpignore` 改动过,这样也会使用新的匹配模式。 - ----------------------------------------- -缓冲标签模式选项:~ - - *'g:ctrlp_buftag_ctags_bin'* -如果ctags没有在环境变量中配置,使用该选项来指定它的位置: > - let g:ctrlp_buftag_ctags_bin = '' -< - - *'g:ctrlp_buftag_systemenc'* -将该选项与你的操作系统的编码(非Vim的)保持一致。默认值使用Vim的全局 -|'encoding'| 选项: > - let g:ctrlp_buftag_systemenc = &encoding -< - - *'g:ctrlp_buftag_types'* -使用该选项来在ctags, jsctags...中为指定的文件格式设置参数: > - let g:ctrlp_buftag_types = '' -< -例子: > - let g:ctrlp_buftag_types = { - \ 'erlang' : '--language-force=erlang --erlang-types=drmf', - \ 'javascript' : { - \ 'bin': 'jsctags', - \ 'args': '-f -', - \ }, - \ } -< - -=============================================================================== -自定义 *ctrlp-customization* - -高亮:~ - * CtrlP缓冲区的设置: - CtrlPNoEntries : 当没有匹配被发现时的消息(错误)。 - CtrlPMatch : 匹配模式(标识)。 - CtrlPLinePre : 匹配窗口的行前缀'>'。 - CtrlPPrtBase : 提示符窗口的基础(注释)。 - CtrlPPrtText : 提示符窗口的文本 (|hl-Normal|)。 - CtrlPPrtCursor : 提示符窗口的光标在文本上移动时(常量)。 - - * 缓冲区浏览模式: - CtrlPBufferNr : 缓冲区编号 - CtrlPBufferInd : '+', '-', '=' 和 '#' 指示符 (参见 |:buffers|) - CtrlPBufferHid : 隐藏缓冲区 - CtrlPBufferHidMod : 隐藏和被编辑过的缓冲区 - CtrlPBufferVis : 可见的缓冲区 - CtrlPBufferVisMod : 可见的和被编辑过的缓冲区 - CtrlPBufferCur : 当前缓冲区 - CtrlPBufferCurMod : 当前和被编辑过的缓冲区 - CtrlPBufferPath : 缓冲区路径 - - * 在扩展中: - CtrlPTabExtra : 每一行中不匹配的部分(注释)。 - CtrlPBufName : 条目所属的缓冲区名称(|hl-Directory|)。 - CtrlPTagKind : 缓冲区标签模式中标签的类型(|hl-Title|)。 - CtrlPqfLineCol : 快速修复模式中行和列的序号(注释)。 - CtrlPUndoT : 撤销模式的流逝时间(|hl-Directory|)。 - CtrlPUndoBr : 撤销模式的方括号(注释)。 - CtrlPUndoNr : 撤销模式的方括号中的数字(字符串)。 - CtrlPUndoSv : 文件被保存的点(注释)。 - CtrlPUndoPo : 撤销树中的当前位置(|hl-Title|)。 - CtrlPBookmark : 书签的名称(标识)。 - -状态栏:~ - * 高亮组: - CtrlPMode1 : 'file' 或 'path' 或 'line',和当前模式(字符)。 - CtrlPMode2 : 'prt' 或 'win', 'regex',工作目录 |hl-LineNr| 。 - CtrlPStats : 扫描状态(函数)。 - - 重新构建状态栏,参见 |g:ctrlp_status_func| 。 - -=============================================================================== -其它选项 *ctrlp-miscellaneous-configs* - -* 为 |g:ctrlp_user_command| 使用 |wildignore| : -> - function! s:wig2cmd() - " 修改wildignore为空格或者|分隔的组 - " 例如: .aux .out .toc .jpg .bmp .gif - " 或者 .aux$\|.out$\|.toc$\|.jpg$\|.bmp$\|.gif$ - let pats = ['[*\/]*\([?_.0-9A-Za-z]\+\)\([*\/]*\)\(\\\@ 提交) - -* 一个独立的函数,设置项目的根目录为工作目录,如果没有找到根目录的话使用当前文 -* 件的父目录。 -> - function! s:setcwd() - let cph = expand('%:p:h', 1) - if cph =~ '^.\+://' | retu | en - for mkr in ['.git/', '.hg/', '.svn/', '.bzr/', '_darcs/', '.vimprojects'] - let wd = call('find'.(mkr =~ '/$' ? 'dir' : 'file'), [mkr, cph.';']) - if wd != '' | let &acd = 0 | brea | en - endfo - exe 'lc!' fnameescape(wd == '' ? cph : substitute(wd, mkr.'$', '.', '')) - endfunction - - autocmd BufEnter * call s:setcwd() -< -(需要 Vim 7.1.299+) - -* 使用 |count| 来使用同样的按键绑定调用不同的命令: -> - let g:ctrlp_cmd = 'exe "CtrlP".get(["", "Buffer", "MRU"], v:count)' -< - -=============================================================================== -开发人员 *ctrlp-credits* - -最初由 Kien Nguyen 开发。现在由 Github 上 ctrlpvim 组织的成员 -维护(https://github.com/orgs/ctrlpvim/people) 。在Vim的 |license| 下发行。 - -项目主页: http://ctrlpvim.github.com/ctrlp.vim -Git 仓库: https://github.com/ctrlpvim/ctrlp.vim - -------------------------------------------------------------------------------- -感谢所有通过github,bitbucket或电子邮件提供想法,报告bug或者帮助debugging的人。 - -特别感谢:~ - - * Woojong Koh - * Simon Ruderich - * Yasuhiro Matsumoto - * Ken Earley - * Kyo Nagashima - * Zak Johnson - * Diego Viola - * Piet Delport - * Thibault Duplessis - * Kent Sibilev - * Tacahiroy - * Luca Pette - * Seth Fowler - * Lowe Thiderman - * Christopher Fredén - * Zahary Karadjov - * Jo De Boeck - * Rudi Grinberg - * Timothy Mellor - * Sergey Vlasov - -=============================================================================== -更新日志 *ctrlp-changelog* - - + 新的支持高亮的缓冲区浏览模式 (建议 |+conceal|) - + 新选项: |g:ctrlp_bufname_mod|, - |g:ctrlp_bufpath_mod| - + 结合 *g:ctrlp_match_window_bottom* *g:ctrlp_match_window_reversed* 和 - *g:ctrlp_max_height* 到 |g:ctrlp_match_window| 。 - + 新选项: |g:ctrlp_match_window| 。 - -在2012/11/30之前~ - - + 新选项: |g:ctrlp_abbrev|, - |g:ctrlp_key_loop|, - |g:ctrlp_open_func|, - |g:ctrlp_tabpage_position|, - |g:ctrlp_mruf_save_on_update| - + 重命名: - *g:ctrlp_dotfiles* -> |g:ctrlp_show_hidden| 。 - + 修改 |g:ctrlp_switch_buffer| 和 |g:ctrlp_working_path_mode|的类型 - (旧值仍然工作)。 - + 当 |g:ctrlp_user_command| 是一个字典时,为其增加一个新的键: 'ignore'。 - -在2012/06/15之前~ - - + |g:ctrlp_follow_symlinks| 的新值: 2。 - + |g:ctrlp_open_multiple_files| 的新值: 'j'。 - + 允许使用 , , 打开被 标记的文件。 - + 扩展 '..' (|ctrlp-input-formats| (d)) - + 新的输入格式: '@cd' (|ctrlp-input-formats| (d)) - -在2012/04/30之前~ - - + 新选项: |g:ctrlp_mruf_default_order| - + 新特性: 被书签标记的目录的扩展。 - + 新命令: |:CtrlPBookmarkDir| - |:CtrlPBookmarkDirAdd| - -在2012/04/15之前~ - - + 新选项: |g:ctrlp_buffer_func|,CtrlP缓冲区的回调函数。 - + 移除 : g:ctrlp_mruf_last_entered,使其作为最近最多使用的默认行为。 - + 新命令: |:CtrlPLastMode|,以上一次使用的模式打开CtrlP。 - |:CtrlPMixed|,在文件,缓冲区和最近最多使用中搜索。 - -在2012/03/31之前~ - - + 新选项: |g:ctrlp_default_input|, 进入CtrlP后的默认输入。 - |g:ctrlp_match_func|,允许使用自定义的模糊查找工具。 - + 重命名: - *ClearCtrlPCache* -> |CtrlPClearCache| - *ClearAllCtrlPCaches* -> |CtrlPClearAllCaches| - *ResetCtrlP* -> |CtrlPReload| - -在2012/03/02之前~ - - + 重命名: - *g:ctrlp_regexp_search* -> |g:ctrlp_regexp|, - *g:ctrlp_dont_split* -> |g:ctrlp_reuse_window|, - *g:ctrlp_jump_to_buffer* -> |g:ctrlp_switch_buffer|。 - + 重命名和微调: - *g:ctrlp_open_multi* -> |g:ctrlp_open_multiple_files|。 - + 过时 *g:ctrlp_highlight_match* - + 扩展 |g:ctrlp_user_command| 支持多个命令。 - + 新选项: |g:ctrlp_mruf_last_entered| 修改最近最多使用为最近进入。 - -在2012/01/15之前~ - - + 新按键绑定: 交换 . 现在用来补全在当前工作目录内的目 - 录名。 - + 新选项: |g:ctrlp_arg_map| 使 可以接收一个参数。 - |g:ctrlp_status_func| 自定义状态栏。 - |g:ctrlp_mruf_relative| 在当前工作目录内显示最近最多使用。 - + 扩展 g:ctrlp_open_multi 增加新选项值: tr, hr, vr。 - + 扩展 |g:ctrlp_custom_ignore| 指定过滤目录,文件和链接。 - -在2012/01/05之前~ - - + 新特性: 缓冲区标记扩展。 - + 新命令: |:CtrlPBufTag|, |:CtrlPBufTagAll|。 - + 新选项: |g:ctrlp_cmd|, - |g:ctrlp_custom_ignore| - -在2011/11/30之前~ - - + 新特性: 标签,快速修复和目录扩展。 - + 新命令: |:CtrlPTag|, |:CtrlPQuickfix|, |:CtrlPDir|。 - + 新选项: |g:ctrlp_use_migemo|, - |g:ctrlp_lazy_update|, - |g:ctrlp_follow_symlinks| - -在2011/11/13之前~ - - + 新的特殊输入: '/' 和 '\' 查找根目录 (|ctrlp-input-formats| (e)) - + 移除 ctrlp#SetWorkingPath()。 - + 移除 *g:ctrlp_mru_files* ,使最近最多使用模式变为永久的。 - + 扩展 g:ctrlp_open_multi,添加打开文件的新方式。 - + 新选项: g:ctrlp_dont_split, - |g:ctrlp_mruf_case_sensitive| - -在2011/10/30之前~ - - + 新特性: 支持自定义扩展。 - 也会从最近最多使用列表中移除不存在的文件。 - + 新选项: g:ctrlp_jump_to_buffer - -在2011/10/12之前~ - - + 新特性: 打开多个文件。 - 传递Vim的 |++opt| 和 |+cmd| 到新打开的文件 - (|ctrlp-input-formats| (c)) - 为 |:CtrlP| [起始目录]自动补全每个目录 - + 新按键绑定: 标记/取消标记一个被 打开的文件。 - 打开所有被标记的文件。 - + 新选项: g:ctrlp_open_multi - + 移除 *g:ctrlp_persistent_input* *g:ctrlp_live_update* and 。 - -在2011/09/29之前~ - - + 新按键绑定: , 输入历史中的前一个/后一个字符串。 - 创建一个新的文件和它的父目录。 - + 新选项: |g:ctrlp_open_new_file|, - |g:ctrlp_max_history| - + 添加一个新的在横向分割窗口打开的绑定: - -在2011/09/19之前~ - - + 新命令: ResetCtrlP - + 新选项: |g:ctrlp_max_files|, - |g:ctrlp_max_depth|, - g:ctrlp_live_update - + 新按键绑定: - -在2011/09/12之前~ - - + 添加在匹配窗口内循环匹配行的功能。 - + 扩展 g:ctrlp_persistent_input的行为 - + 扩展 |:CtrlP| 的行为 - + 新选项: |g:ctrlp_dotfiles|, - |g:ctrlp_clear_cache_on_exit|, - g:ctrlp_highlight_match, - |g:ctrlp_user_command| - + 新的特殊输入: '..' (|ctrlp-input-formats| (d)) - + 新按键绑定: 。 - + 新命令: |:CtrlPCurWD|, - |:CtrlPCurFile|, - |:CtrlPRoot| - - + 新特性: 在最近最常使用的文件列表中搜索 - + 新按键绑定: 。 - + 扩展 的行为。 - + 新选项: g:ctrlp_mru_files, - |g:ctrlp_mruf_max|, - |g:ctrlp_mruf_exclude|, - |g:ctrlp_mruf_include| - + 新命令: |:CtrlPMRU| - -第一版发布于: 2011/09/06~ - -=============================================================================== -vim:ft=help:et:ts=2:sw=2:sts=2:norl diff --git a/pack/acp/start/ctrlp.vim/doc/ctrlp.txt b/pack/acp/start/ctrlp.vim/doc/ctrlp.txt deleted file mode 100644 index 455e368..0000000 --- a/pack/acp/start/ctrlp.vim/doc/ctrlp.txt +++ /dev/null @@ -1,1683 +0,0 @@ -*ctrlp.txt* Fuzzy file, buffer, mru, tag, ... finder. v1.79 -*CtrlP* *ControlP* *'ctrlp'* *'ctrl-p'* -=============================================================================== -# # -# :::::::: ::::::::::: ::::::::: ::: ::::::::: # -# :+: :+: :+: :+: :+: :+: :+: :+: # -# +:+ +:+ +:+ +:+ +:+ +:+ +:+ # -# +#+ +#+ +#++:++#: +#+ +#++:++#+ # -# +#+ +#+ +#+ +#+ +#+ +#+ # -# #+# #+# #+# #+# #+# #+# #+# # -# ######## ### ### ### ########## ### # -# # -=============================================================================== -CONTENTS *ctrlp-contents* - - 1. Intro........................................|ctrlp-intro| - 2. Options......................................|ctrlp-options| - 3. Commands.....................................|ctrlp-commands| - 4. Mappings.....................................|ctrlp-mappings| - 5. Input Formats................................|ctrlp-input-formats| - 6. Extensions...................................|ctrlp-extensions| - -=============================================================================== -INTRO *ctrlp-intro* - -Full path fuzzy file, buffer, mru, tag, ... finder with an intuitive interface. -Written in pure Vimscript for MacVim, gVim and Vim version 7.0+. Has full -support for Vim's |regexp| as search pattern, built-in MRU files monitoring, -project's root finder, and more. - -To enable optional extensions (tag, dir, rtscript...), see |ctrlp-extensions|. - -=============================================================================== -OPTIONS *ctrlp-options* - -Overview:~ - - |loaded_ctrlp|................Disable the plugin. - |ctrlp_map|...................Default mapping. - |ctrlp_cmd|...................Default command used for the default mapping. - |ctrlp_by_filename|...........Default to filename mode or not. - |ctrlp_regexp|................Default to regexp mode or not. - |ctrlp_match_window|..........Order, height and position of the match window. - |ctrlp_switch_buffer|.........Jump to an open buffer if already opened. - |ctrlp_reuse_window|..........Reuse special windows (help, quickfix, etc). - |ctrlp_tabpage_position|......Where to put the new tab page. - |ctrlp_working_path_mode|.....How to set CtrlP's local working directory. - |ctrlp_root_markers|..........Additional, high priority root markers. - |ctrlp_use_caching|...........Use per-session caching or not. - |ctrlp_clear_cache_on_exit|...Keep cache after exiting Vim or not. - |ctrlp_cache_dir|.............Location of the cache directory. - |ctrlp_show_hidden|...........Ignore dotfiles and dotdirs or not. - |ctrlp_custom_ignore|.........Hide stuff when using |globpath()|. - |ctrlp_max_files|.............Number of files to scan initially. - |ctrlp_max_depth|.............Directory depth to recurse into when scanning. - |ctrlp_user_command|..........Use an external scanner. - |ctrlp_max_history|...........Number of entries saved in the prompt history. - |ctrlp_open_new_file|.........How to open a file created by . - |ctrlp_open_multiple_files|...How to open files selected by . - |ctrlp_arg_map|...............Intercept and or not. - |ctrlp_follow_symlinks|.......Follow symbolic links or not. - |ctrlp_lazy_update|...........Only update when typing has stopped. - |ctrlp_default_input|.........Seed the prompt with an initial string. - |ctrlp_abbrev|................Input abbreviations. - |ctrlp_key_loop|..............Use input looping for multi-byte input. - |ctrlp_prompt_mappings|.......Change the mappings inside the prompt. - |ctrlp_line_prefix|...........Prefix for each line in ctrlp window. - |ctrlp_open_single_match|.....Automatically accept when only one candidate. - |ctrlp_brief_prompt|..........Exit CtrlP on empty prompt by . - |ctrlp_match_current_file|....Include current file in match entries. - |ctrlp_types|.................Names of builtin types. - - MRU mode: - |ctrlp_mruf_max|..............Max MRU entries to remember. - |ctrlp_mruf_exclude|..........Files that shouldn't be remembered. - |ctrlp_mruf_include|..........Files to be remembered. - |ctrlp_mruf_relative|.........Show only MRU files in the working directory. - |ctrlp_tilde_homedir|....Save MRU file paths in home dir as ~/. - |ctrlp_mruf_default_order|....Disable sorting. - |ctrlp_mruf_case_sensitive|...MRU files are case sensitive or not. - |ctrlp_mruf_save_on_update|...Save to disk whenever a new entry is added. - - Buffer mode: - |ctrlp_bufname_mod|...........File name section modificator. - |ctrlp_bufpath_mod|...........File path section modificator. - - BufferTag mode: (to enable, see |ctrlp-extensions|) - |g:ctrlp_buftag_ctags_bin|....The location of the ctags-compatible binary. - |g:ctrlp_buftag_systemenc|....The encoding used for the ctags command. - |g:ctrlp_buftag_types|........Add new filetypes and set the cmd arguments. - - Advanced options: - |ctrlp_open_func|.............Use custom file opening functions. - |ctrlp_status_func|...........Change CtrlP's two statuslines. - |ctrlp_buffer_func|...........Call custom functions in the CtrlP buffer. - |ctrlp_match_func|............Replace the built-in matching algorithm. - -------------------------------------------------------------------------------- -Detailed descriptions and default values:~ - - *'g:ctrlp_map'* -Use this option to change the mapping to invoke CtrlP in |Normal| mode: > - let g:ctrlp_map = '' -< - - *'g:ctrlp_cmd'* -Set the default opening command to use when pressing the above mapping: > - let g:ctrlp_cmd = 'CtrlP' -< - - *'g:loaded_ctrlp'* -Use this to disable the plugin completely: > - let g:loaded_ctrlp = 1 -< - - *'g:ctrlp_by_filename'* -Set this to 1 to set searching by filename (as opposed to full path) as the -default: > - let g:ctrlp_by_filename = 0 -< -Can be toggled on/off by pressing inside the prompt. - - *'g:ctrlp_regexp'* -Set this to 1 to set regexp search as the default: > - let g:ctrlp_regexp = 0 -< -Can be toggled on/off by pressing inside the prompt. - - *'g:ctrlp_match_window'* -Change the position, the listing order of results, the minimum and the maximum -heights of the match window: > - let g:ctrlp_match_window = '' -< -Example: > - let g:ctrlp_match_window = 'bottom,order:btt,min:1,max:10,results:10' -< -The position: (default: bottom) - top - show the match window at the top of the screen. - bottom - show the match window at the bottom of the screen. - -The listing order of results: (default: btt) - order:ttb - from top to bottom. - order:btt - from bottom to top. - -The minimum and maximum heights: - min:{n} - show minimum {n} lines (default: 1). - max:{n} - show maximum {n} lines (default: 10). - -The maximum number of results: - results:{n} - list maximum {n} results (default: sync with max height). - 0 mean no-limit. - -Note: When a setting isn't set, its default value will be used. - - *'g:ctrlp_switch_buffer'* -When opening a file, if it's already open in a window somewhere, CtrlP will try -to jump to it instead of opening a new instance: > - let g:ctrlp_switch_buffer = 'Et' -< - e - jump when is pressed, but only to windows in the current tab. - t - jump when is pressed, but only to windows in another tab. - v - like "e", but jump when is pressed. - h - like "e", but jump when is pressed. - E, T, V, H - like "e", "t", "v", and "h", but jump to windows anywhere. - 0 or - disable this feature. - - *'g:ctrlp_reuse_window'* -When opening a file with , CtrlP avoids opening it in windows created by -plugins, help and quickfix. Use this to setup some exceptions: > - let g:ctrlp_reuse_window = 'netrw' -< -Acceptable values are partial name, filetype or buftype of the special buffers. -Use regexp to specify the pattern. -Example: > - let g:ctrlp_reuse_window = 'netrw\|help\|quickfix' -< - - *'g:ctrlp_tabpage_position'* -Where to put the new tab page when opening one: > - let g:ctrlp_tabpage_position = 'ac' -< - a - after. - b - before. - c - the current tab page. - l - the last tab page. - f - the first tab page. - - *'g:ctrlp_working_path_mode'* -When starting up, CtrlP sets its local working directory according to this -variable: > - let g:ctrlp_working_path_mode = 'ra' -< - c - the directory of the current file. - a - the directory of the current file, unless it is a subdirectory of the cwd - r - the nearest ancestor of the current file that contains one of these - directories or files: - .git .hg .svn .bzr _darcs - w - modifier to "r": start search from the cwd instead of the current file's - directory - 0 or - disable this feature. - -Note #1: if "a" or "c" is included with "r", use the behavior of "a" or "c" (as -a fallback) when a root can't be found. - -Note #2: you can use a |b:var| to set this option on a per buffer basis. - - *'g:ctrlp_root_markers'* -Use this to set your own root markers in addition to the default ones (.git, -.hg, .svn, .bzr, and _darcs). Your markers will take precedence: > - let g:ctrlp_root_markers = [''] -< -Note: you can use a |b:var| to set this option on a per buffer basis. - - *'g:ctrlp_use_caching'* -Enable/Disable per-session caching: > - let g:ctrlp_use_caching = 1 -< - 0 - Disable caching. - 1 - Enable caching. - n - When bigger than 1, disable caching and use the number as the limit to - enable caching again. - -Note: you can quickly purge the cache by pressing while inside CtrlP. - - *'g:ctrlp_clear_cache_on_exit'* -Set this to 0 to enable cross-session caching by not deleting the cache files -upon exiting Vim: > - let g:ctrlp_clear_cache_on_exit = 1 -< - - *'g:ctrlp_cache_dir'* -Set the directory to store the cache files: > - let g:ctrlp_cache_dir = $HOME.'/.cache/ctrlp' -< - - *'g:ctrlp_show_hidden'* -Set this to 1 if you want CtrlP to scan for dotfiles and dotdirs: > - let g:ctrlp_show_hidden = 0 -< -Note: does not apply when a command defined with |g:ctrlp_user_command| is -being used. - - *'ctrlp-wildignore'* -You can use Vim's |'wildignore'| to exclude files and directories from the -results. -Examples: > - " Excluding version control directories - set wildignore+=*/.git/*,*/.hg/*,*/.svn/* " Linux/MacOSX - set wildignore+=*\\.git\\*,*\\.hg\\*,*\\.svn\\* " Windows ('noshellslash') -< -Note #1: the `*/` in front of each directory glob is required. - -Note #2: |wildignore| influences the result of |expand()|, |globpath()| and -|glob()| which many plugins use to find stuff on the system (e.g. VCS related -plugins look for .git/, .hg/,... some other plugins look for external *.exe -tools on Windows). So be a little mindful of what you put in your |wildignore|. - - *'g:ctrlp_custom_ignore'* -In addition to |'wildignore'| and |g:ctrlp_show_hidden|, use this for files -and directories you want only CtrlP to not show. Use regexp to specify the -patterns: > - let g:ctrlp_custom_ignore = '' -< -Examples: > - let g:ctrlp_custom_ignore = '\v[\/]\.(git|hg|svn)$' - let g:ctrlp_custom_ignore = { - \ 'dir': '\v[\/]\.(git|hg|svn)$', - \ 'file': '\v\.(exe|so|dll)$', - \ 'link': 'SOME_BAD_SYMBOLIC_LINKS', - \ } - let g:ctrlp_custom_ignore = { - \ 'file': '\v(\.cpp|\.h|\.hh|\.cxx)@ - let g:ctrlp_max_files = 10000 -< -Note: does not apply when a command defined with |g:ctrlp_user_command| is -being used. - - *'g:ctrlp_max_depth'* -The maximum depth of a directory tree to recurse into: > - let g:ctrlp_max_depth = 40 -< -Note: does not apply when a command defined with |g:ctrlp_user_command| is -being used. - - *'g:ctrlp_user_command'* -Specify an external tool to use for listing files instead of using Vim's -|globpath()|. Use %s in place of the target directory: > - let g:ctrlp_user_command = '' -< -Examples: > - let g:ctrlp_user_command = 'find %s -type f' " MacOSX/Linux - let g:ctrlp_user_command = 'dir %s /-n /b /s /a-d' " Windows -< -You can also use 'grep', 'findstr' or something else to filter the results. -Examples: > - let g:ctrlp_user_command = - \ 'find %s -type f | grep -v -P "\.jpg$|/tmp/"' " MacOSX/Linux - let g:ctrlp_user_command = - \ 'dir %s /-n /b /s /a-d | findstr /v /l ".jpg \\tmp\\"' " Windows -< -Use a version control listing command when inside a repository, this is faster -when scanning large projects: > - let g:ctrlp_user_command = [root_marker, listing_command, fallback_command] - let g:ctrlp_user_command = { - \ 'types': { - \ 1: [root_marker_1, listing_command_1], - \ n: [root_marker_n, listing_command_n], - \ }, - \ 'fallback': fallback_command, - \ 'ignore': 0 or 1 - \ } -< -Some examples: > - " Single VCS, listing command does not list untracked files: - let g:ctrlp_user_command = ['.git', 'cd %s && git ls-files'] - let g:ctrlp_user_command = ['.hg', 'hg --cwd %s locate -I .'] - - " Multiple VCS's: - let g:ctrlp_user_command = { - \ 'types': { - \ 1: ['.git', 'cd %s && git ls-files'], - \ 2: ['.hg', 'hg --cwd %s locate -I .'], - \ }, - \ 'fallback': 'find %s -type f' - \ } - - " Single VCS, listing command lists untracked files (slower): - let g:ctrlp_user_command = - \ ['.git', 'cd %s && git ls-files -co --exclude-standard'] - - let g:ctrlp_user_command = - \ ['.hg', 'hg --cwd %s status -numac -I . $(hg root)'] " MacOSX/Linux - - let g:ctrlp_user_command = ['.hg', 'for /f "tokens=1" %%a in (''hg root'') ' - \ . 'do hg --cwd %s status -numac -I . %%a'] " Windows -< -Note #1: in the |Dictionary| format, 'fallback' and 'ignore' are optional. In -the |List| format, fallback_command is optional. - -Note #2: if the fallback_command is empty or the 'fallback' key is not defined, -|globpath()| will then be used when scanning outside of a repository. - -Note #3: unless the |Dictionary| format is used and 'ignore' is defined and set -to 1, the |wildignore| and |g:ctrlp_custom_ignore| options do not apply when -these custom commands are being used. When not present, 'ignore' is set to 0 by -default to retain the performance advantage of using external commands. - -Note #4: when changing the option's variable type, remember to |:unlet| it -first or restart Vim to avoid the "E706: Variable type mismatch" error. - -Note #5: you can use a |b:var| to set this option on a per buffer basis. - - *'g:ctrlp_max_history'* -The maximum number of input strings you want CtrlP to remember. The default -value mirrors Vim's global |'history'| option: > - let g:ctrlp_max_history = &history -< -Set to 0 to disable prompt's history. Browse the history with and . - - *'g:ctrlp_open_new_file'* -Use this option to specify how the newly created file is to be opened when -pressing : > - let g:ctrlp_open_new_file = 'v' -< - t - in a new tab. - h - in a new horizontal split. - v - in a new vertical split. - r - in the current window. - - *'g:ctrlp_open_multiple_files'* -If non-zero, this will enable opening multiple files with and : > - let g:ctrlp_open_multiple_files = 'v' -< -Example: > - let g:ctrlp_open_multiple_files = '2vjr' -< -For the number: - - If given, it'll be used as the maximum number of windows or tabs to create - when opening the files (the rest will be opened as hidden buffers). - - If not given, will open all files, each in a new window or new tab. - -For the letters: - t - each file in a new tab. - h - each file in a new horizontal split. - v - each file in a new vertical split. - i - all files as hidden buffers. - j - after opening, jump to the first opened tab or window. - r - open the first file in the current window, then the remaining files in - new splits or new tabs depending on which of "h", "v" and "t" is also - present. - - *'g:ctrlp_arg_map'* -When this is set to 1, the and mappings will accept one extra key -as an argument to override their default behavior: > - let g:ctrlp_arg_map = 0 -< -Pressing or will then prompt for a keypress. The key can be: - t - open in tab(s) - h - open in horizontal split(s) - v - open in vertical split(s) - i - open as hidden buffers (for only) - c - clear the marked files (for only) - r - open in the current window (for only) - , , - cancel and go back to the prompt. - - use the default behavior specified with |g:ctrlp_open_new_file| and - |g:ctrlp_open_multiple_files|. - - *'g:ctrlp_follow_symlinks'* -If non-zero, CtrlP will follow symbolic links when listing files: > - let g:ctrlp_follow_symlinks = 0 -< - 0 - don't follow symbolic links. - 1 - follow but ignore looped internal symlinks to avoid duplicates. - 2 - follow all symlinks indiscriminately. - -Note: does not apply when a command defined with |g:ctrlp_user_command| is -being used. - - *'g:ctrlp_lazy_update'* -Set this to 1 to enable the lazy-update feature: only update the match window -after typing's been stopped for a certain amount of time: > - let g:ctrlp_lazy_update = 0 -< -If is 1, update after 250ms. If bigger than 1, the number will be used as the -delay time in milliseconds. - - *'g:ctrlp_default_input'* -Set this to 1 to enable seeding the prompt with the current file's relative -path: > - let g:ctrlp_default_input = 0 -< -Instead of 1 or 0, if the value of the option is a string, it'll be used as-is -as the default input: > - let g:ctrlp_default_input = 'anystring' -< -This option works well together with |g:ctrlp_open_single_match| - - - *'g:ctrlp_match_current_file'* -Includes the current file in the match entries: > - let g:ctrlp_match_current_file = 1 - -By default, the current file is excluded from the list. - -Note: does not apply when |g:ctrlp_match_func| is used. - - *'g:ctrlp_types'* -Set this to list of names to customize core types: > - let g:ctrlp_types = ['mru', 'fil'] - -By default, the types are: > - let g:ctrlp_types = ['fil', 'buf', 'mru']. - - *'g:ctrlp_abbrev'* -Define input abbreviations that can be expanded (either internally or visibly) -in the prompt: > - let g:ctrlp_abbrev = {} -< -Examples: > - let g:ctrlp_abbrev = { - \ 'gmode': 'i', - \ 'abbrevs': [ - \ { - \ 'pattern': '^cd b', - \ 'expanded': '@cd ~/.vim/bundle', - \ 'mode': 'pfrz', - \ }, - \ { - \ 'pattern': '\(^@.\+\|\\\@ (use the expanded string in the - new filename). - c - only when auto-completing directory names with (expand the pattern - immediately before doing the auto-completion). - or not defined - always enable. - -Note: the abbrev entries are evaluated in sequence, so a later entry can be -evaluated against the expanded result of a previous entry; this includes itself -when 'gmode' is "t". - - *'g:ctrlp_key_loop'* -An experimental feature. Set this to 1 to enable input looping for the typing -of multi-byte characters: > - let g:ctrlp_key_loop = 0 -< -Note #1: when set, this option resets the |g:ctrlp_lazy_update| option. - -Note #2: you can toggle this feature inside the prompt with a custom mapping: > - let g:ctrlp_prompt_mappings = { 'ToggleKeyLoop()': [''] } -< - - *'g:ctrlp_prompt_mappings'* -Use this to customize the mappings inside CtrlP's prompt to your liking. You -only need to keep the lines that you've changed the values (inside []): > - let g:ctrlp_prompt_mappings = { - \ 'PrtBS()': ['', ''], - \ 'PrtDelete()': [''], - \ 'PrtDeleteWord()': [''], - \ 'PrtClear()': [''], - \ 'PrtSelectMove("j")': ['', ''], - \ 'PrtSelectMove("k")': ['', ''], - \ 'PrtSelectMove("t")': ['', ''], - \ 'PrtSelectMove("b")': ['', ''], - \ 'PrtSelectMove("u")': ['', ''], - \ 'PrtSelectMove("d")': ['', ''], - \ 'PrtHistory(-1)': [''], - \ 'PrtHistory(1)': [''], - \ 'AcceptSelection("e")': ['', '<2-LeftMouse>'], - \ 'AcceptSelection("h")': ['', '', ''], - \ 'AcceptSelection("t")': [''], - \ 'AcceptSelection("v")': ['', ''], - \ 'ToggleFocus()': [''], - \ 'ToggleRegex()': [''], - \ 'ToggleByFname()': [''], - \ 'ToggleType(1)': ['', ''], - \ 'ToggleType(-1)': ['', ''], - \ 'PrtExpandDir()': [''], - \ 'PrtInsert("c")': ['', ''], - \ 'PrtInsert()': [''], - \ 'PrtCurStart()': [''], - \ 'PrtCurEnd()': [''], - \ 'PrtCurLeft()': ['', '', ''], - \ 'PrtCurRight()': ['', ''], - \ 'PrtClearCache()': [''], - \ 'PrtDeleteEnt()': [''], - \ 'CreateNewFile()': [''], - \ 'MarkToOpen()': [''], - \ 'OpenMulti()': [''], - \ 'PrtExit()': ['', '', ''], - \ } -< -Note: if pressing moves the cursor one character to the left instead of -deleting a character for you, add this to your |.vimrc| to disable the plugin's -default mapping: > - let g:ctrlp_prompt_mappings = { 'PrtCurLeft()': ['', ''] } -< - - *'g:ctrlp_line_prefix'* -This prefix will be prepended to each line in ctrlp's item listing. -default: > - let g:ctrlp_line_prefix = '> ' -< - - *'g:ctrlp_open_single_match'* -List of CtrlP modes for which CtrlP should accept an entry directly, if only -one candidate exists. -Example: > - let g:ctrlp_open_single_match = ['buffer tags', 'buffer'] -< -This is currently only really useful together with |g:ctrlp_default_input| -set before launching, and cleared afterwards, with a function such as -following: > - fu! tagsUnderCursor() - try - let default_input_save = get(g:, 'ctrlp_default_input', '') - let g:ctrlp_default_input = expand('') - CtrlPBufTagAll - finally - if exists('default_input_save') - let g:ctrlp_default_input = default_input_save - endif - endtry - endfu -> -< ----------------------------------------- -MRU mode options:~ - - *'g:ctrlp_mruf_max'* -Specify the number of recently opened files you want CtrlP to remember: > - let g:ctrlp_mruf_max = 250 -< - - *'g:ctrlp_mruf_exclude'* -Files you don't want CtrlP to remember. Use regexp to specify the patterns: > - let g:ctrlp_mruf_exclude = '' -< -Examples: > - let g:ctrlp_mruf_exclude = '/tmp/.*\|/temp/.*' " MacOSX/Linux - let g:ctrlp_mruf_exclude = '^C:\\dev\\tmp\\.*' " Windows -< - - *'g:ctrlp_mruf_include'* -And if you want CtrlP to only remember some files, specify them here: > - let g:ctrlp_mruf_include = '' -< -Example: > - let g:ctrlp_mruf_include = '\.py$\|\.rb$' -< - - *'g:ctrlp_tilde_homedir'* -Set this to 1 to save every MRU file path $HOME/$filepath in the $HOME dir - as ~/$filepath instead of $HOME/$filepath : > - let g:ctrlp_tilde_homedir = 0 -< -Note: This applies also to all dir paths stored by :CtrlPBookmarkDirAdd! -< - - *'g:ctrlp_mruf_relative'* -Set this to 1 to show only MRU files in the current working directory: > - let g:ctrlp_mruf_relative = 0 -< -Note: you can use a custom mapping to toggle this option inside the prompt: > - let g:ctrlp_prompt_mappings = { 'ToggleMRURelative()': [''] } -< - *'g:ctrlp_mruf_default_order'* -Set this to 1 to disable sorting when searching in MRU mode: > - let g:ctrlp_mruf_default_order = 0 -< - - *'g:ctrlp_mruf_case_sensitive'* -Match this with your file system case-sensitivity setting to avoid duplicate -MRU entries: > - let g:ctrlp_mruf_case_sensitive = 1 -< - - *'g:ctrlp_mruf_save_on_update'* -Set this to 0 to disable saving of the MRU list to hard drive whenever a new -entry is added, saving will then only occur when exiting Vim: > - let g:ctrlp_mruf_save_on_update = 1 -< - *'g:ctrlp_bufname_mod'* -Modify file name section according to modificator string. See |filename-modifiers|. > - let g:ctrlp_bufname_mod = ':t' -< - *'g:ctrlp_bufpath_mod'* -Modify file path section according to modificator string. See |filename-modifiers|. > - let g:ctrlp_bufpath_mod = ':~:.:h' -< ----------------------------------------- -Advanced options:~ - - *'g:ctrlp_open_func'* -Define a custom function to open the selected file: > - let g:ctrlp_open_func = {} -< -Example: > - let g:ctrlp_open_func = { - \ 'files' : 'Function_Name_1', - \ 'buffers' : 'Function_Name_2', - \ 'mru files' : 'Function_Name_3', - \ } -< -Structure of the functions: > - function! Function_Name(action, line) - " Arguments: - " | - " +- a:action : The opening action: - " | + 'e' : user pressed (default) - " | + 'h' : user pressed (default) - " | + 'v' : user pressed (default) - " | + 't' : user pressed (default) - " | + 'x' : user used the console dialog (default) and - " | chose "e[x]ternal". - " | - " +- a:line : The selected line. - - endfunction -< -Note: does not apply when opening multiple files with and . - -Example: open HTML files in the default web browser when is pressed and -in Vim otherwise > - function! HTMLOpenFunc(action, line) - if a:action =~ '^[tx]$' && fnamemodify(a:line, ':e') =~? '^html\?$' - - " Get the filename - let filename = fnameescape(fnamemodify(a:line, ':p')) - - " Close CtrlP - call ctrlp#exit() - - " Open the file - silent! execute '!xdg-open' filename - - elseif a:action == 'x' && fnamemodify(a:line, ':e') !~? '^html\?$' - - " Not a HTML file, simulate pressing again and wait for new input - call feedkeys("\") - - else - - " Use CtrlP's default file opening function - call call('ctrlp#acceptfile', [a:action, a:line]) - - endif - endfunction - - let g:ctrlp_open_func = { 'files': 'HTMLOpenFunc' } -< - - *'g:ctrlp_status_func'* -Use this to customize the statuslines for the CtrlP window: > - let g:ctrlp_status_func = {} -< -Example: > - let g:ctrlp_status_func = { - \ 'main': 'Function_Name_1', - \ 'prog': 'Function_Name_2', - \ } -< -Structure of the functions: > - " Main statusline - function! Function_Name_1(focus, byfname, regex, prev, item, next, marked) - " Arguments: - " | - " +- a:focus : The focus of the prompt: "prt" or "win". - " | - " +- a:byfname : In filename mode or in full path mode: "file" or "path". - " | - " +- a:regex : In regex mode: 1 or 0. - " | - " +- a:prev : The previous search mode. - " | - " +- a:item : The current search mode. - " | - " +- a:next : The next search mode. - " | - " +- a:marked : The number of marked files, or a comma separated list of - " the marked filenames. - - return full_statusline - endfunction - - " Progress statusline - function! Function_Name_2(str) - " a:str : Either the number of files scanned so far, or a string indicating - " the current directory is being scanned with a user_command. - - return full_statusline - endfunction -< -See https://gist.github.com/1610859 for a working example. - - *'g:ctrlp_buffer_func'* -Specify the functions that will be called after entering and before exiting the -CtrlP buffer: > - let g:ctrlp_buffer_func = {} -< -Example: > - let g:ctrlp_buffer_func = { - \ 'enter': 'Function_Name_1', - \ 'exit': 'Function_Name_2', - \ } -< - - *'g:ctrlp_match_func'* -Set an external fuzzy matching function for CtrlP to use: > - let g:ctrlp_match_func = {} -< -Example: > - let g:ctrlp_match_func = { 'match': 'Function_Name' } -< -Structure of the function: > - function! Function_Name(items, str, limit, mmode, ispath, crfile, regex) - " Arguments: - " | - " +- a:items : The full list of items to search in. - " | - " +- a:str : The string entered by the user. - " | - " +- a:limit : The max height of the match window. Can be used to limit - " | the number of items to return. - " | - " +- a:mmode : The match mode. Can be one of these strings: - " | + "full-line": match the entire line. - " | + "filename-only": match only the filename. - " | + "first-non-tab": match until the first tab char. - " | + "until-last-tab": match until the last tab char. - " | - " +- a:ispath : Is 1 when searching in file, buffer, mru, mixed, dir, and - " | rtscript modes. Is 0 otherwise. - " | - " +- a:crfile : The file in the current window. Should be excluded from the - " | results when a:ispath == 1. - " | - " +- a:regex : In regex mode: 1 or 0. - - return list_of_matched_items - endfunction -< - -Note: you can extend any of the above options with { 'arg_type': 'dict' } to -enable passing all the function arguments in a single Dictionary argument. Use -the existing argument names as keys in this Dictionary. - -Example: > - let g:ctrlp_status_func = { - \ 'arg_type' : 'dict', - \ 'enter': 'Function_Name_1', - \ 'exit': 'Function_Name_2', - \ } - - function! Function_Name_1(dict) - " where dict == { - " \ 'focus': value, - " \ 'byfname': value, - " \ 'regex': value, - " \ ... - " } - endfunction -< - *'g:ctrlp_brief_prompt'* -When this is set to 1, the on empty prompt exit CtrlP. - - *ctrlp-default-value* -Otherwise, you can use below to change default value. -Example: > - let g:ctrlp_path_nolim = 1 - -This is possible to change no-limit mode for match type "path". - -=============================================================================== -COMMANDS *ctrlp-commands* - - *:CtrlP* -:CtrlP [starting-directory] - Open CtrlP in find file mode. - - If no argument is given, the value of |g:ctrlp_working_path_mode| will be - used to determine the starting directory. See |:CtrlPCurFile| and - |:CtrlPCurWD| to temporarily override the setting. - - You can use to auto-complete the [starting-directory] when typing it. - - *:CtrlPBuffer* -:CtrlPBuffer - Open CtrlP in find buffer mode. - - *:CtrlPCurFile* -:CtrlPCurFile - This acts like |:CtrlP| with |g:ctrlp_working_path_mode| = '' and ignores - the variable's current value. - - *:CtrlPCurWD* -:CtrlPCurWD - This acts like |:CtrlP| with |g:ctrlp_working_path_mode| = '' and ignores - the variable's current value. - - *:CtrlPMRU* -:CtrlPMRU - Open CtrlP in find Most-Recently-Used file mode. - - *:CtrlPLastMode* -:CtrlPLastMode [--dir] - Open CtrlP in the last mode used. When having the "--dir" argument, also - reuse the last working directory. - - *:CtrlPRoot* -:CtrlPRoot - This acts like |:CtrlP| with |g:ctrlp_working_path_mode| = 'r' and ignores - the variable's current value. - - *:CtrlPClearCache* -:CtrlPClearCache - Flush the cache for the current working directory. The same as pressing - inside CtrlP. - To enable or disable caching, use the |g:ctrlp_use_caching| option. - - *:CtrlPClearAllCaches* -:CtrlPClearAllCaches - Delete all the cache files saved in |g:ctrlp_cache_dir| location. - -------------------------------------------------------------------------------- -For commands provided by bundled extensions, see |ctrlp-extensions|. - -=============================================================================== -MAPPINGS *ctrlp-mappings* - - *'ctrlp-'* - - Default |Normal| mode mapping to open the CtrlP prompt in find file mode. - ----------------------------------------- -Once inside the prompt:~ - - - Toggle between full-path search and filename only search. - Note: in filename mode, the prompt's base is '>d>' instead of '>>>' - - *'ctrlp-fullregexp'* - Toggle between the string mode and full regexp mode. - Note: in full regexp mode, the prompt's base is 'r>>' instead of '>>>' - - See also: |input-formats| (guide) and |g:ctrlp_regexp_search| (option). - - , 'forward' - - Scroll to the 'next' search mode in the sequence. - - , 'backward' - - Scroll to the 'previous' search mode in the sequence. - - *'ctrlp-autocompletion'* - Auto-complete directory names under the current working directory inside - the prompt. - - - Toggle the focus between the match window and the prompt. - - , - , - - Exit CtrlP. - -Moving:~ - - , - - Move selection down. - - , - - Move selection up. - - - Move the cursor to the 'start' of the prompt. - - - Move the cursor to the 'end' of the prompt. - - , - , - - Move the cursor one character to the 'left'. - - , - - Move the cursor one character to the 'right'. - -Editing:~ - - , - - Delete the preceding character. - - - Delete the current character. - - - Delete a preceding inner word. - - - Clear the input field. - -Browsing input history:~ - - - Next string in the prompt's history. - - - Previous string in the prompt's history. - -Opening/Creating a file:~ - - - Open the selected file in the 'current' window if possible. - - - Open the selected file in a new 'tab'. - - - Open the selected file in a 'vertical' split. - - , - , - - Open the selected file in a 'horizontal' split. - - - Create a new file and its parent directories. - -Opening multiple files:~ - - - - Mark/unmark a file to be opened with . - - Mark/unmark a file to create a new file in its directory using . - - - - Open files marked by . - - When no file has been marked by , open a console dialog with the - following options: - - Open the selected file: - t - in a tab page. - v - in a vertical split. - h - in a horizontal split. - r - in the current window. - i - as a hidden buffer. - x - (optional) with the function defined in |g:ctrlp_open_func|. - - Other options (not shown): - a - mark all files in the match window. - d - change CtrlP's local working directory to the selected file's - directory and switch to find file mode. - -Function keys:~ - - - - Refresh the match window and purge the cache for the current directory. - - Remove deleted files from the MRU list. - - - MRU mode: - - Wipe the list. - - Delete entries marked by . - Buffer mode: - - Delete entry under the cursor or delete multiple entries marked by . - - -Pasting:~ - - , *'ctrlp-pasting'* - - Paste the clipboard content into the prompt. - - - Open a console dialog to paste , , the content of the search - register, the last visual selection, the clipboard or any register into the - prompt. - -Choose your own mappings with |g:ctrlp_prompt_mappings|. - ----------------------------------------- -When inside the match window (press to switch):~ - - a-z - 0-9 - ~^-=;`',.+!@#$%&_(){}[] - Cycle through the lines which have the matching first character. - -=============================================================================== -INPUT FORMATS *ctrlp-input-formats* - -Formats for inputting in the prompt:~ - -a) Simple string. - - E.g. 'abc' is understood internally as 'a[^a]\{-}b[^b]\{-}c' - -b) When in regexp mode, the input string's treated as a Vim's regexp |pattern| - without any modification. - - E.g. 'abc\d*efg' will be read as 'abc\d*efg'. - - See |ctrlp-fullregexp| (keymap) and |g:ctrlp_regexp_search| (option) for - how to enable regexp mode. - -c) End the string with a colon ':' followed by a Vim command to execute that - command after opening the file. If you need to use ':' literally, escape it - with a backslash: '\:'. When opening multiple files, the command will be - executed on each opening file. - - E.g. Use ':45' to jump to line 45. - - Use ':/any\:string' to jump to the first instance of 'any:string'. - - Use ':+setf\ myfiletype|50' to set the filetype to 'myfiletype', then - jump to line 50. - - Use ':diffthis' when opening multiple files to run |:diffthis| on the - first 4 files. - - See also: Vim's |++opt| and |+cmd|. - -d) Submit two dots '..' to go upward the directory tree by 1 level. To go up - multiple levels, use one extra dot for each extra level: -> - Raw input Interpreted as - .. ../ - ... ../../ - .... ../../../ -< - Note: if the parent directories are large and uncached, this can be slow. - - You can also use '@cd path/' to change CtrlP's local working directory. - Use '@cd %:h' to change to the directory of the current file. - -e) Similarly, submit '/' or '\' to find and go to the project's root. - - If the project is large, using a VCS listing command to look for files - might help speeding up the initial scan (see |g:ctrlp_user_command| for more - details). - - Note: d) and e) only work in file, directory and mixed modes. - -f) Type the name of a non-existent file and press to create it. Mark a - file with to create the new file in the same directory as the marked - file. - - E.g. Using 'newdir/newfile.txt' will create a directory named 'newdir' as - well as a file named 'newfile.txt'. - - If an entry 'some/old/dirs/oldfile.txt' is marked with , then - 'newdir' and 'newfile.txt' will be created under 'some/old/dirs'. The - final path will then be 'some/old/dirs/newdir/newfile.txt'. - - Note: use '\' in place of '/' on Windows (if |'shellslash'| is not set). - -g) In filename mode (toggle with ), you can use one primary pattern and - one refining pattern separated by a semicolon. Both patterns work like (a), - or (b) when in regexp mode. - -h) Submit ? to open this help file. - -=============================================================================== -EXTENSIONS *ctrlp-extensions* - -Extensions are optional. To enable an extension, add its name to the variable -g:ctrlp_extensions: > - let g:ctrlp_extensions = ['tag', 'buffertag', 'quickfix', 'dir', 'rtscript', - \ 'undo', 'line', 'changes', 'mixed', 'bookmarkdir'] -< -The order of the items will be the order they appear on the statusline and when -using , . - -Available extensions:~ - - *:CtrlPTag* - * Tag mode:~ - - Name: 'tag' - - Command: ":CtrlPTag" - - Search for a tag within a generated central tags file, and jump to the - definition. Use the Vim's option |'tags'| to specify the names and the - locations of the tags file(s). - E.g. set tags+=doc/tags - - *:CtrlPBufTag* - *:CtrlPBufTagAll* - * Buffer Tag mode:~ - - Name: 'buffertag' - - Commands: ":CtrlPBufTag [buffer]", - ":CtrlPBufTagAll". - - Search for a tag within the current buffer or all listed buffers and jump - to the definition. Requires |exuberant_ctags| or compatible programs. - - *:CtrlPQuickfix* - * Quickfix mode:~ - - Name: 'quickfix' - - Command: ":CtrlPQuickfix" - - Search for an entry in the current quickfix errors and jump to it. - - *:CtrlPDir* - * Directory mode:~ - - Name: 'dir' - - Command: ":CtrlPDir [starting-directory]" - - Search for a directory and change the working directory to it. - - Mappings: - + change the local working directory for CtrlP and keep it open. - + change the global working directory (exit). - + change the local working directory for the current window (exit). - + change the global working directory to CtrlP's current local - working directory (exit). - - *:CtrlPRTS* - * Runtime script mode:~ - - Name: 'rtscript' - - Command: ":CtrlPRTS" - - Search for files (vimscripts, docs, snippets...) in runtimepath. - - *:CtrlPUndo* - * Undo mode:~ - - Name: 'undo' - - Command: ":CtrlPUndo" - - Browse undo history. - - *:CtrlPLine* - * Line mode:~ - - Name: 'line' - - Command: ":CtrlPLine [buffer]" - - Search for a line in all listed buffers or in the specified [buffer]. - - *:CtrlPChange* - *:CtrlPChangeAll* - * Change list mode:~ - - Name: 'changes' - - Commands: ":CtrlPChange [buffer]", - ":CtrlPChangeAll". - - Search for and jump to a recent change in the current buffer or in all - listed buffers. - - *:CtrlPMixed* - * Mixed mode:~ - - Name: 'mixed' - - Command: ":CtrlPMixed" - - Search in files, buffers and MRU files at the same time. - - *:CtrlPBookmarkDir* - *:CtrlPBookmarkDirAdd* - * BookmarkDir mode:~ - - Name: 'bookmarkdir' - - Commands: ":CtrlPBookmarkDir", - ":CtrlPBookmarkDirAdd [directory] [TITLE]". - ":CtrlPBookmarkDirAdd! [directory] [TITLE]". - - - Search for a bookmarked directory and change the working directory to it. - - Add either the dir [directory], if supplied, or otherwise ask for it, - under the title given by either [TITLE], if supplied, or otherwise ask for - it, to the CtrlPBookmarkDir list. - - Add either the dir [directory], if supplied, or otherwise the current - work dir ( [CWD] ) under the title given by either [TITLE], if supplied, - or otherwise [CWD] to the CtrlPBookmarkDir list. - - The last command can be used to add all recently used work dirs to the - CtrlPBookmarkDir list by an autocommand like - - > - augroup CtrlPDirMRU - autocmd! - autocmd FileType * if &modifiable | execute 'silent CtrlPBookmarkDirAdd! %:p:h' | endif - augroup END -< - - - Mappings: - + change the local working directory for CtrlP, keep it open and - switch to find file mode. - + change the global working directory (exit). - + change the local working directory for the current window (exit). - + - - Wipe bookmark list. - - Delete entries marked by . - - *ctrlp-autoignore-extension* - * Autoignore mode:~ - - Name: 'autoignore' - - - This extension doesn't add new commands. It adds support for per-project - ignore patterns (as per |ctrlp_custom_ignore|) via a `.ctrlpignore` file - at the root of the project. It's basically like a `.gitignore` or - `.hgignore` for CtrlP. - - Note: auto-ignore won't work when |g:ctrlp_user_command| is used. - - Note: `.ctrlpignore` will be added to the root markers (see - |g:ctrlp_root_markers|). - - - Ignore file syntax: - Empty lines, and lines starting with `#` (comments) are ignored. - - Other lines are treated like regular expression patterns. See *string-match* - for how patterns are used. Anything that matches any of the patterns will be - ignored from CtrlP's search results. - - Example: - - \.tmp$ - ^generated/ - local\.cfg - - Note: patterns should use forward slashes, even on Windows. - - You can also switch to a glob-like syntax like this: - - syntax:wildignore - *.tar.gz - *.tmp - - This will temporarily add each pattern to |'wildignore'| for the - duration of the file scan, and remove them at the end. - - You can switch back to the default regular-expression-based patterns by - writing: - - syntax:regexp - - You can also specify a match on only a given type of item: - - dir:build - file:foo\.txt - - This will only ignore directories with "build" in them, and files with - "foo.txt" in them. Not files with "build" in them or vice-versa. - - Note: to ignore a root directory "build", and not _any_ directory with - "build" in it, you can root the regex: ^build$ - - - FAQ: - Q: Why can't CtrlP support `.gitignore` or `.hgignore` natively? - - A: Those files look at first like they may contain all the patterns - you'd want to exclude from CtrlP already. However, more often than not, - there are some differences. Those files list patterns that should not be - included in source-control. This includes things you want to ignore, but - also things you may not want to: local settings, external packages and - dependencies, etc. The author felt the trouble of supporting various - syntaxes was too much compared to just copy/pasting a few lines. Feel - free to contribute a patch if you disagree :) - - Q: I enabled |ctrlp-autoignore-extension|, or edited `.ctrlpignore`, but - none of the new patterns are working. What did I do wrong? - - A: Probably nothing! CtrlP can cache search results for faster response - times. You can hit to force it to refresh. This will use the newer - ignore patterns if the `.ctrlpignore` file has changed, too. - - ----------------------------------------- -Buffer Tag mode options:~ - - *'g:ctrlp_buftag_ctags_bin'* -If ctags isn't in your $PATH, or a ctags binary exists in either -/opt/local/bin or /usr/local/bin, us this to set its location: > - let g:ctrlp_buftag_ctags_bin = '' -< - - *'g:ctrlp_buftag_systemenc'* -Match this with your OS's encoding (not Vim's). The default value mirrors Vim's -global |'encoding'| option: > - let g:ctrlp_buftag_systemenc = &encoding -< - - *'g:ctrlp_buftag_types'* -Use this to set the arguments for ctags, jsctags... for a given filetype: > - let g:ctrlp_buftag_types = '' -< -Examples: > - let g:ctrlp_buftag_types = { - \ 'erlang' : '--language-force=erlang --erlang-types=drmf', - \ 'javascript' : { - \ 'bin': 'jsctags', - \ 'args': '-f -', - \ }, - \ } -< - -=============================================================================== -CUSTOMIZATION *ctrlp-customization* - -Highlighting:~ - * For the CtrlP buffer: - CtrlPNoEntries : the message when no match is found (Error) - CtrlPMatch : the matched pattern (Identifier) - CtrlPLinePre : the line prefix '>' in the match window - CtrlPPrtBase : the prompt's base (Comment) - CtrlPPrtText : the prompt's text (|hl-Normal|) - CtrlPPrtCursor : the prompt's cursor when moving over the text (Constant) - - * Buffer explorer mode: - CtrlPBufferNr : buffer number - CtrlPBufferInd : '+', '-', '=' and '#' indicators (see |:buffers|) - CtrlPBufferHid : hidden buffer - CtrlPBufferHidMod : hidden and modified buffer - CtrlPBufferVis : visible buffer - CtrlPBufferVisMod : visible and modified buffer - CtrlPBufferCur : current buffer - CtrlPBufferCurMod : current and modified buffer - CtrlPBufferPath : buffer path - - * In extensions: - CtrlPTabExtra : the part of each line that's not matched against (Comment) - CtrlPBufName : the buffer name an entry belongs to (|hl-Directory|) - CtrlPTagKind : the kind of the tag in buffer-tag mode (|hl-Title|) - CtrlPqfLineCol : the line and column numbers in quickfix mode (Comment) - CtrlPUndoT : the elapsed time in undo mode (|hl-Directory|) - CtrlPUndoBr : the square brackets [] in undo mode (Comment) - CtrlPUndoNr : the undo number inside [] in undo mode (String) - CtrlPUndoSv : the point where the file was saved (Comment) - CtrlPUndoPo : the current position in the undo tree (|hl-Title|) - CtrlPBookmark : the name of the bookmark (Identifier) - -Statuslines:~ - * Highlight groups: - CtrlPMode1 : 'file' or 'path' or 'line', and the current mode (Character) - CtrlPMode2 : 'prt' or 'win', 'regex', the working directory (|hl-LineNr|) - CtrlPStats : the scanning status (Function) - - For rebuilding the statuslines, see |g:ctrlp_status_func|. - -=============================================================================== -MISCELLANEOUS CONFIGS *ctrlp-miscellaneous-configs* - -* Using |wildignore| for |g:ctrlp_user_command|: -> - function! s:wig2cmd() - " Change wildignore into space or | separated groups - " e.g. .aux .out .toc .jpg .bmp .gif - " or .aux$\|.out$\|.toc$\|.jpg$\|.bmp$\|.gif$ - let pats = ['[*\/]*\([?_.0-9A-Za-z]\+\)\([*\/]*\)\(\\\@) - -* A standalone function to set the working directory to the project's root, or - to the parent directory of the current file if a root can't be found: -> - function! s:setcwd() - let cph = expand('%:p:h', 1) - if cph =~ '^.\+://' | retu | en - for mkr in ['.git/', '.hg/', '.svn/', '.bzr/', '_darcs/', '.vimprojects'] - let wd = call('find'.(mkr =~ '/$' ? 'dir' : 'file'), [mkr, cph.';']) - if wd != '' | let &acd = 0 | brea | en - endfo - exe 'lc!' fnameescape(wd == '' ? cph : substitute(wd, mkr.'$', '.', '')) - endfunction - - autocmd BufEnter * call s:setcwd() -< -(requires Vim 7.1.299+) - -* Using a |count| to invoke different commands using the same mapping: -> - let g:ctrlp_cmd = 'exe "CtrlP".get(["", "Buffer", "MRU"], v:count)' -< - -=============================================================================== -CREDITS *ctrlp-credits* - -Originally developed by Kien Nguyen . Now maintained by the -members of the ctrlpvim Github organisation -(https://github.com/orgs/ctrlpvim/people). Distributed under Vim's |license|. - -Project's homepage: http://ctrlpvim.github.com/ctrlp.vim -Git repository: https://github.com/ctrlpvim/ctrlp.vim - -------------------------------------------------------------------------------- -Thanks to everyone that has submitted ideas, bug reports or helped debugging on -gibhub, bitbucket, and through email. - -Special thanks:~ - - * Woojong Koh - * Simon Ruderich - * Yasuhiro Matsumoto - * Ken Earley - * Kyo Nagashima - * Zak Johnson - * Diego Viola - * Piet Delport - * Thibault Duplessis - * Kent Sibilev - * Tacahiroy - * Luca Pette - * Seth Fowler - * Lowe Thiderman - * Christopher Fredén - * Zahary Karadjov - * Jo De Boeck - * Rudi Grinberg - * Timothy Mellor - * Sergey Vlasov - -=============================================================================== -CHANGELOG *ctrlp-changelog* - - * New option |g:ctrlp_custom_tag_files| to specify custom tag files. - * Accept 0 for g:ctrlp_match_window no-limited window size. - -Before 2016/11/28~ - - + New command: |YankLine()| to yank current line. - + New option: |g:ctrlp_types| to select builtin modes. - + New feature: asynchronized spawn of |g:ctrlp_user_command|. This enable - with set |g:user_command_async| to 1. - + Support buffertag for delphi, rust and golang. - + New option: |g:ctrlp_brief_prompt|, - |g:match_current_file|, - |g:ctrlp_compare_lim|. - + New feature: Auto-ignore extension. - + Support buffertag for ant, tex, dosbatch, matlab and vhdl. - + New option |g:ctrlp_line_prefix| for integrating third party plugins. - + New option |g:open_single_match| to open single file in matches. - + Add (ctrlp) for launch CtrlP. - + Accept bang for CtrlPBookmarkDirAdd to avoid confirm. - + Handle variable like "g:ctrlp_TYPE_MODE". - ex: let g:ctrlp_path_sort - + New option: |g:ctrlp_custom_ancestors| - -Before 2014/08/08~ - - + New buffer explorer mode with highlighting (|+conceal| recommended) - + New options: |g:ctrlp_bufname_mod|, - |g:ctrlp_bufpath_mod| - + Combine *g:ctrlp_match_window_bottom* *g:ctrlp_match_window_reversed* and - *g:ctrlp_max_height* into |g:ctrlp_match_window|. - + New option: |g:ctrlp_match_window|. - -Before 2012/11/30~ - - + New options: |g:ctrlp_abbrev|, - |g:ctrlp_key_loop|, - |g:ctrlp_open_func|, - |g:ctrlp_tabpage_position|, - |g:ctrlp_mruf_save_on_update| - + Rename: - *g:ctrlp_dotfiles* -> |g:ctrlp_show_hidden|. - + Change |g:ctrlp_switch_buffer|'s and |g:ctrlp_working_path_mode|'s type - (old values still work). - + New key for |g:ctrlp_user_command| when it's a Dictionary: 'ignore'. - -Before 2012/06/15~ - - + New value for |g:ctrlp_follow_symlinks|: 2. - + New value for |g:ctrlp_open_multiple_files|: 'j'. - + Allow using , , to open files marked by . - + Extend '..' (|ctrlp-input-formats| (d)) - + New input format: '@cd' (|ctrlp-input-formats| (d)) - -Before 2012/04/30~ - - + New option: |g:ctrlp_mruf_default_order| - + New feature: Bookmarked directories extension. - + New commands: |:CtrlPBookmarkDir| - |:CtrlPBookmarkDirAdd| - -Before 2012/04/15~ - - + New option: |g:ctrlp_buffer_func|, callback functions for CtrlP buffer. - + Remove: g:ctrlp_mruf_last_entered, make it a default for MRU mode. - + New commands: |:CtrlPLastMode|, open CtrlP in the last mode used. - |:CtrlPMixed|, search in files, buffers and MRU files. - -Before 2012/03/31~ - - + New options: |g:ctrlp_default_input|, default input when entering CtrlP. - |g:ctrlp_match_func|, allow using a custom fuzzy matcher. - + Rename: - *ClearCtrlPCache* -> |CtrlPClearCache| - *ClearAllCtrlPCaches* -> |CtrlPClearAllCaches| - *ResetCtrlP* -> |CtrlPReload| - -Before 2012/03/02~ - - + Rename: - *g:ctrlp_regexp_search* -> |g:ctrlp_regexp|, - *g:ctrlp_dont_split* -> |g:ctrlp_reuse_window|, - *g:ctrlp_jump_to_buffer* -> |g:ctrlp_switch_buffer|. - + Rename and tweak: - *g:ctrlp_open_multi* -> |g:ctrlp_open_multiple_files|. - + Deprecate *g:ctrlp_highlight_match* - + Extend |g:ctrlp_user_command| to support multiple commands. - + New option: |g:ctrlp_mruf_last_entered| change MRU to Recently-Entered. - -Before 2012/01/15~ - - + New mapping: Switch and . is now used for completion - of directory names under the current working directory. - + New options: |g:ctrlp_arg_map| for , to accept an argument. - |g:ctrlp_status_func| custom statusline. - |g:ctrlp_mruf_relative| show only MRU files inside cwd. - + Extend g:ctrlp_open_multi with new optional values: tr, hr, vr. - + Extend |g:ctrlp_custom_ignore| to specifically filter dir, file and link. - -Before 2012/01/05~ - - + New feature: Buffer Tag extension. - + New commands: |:CtrlPBufTag|, |:CtrlPBufTagAll|. - + New options: |g:ctrlp_cmd|, - |g:ctrlp_custom_ignore| - -Before 2011/11/30~ - - + New features: Tag, Quickfix and Directory extensions. - + New commands: |:CtrlPTag|, |:CtrlPQuickfix|, |:CtrlPDir|. - + New options: |g:ctrlp_use_migemo|, - |g:ctrlp_lazy_update|, - |g:ctrlp_follow_symlinks| - -Before 2011/11/13~ - - + New special input: '/' and '\' find root (|ctrlp-input-formats| (e)) - + Remove ctrlp#SetWorkingPath(). - + Remove *g:ctrlp_mru_files* and make MRU mode permanent. - + Extend g:ctrlp_open_multi, add new ways to open files. - + New option: g:ctrlp_dont_split, - |g:ctrlp_mruf_case_sensitive| - -Before 2011/10/30~ - - + New feature: Support for custom extensions. - also removes non-existent files from MRU list. - + New option: g:ctrlp_jump_to_buffer - -Before 2011/10/12~ - - + New features: Open multiple files. - Pass Vim's |++opt| and |+cmd| to the opening file - (|ctrlp-input-formats| (c)) - Auto-complete each dir for |:CtrlP| [starting-directory] - + New mappings: mark/unmark a file to be opened with . - open all marked files. - + New option: g:ctrlp_open_multi - + Remove *g:ctrlp_persistent_input* *g:ctrlp_live_update* and . - -Before 2011/09/29~ - - + New mappings: , next/prev string in the input history. - create a new file and its parent dirs. - + New options: |g:ctrlp_open_new_file|, - |g:ctrlp_max_history| - + Added a new open-in-horizontal-split mapping: - -Before 2011/09/19~ - - + New command: ResetCtrlP - + New options: |g:ctrlp_max_files|, - |g:ctrlp_max_depth|, - g:ctrlp_live_update - + New mapping: - -Before 2011/09/12~ - - + Ability to cycle through matched lines in the match window. - + Extend the behavior of g:ctrlp_persistent_input - + Extend the behavior of |:CtrlP| - + New options: |g:ctrlp_dotfiles|, - |g:ctrlp_clear_cache_on_exit|, - g:ctrlp_highlight_match, - |g:ctrlp_user_command| - + New special input: '..' (|ctrlp-input-formats| (d)) - + New mapping: . - + New commands: |:CtrlPCurWD|, - |:CtrlPCurFile|, - |:CtrlPRoot| - - + New feature: Search in most recently used (MRU) files - + New mapping: . - + Extended the behavior of . - + New options: g:ctrlp_mru_files, - |g:ctrlp_mruf_max|, - |g:ctrlp_mruf_exclude|, - |g:ctrlp_mruf_include| - + New command: |:CtrlPMRU| - -First public release: 2011/09/06~ - -=============================================================================== -vim:ft=help:et:ts=2:sw=2:sts=2:norl diff --git a/pack/acp/start/ctrlp.vim/plugin/ctrlp.vim b/pack/acp/start/ctrlp.vim/plugin/ctrlp.vim deleted file mode 100644 index f31b64a..0000000 --- a/pack/acp/start/ctrlp.vim/plugin/ctrlp.vim +++ /dev/null @@ -1,70 +0,0 @@ -" ============================================================================= -" File: plugin/ctrlp.vim -" Description: Fuzzy file, buffer, mru, tag, etc finder. -" Author: Kien Nguyen -" ============================================================================= -" 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 = '' | en -if !exists('g:ctrlp_cmd') | let g:ctrlp_cmd = 'CtrlP' | en - -com! -n=? -com=dir CtrlP cal ctrlp#init(0, { 'dir': }) -com! -n=? -com=dir CtrlPMRUFiles cal ctrlp#init('mru', { 'dir': }) - -com! -bar CtrlPBuffer cal ctrlp#init('buf') -com! -n=? CtrlPLastMode cal ctrlp#init(-1, { '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('fil', { 'mode': '' }) -com! -bar CtrlPCurFile cal ctrlp#init('fil', { 'mode': 'c' }) -com! -bar CtrlPRoot cal ctrlp#init('fil', { 'mode': 'r' }) - -exe 'nn (ctrlp) :'.g:ctrlp_cmd.'' - -if g:ctrlp_map != '' && !hasmapto('(ctrlp)') - exe 'map' g:ctrlp_map '(ctrlp)' -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=dir CtrlPDir - \ cal ctrlp#init(ctrlp#dir#id(), { 'dir': }) - -com! -n=? -com=buffer CtrlPBufTag - \ cal ctrlp#init(ctrlp#buffertag#cmd(0, )) - -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! -n=? -com=buffer CtrlPLine - \ cal ctrlp#init(ctrlp#line#cmd('buf', )) - -com! -n=? -com=buffer CtrlPChange - \ cal ctrlp#init(ctrlp#changes#cmd('fil', )) - -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=dir -bang CtrlPBookmarkDirAdd - \ cal ctrlp#call('ctrlp#bookmarkdir#add', '', ) - -" vim:ts=2:sw=2:sts=2 diff --git a/pack/acp/start/ctrlp.vim/readme.md b/pack/acp/start/ctrlp.vim/readme.md deleted file mode 100644 index 5412b6d..0000000 --- a/pack/acp/start/ctrlp.vim/readme.md +++ /dev/null @@ -1,105 +0,0 @@ -# ctrlp.vim -Full path fuzzy __file__, __buffer__, __mru__, __tag__, __...__ finder for Vim. - -* Written in pure Vimscript for MacVim, gVim and Vim 7.0+. -* Full support for Vim's regexp as search patterns. -* Built-in Most Recently Used (MRU) files monitoring. -* Built-in project's root finder. -* Open multiple files at once. -* Create new files and directories. -* [Extensible][2]. - -![ctrlp][1] - -## Basic Usage -* Run `:CtrlP` or `:CtrlP [starting-directory]` to invoke CtrlP in find file mode. -* Run `:CtrlPBuffer` or `:CtrlPMRU` to invoke CtrlP in find buffer or find MRU file mode. -* Run `:CtrlPMixed` to search in Files, Buffers and MRU files at the same time. - -Check `:help ctrlp-commands` and `:help ctrlp-extensions` for other commands. - -##### Once CtrlP is open: -* Press `` to purge the cache for the current directory to get new files, remove deleted files and apply new ignore options. -* Press `` and `` to cycle between modes. -* Press `` to switch to filename only search instead of full path. -* Press `` to switch to regexp mode. -* Use ``, `` or the arrow keys to navigate the result list. -* Use `` or ``, `` to open the selected entry in a new tab or in a new split. -* Use ``, `` to select the next/previous string in the prompt's history. -* Use `` to create a new file and its parent directories. -* Use `` to mark/unmark multiple files and `` to open them. - -Run `:help ctrlp-mappings` or submit `?` in CtrlP for more mapping help. - -* Submit two or more dots `..` to go up the directory tree by one or multiple levels. -* End the input string with a colon `:` followed by a command to execute it on the opening file(s): -Use `:25` to jump to line 25. -Use `:diffthis` when opening multiple files to run `:diffthis` on the first 4 files. - -## Basic Options -* Change the default mapping and the default command to invoke CtrlP: - - ```vim - let g:ctrlp_map = '' - let g:ctrlp_cmd = 'CtrlP' - ``` - -* When invoked without an explicit starting directory, CtrlP will set its local working directory according to this variable: - - ```vim - let g:ctrlp_working_path_mode = 'ra' - ``` - - `'c'` - the directory of the current file. - `'a'` - the directory of the current file, unless it is a subdirectory of the cwd - `'r'` - the nearest ancestor of the current file that contains one of these directories or files: `.git` `.hg` `.svn` `.bzr` `_darcs` - `'w'` - modifier to "r": start search from the cwd instead of the current file's directory - `0` or `''` (empty string) - disable this feature. - - If none of the default markers (`.git` `.hg` `.svn` `.bzr` `_darcs`) are present in a project, you can define additional ones with `g:ctrlp_root_markers`: - - ```vim - let g:ctrlp_root_markers = ['pom.xml', '.p4ignore'] - ``` - - If more than one mode is specified, they will be tried in order until a directory is located. - -* If a file is already open, open it again in a new pane instead of switching to the existing pane - - `let g:ctrlp_switch_buffer = 'et'` - -* Exclude files and directories using Vim's `wildignore` and CtrlP's own `g:ctrlp_custom_ignore`. If a custom listing command is being used, exclusions are ignored: - - ```vim - set wildignore+=*/tmp/*,*.so,*.swp,*.zip " MacOSX/Linux - set wildignore+=*\\tmp\\*,*.swp,*.zip,*.exe " Windows - - let g:ctrlp_custom_ignore = '\v[\/]\.(git|hg|svn)$' - let g:ctrlp_custom_ignore = { - \ 'dir': '\v[\/]\.(git|hg|svn)$', - \ 'file': '\v\.(exe|so|dll)$', - \ 'link': 'some_bad_symbolic_links', - \ } - ``` - -* Use a custom file listing command: - - ```vim - let g:ctrlp_user_command = 'find %s -type f' " MacOSX/Linux - let g:ctrlp_user_command = 'dir %s /-n /b /s /a-d' " Windows - ``` - -* Ignore files in `.gitignore` - - ```vim - let g:ctrlp_user_command = ['.git', 'cd %s && git ls-files -co --exclude-standard'] - ``` - -Check `:help ctrlp-options` for other options. - -## Installation -Use your favorite method or check the homepage for a [quick installation guide][3]. - -[1]: http://i.imgur.com/aOcwHwt.png -[2]: https://github.com/ctrlpvim/ctrlp.vim/tree/extensions -[3]: http://ctrlpvim.github.com/ctrlp.vim#installation diff --git a/pack/acp/start/neocomplete.vim/.github/ISSUE_TEMPLATE.md b/pack/acp/start/neocomplete.vim/.github/ISSUE_TEMPLATE.md deleted file mode 100644 index 5388e75..0000000 --- a/pack/acp/start/neocomplete.vim/.github/ISSUE_TEMPLATE.md +++ /dev/null @@ -1,31 +0,0 @@ -# Problems summary - - -## Expected - - -## Environment Information - * OS: - * Vim version: - - -## Provide a minimal .vimrc with less than 50 lines (Required!) - -```vim -" Your minimal .vimrc -set runtimepath+=~/path/to/neocomplete.nvim/ -let g:neocomplete#enable_at_startup = 1 -``` - - -## The reproduce ways from Vim starting (Required!) - - 1. foo - 2. bar - 3. baz - - -## Screen shot (if possible) - - -## Upload the log messages by `:redir` and `:message` diff --git a/pack/acp/start/neocomplete.vim/.gitignore b/pack/acp/start/neocomplete.vim/.gitignore deleted file mode 100644 index 926ccaa..0000000 --- a/pack/acp/start/neocomplete.vim/.gitignore +++ /dev/null @@ -1 +0,0 @@ -doc/tags diff --git a/pack/acp/start/neocomplete.vim/.travis.yml b/pack/acp/start/neocomplete.vim/.travis.yml deleted file mode 100644 index ea0d78f..0000000 --- a/pack/acp/start/neocomplete.vim/.travis.yml +++ /dev/null @@ -1,8 +0,0 @@ -sudo: false - -before_script: - - git clone https://github.com/syngan/vim-vimlint /tmp/vim-vimlint - - git clone https://github.com/ynkdir/vim-vimlparser /tmp/vim-vimlparser - -script: - - sh /tmp/vim-vimlint/bin/vimlint.sh -l /tmp/vim-vimlint -p /tmp/vim-vimlparser -e EVL103=1 -e EVL102.l:_=1 autoload diff --git a/pack/acp/start/neocomplete.vim/CONTRIBUTING.md b/pack/acp/start/neocomplete.vim/CONTRIBUTING.md deleted file mode 100644 index 07cd3f0..0000000 --- a/pack/acp/start/neocomplete.vim/CONTRIBUTING.md +++ /dev/null @@ -1,27 +0,0 @@ -# Problems summary - -## Expected - -## Environment Information - * OS: - * Vim version: - -## Minimal vimrc less than 50 lines - - " Your vimrc - set nocompatible - - set runtimepath+=~/path/to/neocomplete.vim/ - - set fo+=aw - let g:neocomplete#enable_at_startup = 1 - let g:neocomplete#enable_auto_select = 0 - set tw=10 " just for testing purposes - -## Reproducable ways from Vim starting - - 1. - 2. - 3. - -## Screen shot (if possible) diff --git a/pack/acp/start/neocomplete.vim/README.md b/pack/acp/start/neocomplete.vim/README.md deleted file mode 100644 index 93f6435..0000000 --- a/pack/acp/start/neocomplete.vim/README.md +++ /dev/null @@ -1,197 +0,0 @@ -neocomplete -=========== - -neocomplete is the abbreviation of "neo-completion with cache". It provides -keyword completion system by maintaining a cache of keywords in the current -buffer. neocomplete can be customized easily and has many more features than -Vim's built-in completion. - -Note: If you use neovim, you should use deoplete instead. -https://github.com/Shougo/deoplete.nvim - -## Installation - -**Note:** neocomplete requires Vim 7.3.885+ with Lua enabled. -See [requirements](#requirements) if you aren't sure whether you have this. - -1. Extract the files and put them in your Vim directory - (usually `~/.vim/` or `Program Files/Vim/vimfiles` on Windows). -2. Execute the `:NeoCompleteEnable` command or set `let g:neocomplete#enable_at_startup = 1` - in your `.vimrc` (**not** in `.gvimrc` or `_gvimrc`!) - -## Requirements - -neocomplete requires Vim 7.3.885+ compiled with [if\_lua](http://vimdoc.sourceforge.net/htmldoc/if_lua.html). -If `:echo has("lua")` returns `1`, then you're done; otherwise, see below. - -### Vim builds for Windows - - [github release](https://github.com/vim/vim-win32-installer/releases) -* [Vim 32bit](http://files.kaoriya.net/goto/vim73w32) -* [Vim 64bit](http://files.kaoriya.net/goto/vim73w64) -* [Vim 32bit alternative](http://tuxproject.de/projects/vim/) -* [Another alternative](http://wyw.dcweb.cn/#download) - -**Note:** the Vim build may not include the Lua DLL. In that case, -[download Lua](http://lua-users.org/wiki/LuaBinaries) and put the `lua52.dll` -file in the same directory as `gvim.exe`. - -### Vim for Mac OS X: - -[MacVim with `if\_lua`](https://github.com/zhaocai/macvim) - -Or, you can install MacVim with homebrew: - - brew install macvim --with-cscope --with-lua - brew linkapps macvim - -To install Vim (as opposed to MacVim) with homebrew: - - brew install vim --with-lua - -### Vim for Linux: - -#### Debian (or Ubuntu) - -Make sure you have any of these packages: -* vim-nox -* vim-gtk -* vim-gnome -* vim-athena - -Which package depends on your graphical environment (except vim-nox which is for vim with no GUI). - -#### Fedora - -The latest version of vim includes lua. -As of 2014-04-16 you need to [download the rpm](http://koji.fedoraproject.org/koji/packageinfo?packageID=216). - -#### Misc - -Be aware, your distribution's package manager may have a fairly outdated -Vim build (for example, Ubuntu 12.04 ships Vim 7.3.429). -However, [building Vim](http://vim.wikia.com/wiki/Building_Vim) on Linux is not difficult. -Remember to specify `--with-lua` (or `--with-features=huge`). - -### Vim for Cygwin: - -In a cygwin environment, the Lua interface is supported by default. - -If you want to make manually, you also need gcc and make. - -When everything is prepared, execute these commands. - - cd /usr/src - tar jxf vim-7.4.tar.bz2 - tar xvfz lua-5.1.5.tar.gz - cd vim74/ - ./configure --enable-luainterp --enable-gui=no \ - --without-x --enable-multibyte --prefix=/usr - make && make install - -To check if everything was successfull enter the following `vim --version`. You should see ` +lua` in the list of features. - -## Snippets - -The Snippets feature of neocomplete was split into a -[separate plugin](https://github.com/Shougo/neosnippet). - -A migration guide for existing users of neocomplcache is available: -[Migration guide](https://github.com/Shougo/neocomplete.vim/wiki/neocomplete-migration-guide) - - -## Screenshots - -### Original filename completion - -![Original filename completion.](https://f.cloud.github.com/assets/41495/622454/f519f6b8-cf42-11e2-921e-6e34dba148a6.png) -![Include filename completion.](https://f.cloud.github.com/assets/214488/623151/284ad86e-cf5b-11e2-828e-257d31bf0572.png) - -### Omni completion - -![Omni completion.](https://f.cloud.github.com/assets/41495/622456/fb2cc0bc-cf42-11e2-94e8-403cdcf5427e.png) - -### Completion with [vimshell](http://github.com/Shougo/vimshell) - -![Completion with vimshell(http://github.com/Shougo/vimshell).](https://f.cloud.github.com/assets/41495/622458/01dbc660-cf43-11e2-85f1-326e7432b0a1.png) - -### Vim completion (provided by [neco-vim](https://github.com/Shougo/neco-vim)) - -![Vim completion.](https://f.cloud.github.com/assets/41495/622457/fe90ad5e-cf42-11e2-8e03-8f189b5e26e5.png) -![Vim completion with animation.](https://f.cloud.github.com/assets/214488/623496/94ed19a2-cf68-11e2-8d33-3aad8a39d7c1.gif) - - -## Configuration Examples - -```vim -"Note: This option must be set in .vimrc(_vimrc). NOT IN .gvimrc(_gvimrc)! -" Disable AutoComplPop. -let g:acp_enableAtStartup = 0 -" Use neocomplete. -let g:neocomplete#enable_at_startup = 1 -" Use smartcase. -let g:neocomplete#enable_smart_case = 1 -" Set minimum syntax keyword length. -let g:neocomplete#sources#syntax#min_keyword_length = 3 - -" Define dictionary. -let g:neocomplete#sources#dictionary#dictionaries = { - \ 'default' : '', - \ 'vimshell' : $HOME.'/.vimshell_hist', - \ 'scheme' : $HOME.'/.gosh_completions' - \ } - -" Define keyword. -if !exists('g:neocomplete#keyword_patterns') - let g:neocomplete#keyword_patterns = {} -endif -let g:neocomplete#keyword_patterns['default'] = '\h\w*' - -" Plugin key-mappings. -inoremap neocomplete#undo_completion() -inoremap neocomplete#complete_common_string() - -" Recommended key-mappings. -" : close popup and save indent. -inoremap =my_cr_function() -function! s:my_cr_function() - return (pumvisible() ? "\" : "" ) . "\" - " For no inserting key. - "return pumvisible() ? "\" : "\" -endfunction -" : completion. -inoremap pumvisible() ? "\" : "\" -" , : close popup and delete backword char. -inoremap neocomplete#smart_close_popup()."\" -inoremap neocomplete#smart_close_popup()."\" -" Close popup by . -"inoremap pumvisible() ? "\" : "\" - -" AutoComplPop like behavior. -"let g:neocomplete#enable_auto_select = 1 - -" Shell like behavior(not recommended). -"set completeopt+=longest -"let g:neocomplete#enable_auto_select = 1 -"let g:neocomplete#disable_auto_complete = 1 -"inoremap pumvisible() ? "\" : "\\" - -" Enable omni completion. -autocmd FileType css setlocal omnifunc=csscomplete#CompleteCSS -autocmd FileType html,markdown setlocal omnifunc=htmlcomplete#CompleteTags -autocmd FileType javascript setlocal omnifunc=javascriptcomplete#CompleteJS -autocmd FileType python setlocal omnifunc=pythoncomplete#Complete -autocmd FileType xml setlocal omnifunc=xmlcomplete#CompleteTags - -" Enable heavy omni completion. -if !exists('g:neocomplete#sources#omni#input_patterns') - let g:neocomplete#sources#omni#input_patterns = {} -endif -"let g:neocomplete#sources#omni#input_patterns.php = '[^. \t]->\h\w*\|\h\w*::' -"let g:neocomplete#sources#omni#input_patterns.c = '[^.[:digit:] *\t]\%(\.\|->\)' -"let g:neocomplete#sources#omni#input_patterns.cpp = '[^.[:digit:] *\t]\%(\.\|->\)\|\h\w*::' - -" For perlomni.vim setting. -" https://github.com/c9s/perlomni.vim -let g:neocomplete#sources#omni#input_patterns.perl = '\h\w*->\h\w*\|\h\w*::' -``` diff --git a/pack/acp/start/neocomplete.vim/autoload/neocomplete.vim b/pack/acp/start/neocomplete.vim/autoload/neocomplete.vim deleted file mode 100644 index 3da1c8b..0000000 --- a/pack/acp/start/neocomplete.vim/autoload/neocomplete.vim +++ /dev/null @@ -1,329 +0,0 @@ -"============================================================================= -" FILE: neocomplete.vim -" AUTHOR: Shougo Matsushita -" 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 diff --git a/pack/acp/start/neocomplete.vim/autoload/neocomplete/async_cache.vim b/pack/acp/start/neocomplete.vim/autoload/neocomplete/async_cache.vim deleted file mode 100644 index 5b4516e..0000000 --- a/pack/acp/start/neocomplete.vim/autoload/neocomplete/async_cache.vim +++ /dev/null @@ -1,276 +0,0 @@ -"============================================================================= -" FILE: async_cache.vim -" AUTHOR: Shougo Matsushita -" 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, "\", '', '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:], "\") - 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 ". - 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 ', '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 diff --git a/pack/acp/start/neocomplete.vim/autoload/neocomplete/cache.vim b/pack/acp/start/neocomplete.vim/autoload/neocomplete/cache.vim deleted file mode 100644 index 08e6c1b..0000000 --- a/pack/acp/start/neocomplete.vim/autoload/neocomplete/cache.vim +++ /dev/null @@ -1,298 +0,0 @@ -"============================================================================= -" FILE: cache.vim -" AUTHOR: Shougo Matsushita -" 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(''), ':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 diff --git a/pack/acp/start/neocomplete.vim/autoload/neocomplete/commands.vim b/pack/acp/start/neocomplete.vim/autoload/neocomplete/commands.vim deleted file mode 100644 index 211794f..0000000 --- a/pack/acp/start/neocomplete.vim/autoload/neocomplete/commands.vim +++ /dev/null @@ -1,100 +0,0 @@ -"============================================================================= -" FILE: commands.vim -" AUTHOR: Shougo Matsushita -" 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() -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 diff --git a/pack/acp/start/neocomplete.vim/autoload/neocomplete/complete.vim b/pack/acp/start/neocomplete.vim/autoload/neocomplete/complete.vim deleted file mode 100644 index ef3d130..0000000 --- a/pack/acp/start/neocomplete.vim/autoload/neocomplete/complete.vim +++ /dev/null @@ -1,348 +0,0 @@ -"============================================================================= -" FILE: complete.vim -" AUTHOR: Shougo Matsushita -" 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 - - if source.max_candidates > 0 - let words = words[: len(source.max_candidates)-1] - endif - - let words = neocomplete#helper#call_filters( - \ source.neocomplete__converters, source, {}) - - if empty(words) - continue - 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 context.candidates = source.gather_candidates(context) - 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 diff --git a/pack/acp/start/neocomplete.vim/autoload/neocomplete/context_filetype.vim b/pack/acp/start/neocomplete.vim/autoload/neocomplete/context_filetype.vim deleted file mode 100644 index 4cb7487..0000000 --- a/pack/acp/start/neocomplete.vim/autoload/neocomplete/context_filetype.vim +++ /dev/null @@ -1,67 +0,0 @@ -"============================================================================= -" FILE: context_filetype.vim -" AUTHOR: Shougo Matsushita -" 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 diff --git a/pack/acp/start/neocomplete.vim/autoload/neocomplete/custom.vim b/pack/acp/start/neocomplete.vim/autoload/neocomplete/custom.vim deleted file mode 100644 index f642563..0000000 --- a/pack/acp/start/neocomplete.vim/autoload/neocomplete/custom.vim +++ /dev/null @@ -1,54 +0,0 @@ -"============================================================================= -" FILE: custom.vim -" AUTHOR: Shougo Matsushita -" 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 diff --git a/pack/acp/start/neocomplete.vim/autoload/neocomplete/filters.vim b/pack/acp/start/neocomplete.vim/autoload/neocomplete/filters.vim deleted file mode 100644 index 4b68fd5..0000000 --- a/pack/acp/start/neocomplete.vim/autoload/neocomplete/filters.vim +++ /dev/null @@ -1,48 +0,0 @@ -"============================================================================= -" FILE: filters.vim -" AUTHOR: Shougo Matsushita -" 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 diff --git a/pack/acp/start/neocomplete.vim/autoload/neocomplete/filters/converter_abbr.vim b/pack/acp/start/neocomplete.vim/autoload/neocomplete/filters/converter_abbr.vim deleted file mode 100644 index 39a2b67..0000000 --- a/pack/acp/start/neocomplete.vim/autoload/neocomplete/filters/converter_abbr.vim +++ /dev/null @@ -1,66 +0,0 @@ -"============================================================================= -" FILE: converter_abbr.vim -" AUTHOR: Shougo Matsushita -" 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 diff --git a/pack/acp/start/neocomplete.vim/autoload/neocomplete/filters/converter_add_paren.vim b/pack/acp/start/neocomplete.vim/autoload/neocomplete/filters/converter_add_paren.vim deleted file mode 100644 index d635ed0..0000000 --- a/pack/acp/start/neocomplete.vim/autoload/neocomplete/filters/converter_add_paren.vim +++ /dev/null @@ -1,53 +0,0 @@ -"============================================================================= -" FILE: converter_add_paren.vim -" AUTHOR: Shougo Matsushita -" 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 diff --git a/pack/acp/start/neocomplete.vim/autoload/neocomplete/filters/converter_case.vim b/pack/acp/start/neocomplete.vim/autoload/neocomplete/filters/converter_case.vim deleted file mode 100644 index 9bcbe23..0000000 --- a/pack/acp/start/neocomplete.vim/autoload/neocomplete/filters/converter_case.vim +++ /dev/null @@ -1,80 +0,0 @@ -"============================================================================= -" FILE: converter_case.vim -" AUTHOR: Shougo Matsushita -" 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 diff --git a/pack/acp/start/neocomplete.vim/autoload/neocomplete/filters/converter_delimiter.vim b/pack/acp/start/neocomplete.vim/autoload/neocomplete/filters/converter_delimiter.vim deleted file mode 100644 index 1fd8b90..0000000 --- a/pack/acp/start/neocomplete.vim/autoload/neocomplete/filters/converter_delimiter.vim +++ /dev/null @@ -1,114 +0,0 @@ -"============================================================================= -" FILE: converter_delimiter.vim -" AUTHOR: Shougo Matsushita -" 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 diff --git a/pack/acp/start/neocomplete.vim/autoload/neocomplete/filters/converter_disable_abbr.vim b/pack/acp/start/neocomplete.vim/autoload/neocomplete/filters/converter_disable_abbr.vim deleted file mode 100644 index 4c1eab3..0000000 --- a/pack/acp/start/neocomplete.vim/autoload/neocomplete/filters/converter_disable_abbr.vim +++ /dev/null @@ -1,49 +0,0 @@ -"============================================================================= -" FILE: converter_disable_abbr.vim -" AUTHOR: Shougo Matsushita -" 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 diff --git a/pack/acp/start/neocomplete.vim/autoload/neocomplete/filters/converter_remove_last_paren.vim b/pack/acp/start/neocomplete.vim/autoload/neocomplete/filters/converter_remove_last_paren.vim deleted file mode 100644 index b53cbde..0000000 --- a/pack/acp/start/neocomplete.vim/autoload/neocomplete/filters/converter_remove_last_paren.vim +++ /dev/null @@ -1,50 +0,0 @@ -"============================================================================= -" FILE: converter_remove_last_paren.vim -" AUTHOR: Shougo Matsushita -" 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 diff --git a/pack/acp/start/neocomplete.vim/autoload/neocomplete/filters/converter_remove_overlap.vim b/pack/acp/start/neocomplete.vim/autoload/neocomplete/filters/converter_remove_overlap.vim deleted file mode 100644 index 7c42a4d..0000000 --- a/pack/acp/start/neocomplete.vim/autoload/neocomplete/filters/converter_remove_overlap.vim +++ /dev/null @@ -1,122 +0,0 @@ -"============================================================================= -" FILE: converter_overlap.vim -" AUTHOR: Shougo Matsushita -" 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 diff --git a/pack/acp/start/neocomplete.vim/autoload/neocomplete/filters/matcher_fuzzy.vim b/pack/acp/start/neocomplete.vim/autoload/neocomplete/filters/matcher_fuzzy.vim deleted file mode 100644 index 635d363..0000000 --- a/pack/acp/start/neocomplete.vim/autoload/neocomplete/filters/matcher_fuzzy.vim +++ /dev/null @@ -1,89 +0,0 @@ -"============================================================================= -" FILE: matcher_fuzzy.vim -" AUTHOR: Shougo Matsushita -" 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 diff --git a/pack/acp/start/neocomplete.vim/autoload/neocomplete/filters/matcher_head.vim b/pack/acp/start/neocomplete.vim/autoload/neocomplete/filters/matcher_head.vim deleted file mode 100644 index 01af9be..0000000 --- a/pack/acp/start/neocomplete.vim/autoload/neocomplete/filters/matcher_head.vim +++ /dev/null @@ -1,72 +0,0 @@ -"============================================================================= -" FILE: matcher_head.vim -" AUTHOR: Shougo Matsushita -" 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 diff --git a/pack/acp/start/neocomplete.vim/autoload/neocomplete/filters/matcher_length.vim b/pack/acp/start/neocomplete.vim/autoload/neocomplete/filters/matcher_length.vim deleted file mode 100644 index 4a68d21..0000000 --- a/pack/acp/start/neocomplete.vim/autoload/neocomplete/filters/matcher_length.vim +++ /dev/null @@ -1,63 +0,0 @@ -"============================================================================= -" FILE: matcher_length.vim -" AUTHOR: Shougo Matsushita -" 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 diff --git a/pack/acp/start/neocomplete.vim/autoload/neocomplete/filters/matcher_nothing.vim b/pack/acp/start/neocomplete.vim/autoload/neocomplete/filters/matcher_nothing.vim deleted file mode 100644 index 6e663fc..0000000 --- a/pack/acp/start/neocomplete.vim/autoload/neocomplete/filters/matcher_nothing.vim +++ /dev/null @@ -1,45 +0,0 @@ -"============================================================================= -" FILE: matcher_nothing.vim -" AUTHOR: Shougo Matsushita -" 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 diff --git a/pack/acp/start/neocomplete.vim/autoload/neocomplete/filters/sorter_filename.vim b/pack/acp/start/neocomplete.vim/autoload/neocomplete/filters/sorter_filename.vim deleted file mode 100644 index e1efaf9..0000000 --- a/pack/acp/start/neocomplete.vim/autoload/neocomplete/filters/sorter_filename.vim +++ /dev/null @@ -1,50 +0,0 @@ -"============================================================================= -" FILE: sorter_filename.vim -" AUTHOR: Shougo Matsushita -" 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 diff --git a/pack/acp/start/neocomplete.vim/autoload/neocomplete/filters/sorter_length.vim b/pack/acp/start/neocomplete.vim/autoload/neocomplete/filters/sorter_length.vim deleted file mode 100644 index 4875c99..0000000 --- a/pack/acp/start/neocomplete.vim/autoload/neocomplete/filters/sorter_length.vim +++ /dev/null @@ -1,53 +0,0 @@ -"============================================================================= -" FILE: sorter_length.vim -" AUTHOR: Shougo Matsushita -" 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 diff --git a/pack/acp/start/neocomplete.vim/autoload/neocomplete/filters/sorter_rank.vim b/pack/acp/start/neocomplete.vim/autoload/neocomplete/filters/sorter_rank.vim deleted file mode 100644 index def4a8f..0000000 --- a/pack/acp/start/neocomplete.vim/autoload/neocomplete/filters/sorter_rank.vim +++ /dev/null @@ -1,74 +0,0 @@ -"============================================================================= -" FILE: sorter_rank.vim -" AUTHOR: Shougo Matsushita -" 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 diff --git a/pack/acp/start/neocomplete.vim/autoload/neocomplete/filters/sorter_word.vim b/pack/acp/start/neocomplete.vim/autoload/neocomplete/filters/sorter_word.vim deleted file mode 100644 index ffe399b..0000000 --- a/pack/acp/start/neocomplete.vim/autoload/neocomplete/filters/sorter_word.vim +++ /dev/null @@ -1,49 +0,0 @@ -"============================================================================= -" FILE: sorter_word.vim -" AUTHOR: Shougo Matsushita -" 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 diff --git a/pack/acp/start/neocomplete.vim/autoload/neocomplete/handler.vim b/pack/acp/start/neocomplete.vim/autoload/neocomplete/handler.vim deleted file mode 100644 index 2a71736..0000000 --- a/pack/acp/start/neocomplete.vim/autoload/neocomplete/handler.vim +++ /dev/null @@ -1,367 +0,0 @@ -"============================================================================= -" FILE: handler.vim -" AUTHOR: Shougo Matsushita -" 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("\(neocomplete_auto_refresh)") - endif - - if neocomplete#is_cache_disabled() - return - endif - - if neocomplete.old_char != ' ' && v:char == ' ' && v:count == 0 - call s:make_cache_current_line() - 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 - return s:do_auto_complete(event) -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( - \ "\(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 - - let neocomplete = neocomplete#get_current_neocomplete() - " Detect foldmethod. - if (&l:foldmethod ==# 'expr' || &l:foldmethod ==# 'syntax') - \ && !neocomplete.detected_foldmethod - \ && a:event !=# 'InsertEnter' - \ && line('.') > 1000 - let neocomplete.detected_foldmethod = 1 - call neocomplete#print_error( - \ printf('foldmethod = "%s" is detected.', &foldmethod)) - redir => foldmethod - verbose setlocal foldmethod? - redir END - for msg in split(substitute(foldmethod, '\t', '', 'g'), "\n") - call neocomplete#print_error(msg) - endfor - call neocomplete#print_error( - \ 'You should disable it or install FastFold plugin.') - 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("\(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 .= '=neocomplete#mappings#fallback(' . i . ')' - endfor - execute 'inoremap (neocomplete_fallback)' key - - " Fallback - call s:complete_key("\(neocomplete_fallback)") -endfunction"}}} - -function! s:complete_key(key) abort "{{{ - call neocomplete#helper#complete_configure() - - call feedkeys(a:key) -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 diff --git a/pack/acp/start/neocomplete.vim/autoload/neocomplete/helper.vim b/pack/acp/start/neocomplete.vim/autoload/neocomplete/helper.vim deleted file mode 100644 index 2bf0fff..0000000 --- a/pack/acp/start/neocomplete.vim/autoload/neocomplete/helper.vim +++ /dev/null @@ -1,357 +0,0 @@ -"============================================================================= -" FILE: helper.vim -" AUTHOR: Shougo Matsushita -" 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 diff --git a/pack/acp/start/neocomplete.vim/autoload/neocomplete/init.vim b/pack/acp/start/neocomplete.vim/autoload/neocomplete/init.vim deleted file mode 100644 index dd15fcc..0000000 --- a/pack/acp/start/neocomplete.vim/autoload/neocomplete/init.vim +++ /dev/null @@ -1,659 +0,0 @@ -"============================================================================= -" FILE: init.vim -" AUTHOR: Shougo Matsushita -" 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 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*\%(::\w*\)*[!?]\?') - call neocomplete#util#set_default_dictionary( - \'g:neocomplete#keyword_patterns', - \'php,int-php', - \'\)\?'. - \'\|\$\h\w*\|\h\w*\%(\%(\\\|::\)\w*\)*') - call neocomplete#util#set_default_dictionary( - \'g:neocomplete#keyword_patterns', - \'perl,int-perlsh', - \'<\h\w*>\?\|[$@%&*]\h\w*\|\h\w*\%(::\w*\)*') - call neocomplete#util#set_default_dictionary( - \'g:neocomplete#keyword_patterns', - \'perl6,int-perl6', - \'<\h\w*>\?\|[$@%&][!.*?]\?\h[[:alnum:]_-]*'. - \'\|\h[[:alnum:]_-]*\%(::[[: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:]_:]*\|'. - \'\%(\h\w*\)\?\|([^)]*)\?'. - \'\|<\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', - \'\)\?\|&\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_delimiter', - \ '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 diff --git a/pack/acp/start/neocomplete.vim/autoload/neocomplete/mappings.vim b/pack/acp/start/neocomplete.vim/autoload/neocomplete/mappings.vim deleted file mode 100644 index 4c8bcb7..0000000 --- a/pack/acp/start/neocomplete.vim/autoload/neocomplete/mappings.vim +++ /dev/null @@ -1,269 +0,0 @@ -"============================================================================= -" FILE: mappings.vim -" AUTHOR: Shougo Matsushita -" 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 (neocomplete_start_unite_complete) - \ unite#sources#neocomplete#start_complete() - inoremap (neocomplete_start_unite_quick_match) - \ unite#sources#neocomplete#start_quick_match() - if neocomplete#util#is_complete_select() - inoremap (neocomplete_start_omni_complete) - \ - else - inoremap (neocomplete_start_omni_complete) - \ - endif - if neocomplete#util#is_complete_select() - inoremap (neocomplete_start_auto_complete) - \ =neocomplete#mappings#auto_complete() - inoremap (neocomplete_start_manual_complete) - \ =neocomplete#mappings#manual_complete() - else - inoremap (neocomplete_start_auto_complete) - \ =neocomplete#mappings#auto_complete()= - \neocomplete#mappings#popup_post() - inoremap (neocomplete_start_manual_complete) - \ =neocomplete#mappings#manual_complete()= - \neocomplete#mappings#popup_post() - endif - - if !has('patch-7.4.653') - " To prevent Vim's complete() bug. - if mapcheck('', 'i') ==# '' - inoremap neocomplete#smart_close_popup()."\" - endif - if mapcheck('', 'i') ==# '' - inoremap neocomplete#smart_close_popup()."\" - endif - endif - - inoremap (neocomplete_auto_refresh) - \ =neocomplete#mappings#refresh() -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() ? "\" : '' -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() ? "\" : '' -endfunction -"}}} - -function! neocomplete#mappings#popup_post() abort "{{{ - return !pumvisible() ? "" : - \ g:neocomplete#enable_auto_select ? "\\" : "\" -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 ? "\" : "\") - \. repeat("\", 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() ? "\" : '') - \ . repeat("\", strchars(complete_str)) . common_str -endfunction"}}} - -function! neocomplete#mappings#fallback(i) abort "{{{ - let mapping = g:neocomplete#fallback_mappings[a:i] - return (pumvisible() || (mapping ==? "\\" - \ && &l:omnifunc == '')) ? "" : - \ (mapping . (neocomplete#util#is_complete_select() ? - \ "" : "\")) -endfunction"}}} - -function! neocomplete#mappings#refresh() abort "{{{ - let neocomplete = neocomplete#get_current_neocomplete() - let neocomplete.refresh = 1 - return pumvisible() ? "\" : '' -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 "\\" - 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 "\=neocomplete#mappings#manual_complete()\" - \ . (neocomplete#util#is_complete_select() ? - \ "" : "\=neocomplete#mappings#popup_post()\") -endfunction"}}} - -let &cpo = s:save_cpo -unlet s:save_cpo - -" vim: foldmethod=marker diff --git a/pack/acp/start/neocomplete.vim/autoload/neocomplete/sources/buffer.vim b/pack/acp/start/neocomplete.vim/autoload/neocomplete/sources/buffer.vim deleted file mode 100644 index d685206..0000000 --- a/pack/acp/start/neocomplete.vim/autoload/neocomplete/sources/buffer.vim +++ /dev/null @@ -1,400 +0,0 @@ -"============================================================================= -" FILE: buffer.vim -" AUTHOR: Shougo Matsushita -" 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 diff --git a/pack/acp/start/neocomplete.vim/autoload/neocomplete/sources/dictionary.vim b/pack/acp/start/neocomplete.vim/autoload/neocomplete/sources/dictionary.vim deleted file mode 100644 index 1bcb93a..0000000 --- a/pack/acp/start/neocomplete.vim/autoload/neocomplete/sources/dictionary.vim +++ /dev/null @@ -1,150 +0,0 @@ -"============================================================================= -" FILE: dictionary.vim -" AUTHOR: Shougo Matsushita -" 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 diff --git a/pack/acp/start/neocomplete.vim/autoload/neocomplete/sources/file.vim b/pack/acp/start/neocomplete.vim/autoload/neocomplete/sources/file.vim deleted file mode 100644 index b2e144a..0000000 --- a/pack/acp/start/neocomplete.vim/autoload/neocomplete/sources/file.vim +++ /dev/null @@ -1,159 +0,0 @@ -"============================================================================= -" FILE: file.vim -" AUTHOR: Shougo Matsushita -" 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 diff --git a/pack/acp/start/neocomplete.vim/autoload/neocomplete/sources/member.vim b/pack/acp/start/neocomplete.vim/autoload/neocomplete/sources/member.vim deleted file mode 100644 index 2745727..0000000 --- a/pack/acp/start/neocomplete.vim/autoload/neocomplete/sources/member.vim +++ /dev/null @@ -1,277 +0,0 @@ -"============================================================================= -" FILE: member.vim -" AUTHOR: Shougo Matsushita -" 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 diff --git a/pack/acp/start/neocomplete.vim/autoload/neocomplete/sources/omni.vim b/pack/acp/start/neocomplete.vim/autoload/neocomplete/sources/omni.vim deleted file mode 100644 index b7df649..0000000 --- a/pack/acp/start/neocomplete.vim/autoload/neocomplete/sources/omni.vim +++ /dev/null @@ -1,294 +0,0 @@ -"============================================================================= -" FILE: omni.vim -" AUTHOR: Shougo Matsushita -" 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\+\|\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 diff --git a/pack/acp/start/neocomplete.vim/autoload/neocomplete/sources/tag.vim b/pack/acp/start/neocomplete.vim/autoload/neocomplete/sources/tag.vim deleted file mode 100644 index 28d3a79..0000000 --- a/pack/acp/start/neocomplete.vim/autoload/neocomplete/sources/tag.vim +++ /dev/null @@ -1,120 +0,0 @@ -"============================================================================= -" FILE: tag.vim -" AUTHOR: Shougo Matsushita -" 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 diff --git a/pack/acp/start/neocomplete.vim/autoload/neocomplete/util.vim b/pack/acp/start/neocomplete.vim/autoload/neocomplete/util.vim deleted file mode 100644 index d772740..0000000 --- a/pack/acp/start/neocomplete.vim/autoload/neocomplete/util.vim +++ /dev/null @@ -1,264 +0,0 @@ -"============================================================================= -" FILE: util.vim -" AUTHOR: Shougo Matsushita -" 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, '\\\@ 704 || v:version == 704 && has('patch143') -endfunction"}}} - -let &cpo = s:save_cpo -unlet s:save_cpo - -" vim: foldmethod=marker diff --git a/pack/acp/start/neocomplete.vim/autoload/neocomplete/variables.vim b/pack/acp/start/neocomplete.vim/autoload/neocomplete/variables.vim deleted file mode 100644 index c82dc70..0000000 --- a/pack/acp/start/neocomplete.vim/autoload/neocomplete/variables.vim +++ /dev/null @@ -1,67 +0,0 @@ -"============================================================================= -" FILE: variables.vim -" AUTHOR: Shougo Matsushita -" 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 diff --git a/pack/acp/start/neocomplete.vim/autoload/unite/sources/neocomplete.vim b/pack/acp/start/neocomplete.vim/autoload/unite/sources/neocomplete.vim deleted file mode 100644 index 38d338e..0000000 --- a/pack/acp/start/neocomplete.vim/autoload/unite/sources/neocomplete.vim +++ /dev/null @@ -1,144 +0,0 @@ -"============================================================================= -" FILE: neocomplete.vim -" AUTHOR: Shougo Matsushita -" 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 diff --git a/pack/acp/start/neocomplete.vim/autoload/vital.vim b/pack/acp/start/neocomplete.vim/autoload/vital.vim deleted file mode 100644 index f1ba849..0000000 --- a/pack/acp/start/neocomplete.vim/autoload/vital.vim +++ /dev/null @@ -1,12 +0,0 @@ -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 diff --git a/pack/acp/start/neocomplete.vim/autoload/vital/_neocomplete.vim b/pack/acp/start/neocomplete.vim/autoload/vital/_neocomplete.vim deleted file mode 100644 index 9eba177..0000000 --- a/pack/acp/start/neocomplete.vim/autoload/vital/_neocomplete.vim +++ /dev/null @@ -1,5 +0,0 @@ -let s:_plugin_name = expand(':t:r') - -function! vital#{s:_plugin_name}#new() abort - return vital#{s:_plugin_name[1:]}#new() -endfunction diff --git a/pack/acp/start/neocomplete.vim/autoload/vital/_neocomplete/Data/List.vim b/pack/acp/start/neocomplete.vim/autoload/vital/_neocomplete/Data/List.vim deleted file mode 100644 index 335504f..0000000 --- a/pack/acp/start/neocomplete.vim/autoload/vital/_neocomplete/Data/List.vim +++ /dev/null @@ -1,457 +0,0 @@ -" ___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#Data#List#import() abort - return map({'combinations': '', 'and': '', 'sort_by': '', 'foldr1': '', 'sort': '', 'flatten': '', 'has_index': '', 'find_indices': '', 'any': '', 'unshift': '', 'span': '', 'pop': '', 'binary_search': '', 'uniq_by': '', 'or': '', 'all': '', 'zip': '', 'find_last_index': '', 'find': '', 'partition': '', 'map_accum': '', 'permutations': '', 'break': '', 'max_by': '', 'foldl': '', 'foldr': '', 'find_index': '', 'group_by': '', 'take_while': '', 'conj': '', 'push': '', 'char_range': '', 'cons': '', 'foldl1': '', 'intersect': '', 'concat': '', 'shift': '', 'clear': '', 'has_common_items': '', 'product': '', 'zip_fill': '', 'uniq': '', 'has': '', 'min_by': '', 'with_index': ''}, 'function("s:" . v:key)') - endfunction -else - function! s:_SID() abort - return matchstr(expand(''), '\zs\d\+\ze__SID$') - endfunction - execute join(['function! vital#_neocomplete#Data#List#import() abort', printf("return map({'combinations': '', 'and': '', 'sort_by': '', 'foldr1': '', 'sort': '', 'flatten': '', 'has_index': '', 'find_indices': '', 'any': '', 'unshift': '', 'span': '', 'pop': '', 'binary_search': '', 'uniq_by': '', 'or': '', 'all': '', 'zip': '', 'find_last_index': '', 'find': '', 'partition': '', 'map_accum': '', 'permutations': '', 'break': '', 'max_by': '', 'foldl': '', 'foldr': '', 'find_index': '', 'group_by': '', 'take_while': '', 'conj': '', 'push': '', 'char_range': '', 'cons': '', 'foldl1': '', 'intersect': '', 'concat': '', 'shift': '', 'clear': '', 'has_common_items': '', 'product': '', 'zip_fill': '', 'uniq': '', 'has': '', 'min_by': '', 'with_index': ''}, \"function('%s_' . v:key)\")", s:_SID()), 'endfunction'], "\n") - delfunction s:_SID -endif -" ___vital___ -" Utilities for list. - -let s:save_cpo = &cpo -set cpo&vim - -function! s:pop(list) abort - return remove(a:list, -1) -endfunction - -function! s:push(list, val) abort - call add(a:list, a:val) - return a:list -endfunction - -function! s:shift(list) abort - return remove(a:list, 0) -endfunction - -function! s:unshift(list, val) abort - return insert(a:list, a:val) -endfunction - -function! s:cons(x, xs) abort - return [a:x] + a:xs -endfunction - -function! s:conj(xs, x) abort - return a:xs + [a:x] -endfunction - -" Removes duplicates from a list. -function! s:uniq(list) abort - return s:uniq_by(a:list, 'v:val') -endfunction - -" Removes duplicates from a list. -function! s:uniq_by(list, f) abort - let list = map(copy(a:list), printf('[v:val, %s]', a:f)) - let i = 0 - let seen = {} - while i < len(list) - let key = string(list[i][1]) - if has_key(seen, key) - call remove(list, i) - else - let seen[key] = 1 - let i += 1 - endif - endwhile - return map(list, 'v:val[0]') -endfunction - -function! s:clear(list) abort - if !empty(a:list) - unlet! a:list[0 : len(a:list) - 1] - endif - return a:list -endfunction - -" Concatenates a list of lists. -" XXX: Should we verify the input? -function! s:concat(list) abort - let memo = [] - for Value in a:list - let memo += Value - endfor - return memo -endfunction - -" Take each elements from lists to a new list. -function! s:flatten(list, ...) abort - let limit = a:0 > 0 ? a:1 : -1 - let memo = [] - if limit == 0 - return a:list - endif - let limit -= 1 - for Value in a:list - let memo += - \ type(Value) == type([]) ? - \ s:flatten(Value, limit) : - \ [Value] - unlet! Value - endfor - return memo -endfunction - -" Sorts a list with expression to compare each two values. -" a:a and a:b can be used in {expr}. -function! s:sort(list, expr) abort - if type(a:expr) == type(function('function')) - return sort(a:list, a:expr) - endif - let s:expr = a:expr - return sort(a:list, 's:_compare') -endfunction - -function! s:_compare(a, b) abort - return eval(s:expr) -endfunction - -" Sorts a list using a set of keys generated by mapping the values in the list -" through the given expr. -" v:val is used in {expr} -function! s:sort_by(list, expr) abort - let pairs = map(a:list, printf('[v:val, %s]', a:expr)) - return map(s:sort(pairs, - \ 'a:a[1] ==# a:b[1] ? 0 : a:a[1] ># a:b[1] ? 1 : -1'), 'v:val[0]') -endfunction - -" Returns a maximum value in {list} through given {expr}. -" Returns 0 if {list} is empty. -" v:val is used in {expr} -function! s:max_by(list, expr) abort - if empty(a:list) - return 0 - endif - let list = map(copy(a:list), a:expr) - return a:list[index(list, max(list))] -endfunction - -" Returns a minimum value in {list} through given {expr}. -" Returns 0 if {list} is empty. -" v:val is used in {expr} -" FIXME: -0x80000000 == 0x80000000 -function! s:min_by(list, expr) abort - return s:max_by(a:list, '-(' . a:expr . ')') -endfunction - -" Returns List of character sequence between [a:from, a:to] -" e.g.: s:char_range('a', 'c') returns ['a', 'b', 'c'] -function! s:char_range(from, to) abort - return map( - \ range(char2nr(a:from), char2nr(a:to)), - \ 'nr2char(v:val)' - \) -endfunction - -" Returns true if a:list has a:value. -" Returns false otherwise. -function! s:has(list, value) abort - return index(a:list, a:value) isnot -1 -endfunction - -" Returns true if a:list[a:index] exists. -" Returns false otherwise. -" NOTE: Returns false when a:index is negative number. -function! s:has_index(list, index) abort - " Return true when negative index? - " let index = a:index >= 0 ? a:index : len(a:list) + a:index - return 0 <= a:index && a:index < len(a:list) -endfunction - -" similar to Haskell's Data.List.span -function! s:span(f, xs) abort - let border = len(a:xs) - for i in range(len(a:xs)) - if !eval(substitute(a:f, 'v:val', string(a:xs[i]), 'g')) - let border = i - break - endif - endfor - return border == 0 ? [[], copy(a:xs)] : [a:xs[: border - 1], a:xs[border :]] -endfunction - -" similar to Haskell's Data.List.break -function! s:break(f, xs) abort - return s:span(printf('!(%s)', a:f), a:xs) -endfunction - -" similar to Haskell's Data.List.takeWhile -function! s:take_while(f, xs) abort - return s:span(a:f, a:xs)[0] -endfunction - -" similar to Haskell's Data.List.partition -function! s:partition(f, xs) abort - return [filter(copy(a:xs), a:f), filter(copy(a:xs), '!(' . a:f . ')')] -endfunction - -" similar to Haskell's Prelude.all -function! s:all(f, xs) abort - return !s:any(printf('!(%s)', a:f), a:xs) -endfunction - -" similar to Haskell's Prelude.any -function! s:any(f, xs) abort - return !empty(filter(map(copy(a:xs), a:f), 'v:val')) -endfunction - -" similar to Haskell's Prelude.and -function! s:and(xs) abort - return s:all('v:val', a:xs) -endfunction - -" similar to Haskell's Prelude.or -function! s:or(xs) abort - return s:any('v:val', a:xs) -endfunction - -function! s:map_accum(expr, xs, init) abort - let memo = [] - let init = a:init - for x in a:xs - let expr = substitute(a:expr, 'v:memo', init, 'g') - let expr = substitute(expr, 'v:val', x, 'g') - let [tmp, init] = eval(expr) - call add(memo, tmp) - endfor - return memo -endfunction - -" similar to Haskell's Prelude.foldl -function! s:foldl(f, init, xs) abort - let memo = a:init - for x in a:xs - let expr = substitute(a:f, 'v:val', string(x), 'g') - let expr = substitute(expr, 'v:memo', string(memo), 'g') - unlet memo - let memo = eval(expr) - endfor - return memo -endfunction - -" similar to Haskell's Prelude.foldl1 -function! s:foldl1(f, xs) abort - if len(a:xs) == 0 - throw 'vital: Data.List: foldl1' - endif - return s:foldl(a:f, a:xs[0], a:xs[1:]) -endfunction - -" similar to Haskell's Prelude.foldr -function! s:foldr(f, init, xs) abort - return s:foldl(a:f, a:init, reverse(copy(a:xs))) -endfunction - -" similar to Haskell's Prelude.fold11 -function! s:foldr1(f, xs) abort - if len(a:xs) == 0 - throw 'vital: Data.List: foldr1' - endif - return s:foldr(a:f, a:xs[-1], a:xs[0:-2]) -endfunction - -" similar to python's zip() -function! s:zip(...) abort - return map(range(min(map(copy(a:000), 'len(v:val)'))), "map(copy(a:000), 'v:val['.v:val.']')") -endfunction - -" similar to zip(), but goes until the longer one. -function! s:zip_fill(xs, ys, filler) abort - if empty(a:xs) && empty(a:ys) - return [] - elseif empty(a:ys) - return s:cons([a:xs[0], a:filler], s:zip_fill(a:xs[1 :], [], a:filler)) - elseif empty(a:xs) - return s:cons([a:filler, a:ys[0]], s:zip_fill([], a:ys[1 :], a:filler)) - else - return s:cons([a:xs[0], a:ys[0]], s:zip_fill(a:xs[1 :], a:ys[1: ], a:filler)) - endif -endfunction - -" Inspired by Ruby's with_index method. -function! s:with_index(list, ...) abort - let base = a:0 > 0 ? a:1 : 0 - return map(copy(a:list), '[v:val, v:key + base]') -endfunction - -" similar to Ruby's detect or Haskell's find. -function! s:find(list, default, f) abort - for x in a:list - if eval(substitute(a:f, 'v:val', string(x), 'g')) - return x - endif - endfor - return a:default -endfunction - -" Returns the index of the first element which satisfies the given expr. -function! s:find_index(xs, f, ...) abort - let len = len(a:xs) - let start = a:0 > 0 ? (a:1 < 0 ? len + a:1 : a:1) : 0 - let default = a:0 > 1 ? a:2 : -1 - if start >=# len || start < 0 - return default - endif - for i in range(start, len - 1) - if eval(substitute(a:f, 'v:val', string(a:xs[i]), 'g')) - return i - endif - endfor - return default -endfunction - -" Returns the index of the last element which satisfies the given expr. -function! s:find_last_index(xs, f, ...) abort - let len = len(a:xs) - let start = a:0 > 0 ? (a:1 < 0 ? len + a:1 : a:1) : len - 1 - let default = a:0 > 1 ? a:2 : -1 - if start >=# len || start < 0 - return default - endif - for i in range(start, 0, -1) - if eval(substitute(a:f, 'v:val', string(a:xs[i]), 'g')) - return i - endif - endfor - return default -endfunction - -" Similar to find_index but returns the list of indices satisfying the given expr. -function! s:find_indices(xs, f, ...) abort - let len = len(a:xs) - let start = a:0 > 0 ? (a:1 < 0 ? len + a:1 : a:1) : 0 - let result = [] - if start >=# len || start < 0 - return result - endif - for i in range(start, len - 1) - if eval(substitute(a:f, 'v:val', string(a:xs[i]), 'g')) - call add(result, i) - endif - endfor - return result -endfunction - -" Return non-zero if a:list1 and a:list2 have any common item(s). -" Return zero otherwise. -function! s:has_common_items(list1, list2) abort - return !empty(filter(copy(a:list1), 'index(a:list2, v:val) isnot -1')) -endfunction - -function! s:intersect(list1, list2) abort - let items = [] - " for funcref - for X in a:list1 - if index(a:list2, X) != -1 && index(items, X) == -1 - let items += [X] - endif - endfor - return items -endfunction - -" similar to Ruby's group_by. -function! s:group_by(xs, f) abort - let result = {} - let list = map(copy(a:xs), printf('[v:val, %s]', a:f)) - for x in list - let Val = x[0] - let key = type(x[1]) !=# type('') ? string(x[1]) : x[1] - if has_key(result, key) - call add(result[key], Val) - else - let result[key] = [Val] - endif - unlet Val - endfor - return result -endfunction - -function! s:_default_compare(a, b) abort - return a:a <# a:b ? -1 : a:a ># a:b ? 1 : 0 -endfunction - -function! s:binary_search(list, value, ...) abort - let Predicate = a:0 >= 1 ? a:1 : 's:_default_compare' - let dic = a:0 >= 2 ? a:2 : {} - let start = 0 - let end = len(a:list) - 1 - - while 1 - if start > end - return -1 - endif - - let middle = (start + end) / 2 - - let compared = call(Predicate, [a:value, a:list[middle]], dic) - - if compared < 0 - let end = middle - 1 - elseif compared > 0 - let start = middle + 1 - else - return middle - endif - endwhile -endfunction - -function! s:product(lists) abort - let result = [[]] - for pool in a:lists - let tmp = [] - for x in result - let tmp += map(copy(pool), 'x + [v:val]') - endfor - let result = tmp - endfor - return result -endfunction - -function! s:permutations(list, ...) abort - if a:0 > 1 - throw 'vital: Data.List: too many arguments' - endif - let r = a:0 == 1 ? a:1 : len(a:list) - if r > len(a:list) - return [] - elseif r < 0 - throw 'vital: Data.List: {r} must be non-negative integer' - endif - let n = len(a:list) - let result = [] - for indices in s:product(map(range(r), 'range(n)')) - if len(s:uniq(indices)) == r - call add(result, map(indices, 'a:list[v:val]')) - endif - endfor - return result -endfunction - -function! s:combinations(list, r) abort - if a:r > len(a:list) - return [] - elseif a:r < 0 - throw 'vital: Data:List: {r} must be non-negative integer' - endif - let n = len(a:list) - let result = [] - for indices in s:permutations(range(n), a:r) - if s:sort(copy(indices), 'a:a - a:b') == indices - call add(result, map(indices, 'a:list[v:val]')) - endif - endfor - return result -endfunction - -let &cpo = s:save_cpo -unlet s:save_cpo - -" vim:set et ts=2 sts=2 sw=2 tw=0: diff --git a/pack/acp/start/neocomplete.vim/autoload/vital/_neocomplete/Data/String.vim b/pack/acp/start/neocomplete.vim/autoload/vital/_neocomplete/Data/String.vim deleted file mode 100644 index 7a6bd4e..0000000 --- a/pack/acp/start/neocomplete.vim/autoload/vital/_neocomplete/Data/String.vim +++ /dev/null @@ -1,633 +0,0 @@ -" ___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#Data#String#import() abort - return map({'starts_with': '', 'split3': '', 'replace_first': '', 'chop': '', 'unescape': '', 'split_posix_text': '', 'replace': '', 'scan': '', 'strwidthpart': '', 'common_head': '', 'reverse': '', 'escape_pattern': '', 'trim_end': '', '_vital_depends': '', 'wrap': '', 'join_posix_lines': '', 'contains_multibyte': '', 'truncate_skipping': '', 'split_leftright': '', 'ends_with': '', 'nsplit': '', 'strwidthpart_reverse': '', 'unescape_pattern': '', 'levenshtein_distance': '', 'trim_start': '', 'justify_equal_spacing': '', 'nr2hex': '', 'iconv': '', 'pad_left': '', 'nr2enc_char': '', 'lines': '', 'repair_posix_text': '', 'nr2byte': '', 'trim': '', 'diffidx': '', 'truncate': '', 'split_by_displaywidth': '', '_vital_created': '', 'padding_by_displaywidth': '', 'hash': '', 'chomp': '', 'pad_between_letters': '', 'dstring': '', 'pad_both_sides': '', 'substitute_last': '', 'pad_right': '', 'remove_ansi_sequences': '', '_vital_loaded': ''}, 'function("s:" . v:key)') - endfunction -else - function! s:_SID() abort - return matchstr(expand(''), '\zs\d\+\ze__SID$') - endfunction - execute join(['function! vital#_neocomplete#Data#String#import() abort', printf("return map({'starts_with': '', 'split3': '', 'replace_first': '', 'chop': '', 'unescape': '', 'split_posix_text': '', 'replace': '', 'scan': '', 'strwidthpart': '', 'common_head': '', 'reverse': '', 'escape_pattern': '', 'trim_end': '', '_vital_depends': '', 'wrap': '', 'join_posix_lines': '', 'contains_multibyte': '', 'truncate_skipping': '', 'split_leftright': '', 'ends_with': '', 'nsplit': '', 'strwidthpart_reverse': '', 'unescape_pattern': '', 'levenshtein_distance': '', 'trim_start': '', 'justify_equal_spacing': '', 'nr2hex': '', 'iconv': '', 'pad_left': '', 'nr2enc_char': '', 'lines': '', 'repair_posix_text': '', 'nr2byte': '', 'trim': '', 'diffidx': '', 'truncate': '', 'split_by_displaywidth': '', '_vital_created': '', 'padding_by_displaywidth': '', 'hash': '', 'chomp': '', 'pad_between_letters': '', 'dstring': '', 'pad_both_sides': '', 'substitute_last': '', 'pad_right': '', 'remove_ansi_sequences': '', '_vital_loaded': ''}, \"function('%s_' . v:key)\")", s:_SID()), 'endfunction'], "\n") - delfunction s:_SID -endif -" ___vital___ -" Utilities for string. - -let s:save_cpo = &cpo -set cpo&vim - -function! s:_vital_loaded(V) abort - let s:V = a:V - let s:L = s:V.import('Data.List') -endfunction - -function! s:_vital_depends() abort - return ['Data.List'] -endfunction - -function! s:_vital_created(module) abort - " Expose script-local funcref - if exists('s:strchars') - let a:module.strchars = s:strchars - endif - if exists('s:wcswidth') - let a:module.wcswidth = s:wcswidth - endif -endfunction - -" Substitute a:from => a:to by string. -" To substitute by pattern, use substitute() instead. -function! s:replace(str, from, to) abort - return s:_replace(a:str, a:from, a:to, 'g') -endfunction - -" Substitute a:from => a:to only once. -" cf. s:replace() -function! s:replace_first(str, from, to) abort - return s:_replace(a:str, a:from, a:to, '') -endfunction - -" implement of replace() and replace_first() -function! s:_replace(str, from, to, flags) abort - return substitute(a:str, '\V'.escape(a:from, '\'), escape(a:to, '\'), a:flags) -endfunction - -function! s:scan(str, pattern) abort - let list = [] - call substitute(a:str, a:pattern, '\=add(list, submatch(0)) == [] ? "" : ""', 'g') - return list -endfunction - -function! s:reverse(str) abort - return join(reverse(split(a:str, '.\zs')), '') -endfunction - -function! s:starts_with(str, prefix) abort - return stridx(a:str, a:prefix) == 0 -endfunction - -function! s:ends_with(str, suffix) abort - let idx = strridx(a:str, a:suffix) - return 0 <= idx && idx + len(a:suffix) == len(a:str) -endfunction - -function! s:common_head(strs) abort - if empty(a:strs) - return '' - endif - let len = len(a:strs) - if len == 1 - return a:strs[0] - endif - let strs = len == 2 ? a:strs : sort(copy(a:strs)) - let pat = substitute(strs[0], '.', '\="[" . escape(submatch(0), "^\\") . "]"', 'g') - return pat ==# '' ? '' : matchstr(strs[-1], '\C^\%[' . pat . ']') -endfunction - -" Split to two elements of List. ([left, right]) -" e.g.: s:split3('neocomplcache', 'compl') returns ['neo', 'compl', 'cache'] -function! s:split_leftright(expr, pattern) abort - let [left, _, right] = s:split3(a:expr, a:pattern) - return [left, right] -endfunction - -function! s:split3(expr, pattern) abort - let ERROR = ['', '', ''] - if a:expr ==# '' || a:pattern ==# '' - return ERROR - endif - let begin = match(a:expr, a:pattern) - if begin is -1 - return ERROR - endif - let end = matchend(a:expr, a:pattern) - let left = begin <=# 0 ? '' : a:expr[: begin - 1] - let right = a:expr[end :] - return [left, a:expr[begin : end-1], right] -endfunction - -" Slices into strings determines the number of substrings. -" e.g.: s:nsplit("neo compl cache", 2, '\s') returns ['neo', 'compl cache'] -function! s:nsplit(expr, n, ...) abort - let pattern = get(a:000, 0, '\s') - let keepempty = get(a:000, 1, 1) - let ret = [] - let expr = a:expr - if a:n <= 1 - return [expr] - endif - while 1 - let pos = match(expr, pattern) - if pos == -1 - if expr !~ pattern || keepempty - call add(ret, expr) - endif - break - elseif pos >= 0 - let left = pos > 0 ? expr[:pos-1] : '' - if pos > 0 || keepempty - call add(ret, left) - endif - let ml = len(matchstr(expr, pattern)) - if pos == 0 && ml == 0 - let pos = 1 - endif - let expr = expr[pos+ml :] - endif - if len(expr) == 0 - break - endif - if len(ret) == a:n - 1 - call add(ret, expr) - break - endif - endwhile - return ret -endfunction - -" Returns the number of character in a:str. -" NOTE: This returns proper value -" even if a:str contains multibyte character(s). -" s:strchars(str) {{{ -if exists('*strchars') - let s:strchars = function('strchars') -else - function! s:strchars(str) abort - return strlen(substitute(copy(a:str), '.', 'x', 'g')) - endfunction -endif "}}} - -" Returns the bool of contains any multibyte character in s:str -function! s:contains_multibyte(str) abort "{{{ - return strlen(a:str) != s:strchars(a:str) -endfunction "}}} - -" Remove last character from a:str. -" NOTE: This returns proper value -" even if a:str contains multibyte character(s). -function! s:chop(str) abort "{{{ - return substitute(a:str, '.$', '', '') -endfunction "}}} - -" Remove last \r,\n,\r\n from a:str. -function! s:chomp(str) abort "{{{ - return substitute(a:str, '\%(\r\n\|[\r\n]\)$', '', '') -endfunction "}}} - -" wrap() and its internal functions -" * _split_by_wcswidth_once() -" * _split_by_wcswidth() -" * _concat() -" * wrap() -" -" NOTE _concat() is just a copy of Data.List.concat(). -" FIXME don't repeat yourself -function! s:_split_by_wcswidth_once(body, x) abort - let fst = s:strwidthpart(a:body, a:x) - let snd = s:strwidthpart_reverse(a:body, s:wcswidth(a:body) - s:wcswidth(fst)) - return [fst, snd] -endfunction - -function! s:_split_by_wcswidth(body, x) abort - let memo = [] - let body = a:body - while s:wcswidth(body) > a:x - let [tmp, body] = s:_split_by_wcswidth_once(body, a:x) - call add(memo, tmp) - endwhile - call add(memo, body) - return memo -endfunction - -function! s:trim(str) abort - return matchstr(a:str,'^\s*\zs.\{-}\ze\s*$') -endfunction - -function! s:trim_start(str) abort - return matchstr(a:str,'^\s*\zs.\{-}$') -endfunction - -function! s:trim_end(str) abort - return matchstr(a:str,'^.\{-}\ze\s*$') -endfunction - -function! s:wrap(str,...) abort - let _columns = a:0 > 0 ? a:1 : &columns - return s:L.concat( - \ map(split(a:str, '\r\n\|[\r\n]'), 's:_split_by_wcswidth(v:val, _columns - 1)')) -endfunction - -function! s:nr2byte(nr) abort - if a:nr < 0x80 - return nr2char(a:nr) - elseif a:nr < 0x800 - return nr2char(a:nr/64+192).nr2char(a:nr%64+128) - else - return nr2char(a:nr/4096%16+224).nr2char(a:nr/64%64+128).nr2char(a:nr%64+128) - endif -endfunction - -function! s:nr2enc_char(charcode) abort - if &encoding ==# 'utf-8' - return nr2char(a:charcode) - endif - let char = s:nr2byte(a:charcode) - if strlen(char) > 1 - let char = strtrans(iconv(char, 'utf-8', &encoding)) - endif - return char -endfunction - -function! s:nr2hex(nr) abort - let n = a:nr - let r = '' - while n - let r = '0123456789ABCDEF'[n % 16] . r - let n = n / 16 - endwhile - return r -endfunction - -" If a ==# b, returns -1. -" If a !=# b, returns first index of different character. -function! s:diffidx(a, b) abort - return a:a ==# a:b ? -1 : strlen(s:common_head([a:a, a:b])) -endfunction - -function! s:substitute_last(expr, pat, sub) abort - return substitute(a:expr, printf('.*\zs%s', a:pat), a:sub, '') -endfunction - -function! s:dstring(expr) abort - let x = substitute(string(a:expr), "^'\\|'$", '', 'g') - let x = substitute(x, "''", "'", 'g') - return printf('"%s"', escape(x, '"')) -endfunction - -function! s:lines(str) abort - return split(a:str, '\r\?\n') -endfunction - -function! s:_pad_with_char(str, left, right, char) abort - return repeat(a:char, a:left). a:str. repeat(a:char, a:right) -endfunction - -function! s:pad_left(str, width, ...) abort - let char = get(a:, 1, ' ') - if strdisplaywidth(char) != 1 - throw "vital: Data.String: Can't use non-half-width characters for padding." - endif - let left = max([0, a:width - strdisplaywidth(a:str)]) - return s:_pad_with_char(a:str, left, 0, char) -endfunction - -function! s:pad_right(str, width, ...) abort - let char = get(a:, 1, ' ') - if strdisplaywidth(char) != 1 - throw "vital: Data.String: Can't use non-half-width characters for padding." - endif - let right = max([0, a:width - strdisplaywidth(a:str)]) - return s:_pad_with_char(a:str, 0, right, char) -endfunction - -function! s:pad_both_sides(str, width, ...) abort - let char = get(a:, 1, ' ') - if strdisplaywidth(char) != 1 - throw "vital: Data.String: Can't use non-half-width characters for padding." - endif - let space = max([0, a:width - strdisplaywidth(a:str)]) - let left = space / 2 - let right = space - left - return s:_pad_with_char(a:str, left, right, char) -endfunction - -function! s:pad_between_letters(str, width, ...) abort - let char = get(a:, 1, ' ') - if strdisplaywidth(char) != 1 - throw "vital: Data.String: Can't use non-half-width characters for padding." - endif - let letters = split(a:str, '\zs') - let each_width = a:width / len(letters) - let str = join(map(letters, 's:pad_both_sides(v:val, each_width, char)'), '') - if a:width - strdisplaywidth(str) > 0 - return char. s:pad_both_sides(str, a:width - 1, char) - endif - return str -endfunction - -function! s:justify_equal_spacing(str, width, ...) abort - let char = get(a:, 1, ' ') - if strdisplaywidth(char) != 1 - throw "vital: Data.String: Can't use non-half-width characters for padding." - endif - let letters = split(a:str, '\zs') - let first_letter = letters[0] - " {width w/o the first letter} / {length w/o the first letter} - let each_width = (a:width - strdisplaywidth(first_letter)) / (len(letters) - 1) - let remainder = (a:width - strdisplaywidth(first_letter)) % (len(letters) - 1) - return first_letter. join(s:L.concat([ -\ map(letters[1:remainder], 's:pad_left(v:val, each_width + 1, char)'), -\ map(letters[remainder + 1:], 's:pad_left(v:val, each_width, char)') -\ ]), '') -endfunction - -function! s:levenshtein_distance(str1, str2) abort - let letters1 = split(a:str1, '\zs') - let letters2 = split(a:str2, '\zs') - let length1 = len(letters1) - let length2 = len(letters2) - let distances = map(range(1, length1 + 1), 'map(range(1, length2 + 1), ''0'')') - - for i1 in range(0, length1) - let distances[i1][0] = i1 - endfor - for i2 in range(0, length2) - let distances[0][i2] = i2 - endfor - - for i1 in range(1, length1) - for i2 in range(1, length2) - let cost = (letters1[i1 - 1] ==# letters2[i2 - 1]) ? 0 : 1 - - let distances[i1][i2] = min([ - \ distances[i1 - 1][i2 ] + 1, - \ distances[i1 ][i2 - 1] + 1, - \ distances[i1 - 1][i2 - 1] + cost, - \]) - endfor - endfor - - return distances[length1][length2] -endfunction - -function! s:padding_by_displaywidth(expr, width, float) abort - let padding_char = ' ' - let n = a:width - strdisplaywidth(a:expr) - if n <= 0 - let n = 0 - endif - if a:float < 0 - return a:expr . repeat(padding_char, n) - elseif 0 < a:float - return repeat(padding_char, n) . a:expr - else - if n % 2 is 0 - return repeat(padding_char, n / 2) . a:expr . repeat(padding_char, n / 2) - else - return repeat(padding_char, (n - 1) / 2) . a:expr . repeat(padding_char, (n - 1) / 2) . padding_char - endif - endif -endfunction - -function! s:split_by_displaywidth(expr, width, float, is_wrap) abort - if a:width is 0 - return [''] - endif - - let lines = [] - - let cs = split(a:expr, '\zs') - let cs_index = 0 - - let text = '' - while cs_index < len(cs) - if cs[cs_index] is# "\n" - let text = s:padding_by_displaywidth(text, a:width, a:float) - let lines += [text] - let text = '' - else - let w = strdisplaywidth(text . cs[cs_index]) - - if w < a:width - let text .= cs[cs_index] - elseif a:width < w - let text = s:padding_by_displaywidth(text, a:width, a:float) - else - let text .= cs[cs_index] - endif - - if a:width <= w - let lines += [text] - let text = '' - if a:is_wrap - if a:width < w - if a:width < strdisplaywidth(cs[cs_index]) - while get(cs, cs_index, "\n") isnot# "\n" - let cs_index += 1 - endwhile - continue - else - let text = cs[cs_index] - endif - endif - else - while get(cs, cs_index, "\n") isnot# "\n" - let cs_index += 1 - endwhile - continue - endif - endif - - endif - let cs_index += 1 - endwhile - - if !empty(text) - let lines += [ s:padding_by_displaywidth(text, a:width, a:float) ] - endif - - return lines -endfunction - -function! s:hash(str) abort - if exists('*sha256') - return sha256(a:str) - else - " This gives up sha256ing but just adds up char with index. - let sum = 0 - for i in range(len(a:str)) - let sum += char2nr(a:str[i]) * (i + 1) - endfor - - return printf('%x', sum) - endif -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 = s:wcswidth(a:str) - if width > a:width - let ret = s:strwidthpart(ret, a:width) - let width = s:wcswidth(ret) - endif - - if width < a:width - let ret .= repeat(' ', a:width - width) - endif - - return ret -endfunction - -function! s:truncate_skipping(str, max, footer_width, separator) abort - let width = s:wcswidth(a:str) - if width <= a:max - let ret = a:str - else - let header_width = a:max - s:wcswidth(a:separator) - a:footer_width - let ret = s:strwidthpart(a:str, header_width) . a:separator - \ . s:strwidthpart_reverse(a:str, a:footer_width) - endif - return s:truncate(ret, a:max) -endfunction - -function! s:strwidthpart(str, width) abort - let str = tr(a:str, "\t", ' ') - let vcol = a:width + 2 - return matchstr(str, '.*\%<' . (vcol < 0 ? 0 : vcol) . 'v') -endfunction - -function! s:strwidthpart_reverse(str, width) abort - let str = tr(a:str, "\t", ' ') - let vcol = s:wcswidth(str) - a:width - return matchstr(str, '\%>' . (vcol < 0 ? 0 : vcol) . 'v.*') -endfunction - -if v:version >= 703 - " Use builtin function. - let s:wcswidth = function('strwidth') -else - function! s:wcswidth(str) abort - if a:str =~# '^[\x00-\x7f]*$' - return strlen(a:str) - endif - let mx_first = '^\(.\)' - let str = a:str - let width = 0 - while 1 - let ucs = char2nr(substitute(str, mx_first, '\1', '')) - if ucs == 0 - break - endif - let width += s:_wcwidth(ucs) - let str = substitute(str, mx_first, '', '') - endwhile - return width - endfunction - - " UTF-8 only. - function! s:_wcwidth(ucs) abort - let ucs = a:ucs - if (ucs >= 0x1100 - \ && (ucs <= 0x115f - \ || ucs == 0x2329 - \ || ucs == 0x232a - \ || (ucs >= 0x2e80 && ucs <= 0xa4cf - \ && ucs != 0x303f) - \ || (ucs >= 0xac00 && ucs <= 0xd7a3) - \ || (ucs >= 0xf900 && ucs <= 0xfaff) - \ || (ucs >= 0xfe30 && ucs <= 0xfe6f) - \ || (ucs >= 0xff00 && ucs <= 0xff60) - \ || (ucs >= 0xffe0 && ucs <= 0xffe6) - \ || (ucs >= 0x20000 && ucs <= 0x2fffd) - \ || (ucs >= 0x30000 && ucs <= 0x3fffd) - \ )) - return 2 - endif - return 1 - endfunction -endif - -function! s:remove_ansi_sequences(text) abort - return substitute(a:text, '\e\[\%(\%(\d\+;\)*\d\+\)\?[mK]', '', 'g') -endfunction - -function! s:escape_pattern(str) abort - " escape characters for no-magic - return escape(a:str, '^$~.*[]\') -endfunction - -function! s:unescape_pattern(str) abort - " unescape characters for no-magic - return s:unescape(a:str, '^$~.*[]\') -endfunction - -function! s:unescape(str, chars) abort - let chars = map(split(a:chars, '\zs'), 'escape(v:val, ''^$~.*[]\'')') - return substitute(a:str, '\\\(' . join(chars, '\|') . '\)', '\1', 'g') -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 empty(result) ? a:expr : result -endfunction - -" NOTE: -" A definition of a TEXT file is "A file that contains characters organized -" into one or more lines." -" A definition of a LINE is "A sequence of zero or more non- s -" plus a terminating " -" That's why {stdin} always ends with ideally. However, there are -" some programs which does not follow the POSIX rule and a Vim's way to join -" List into TEXT; join({text}, "\n"); does not add to the end of -" the last line. -" That's why add a trailing if it does not exist. -" REF: -" http://pubs.opengroup.org/onlinepubs/000095399/basedefs/xbd_chap03.html#tag_03_392 -" http://pubs.opengroup.org/onlinepubs/000095399/basedefs/xbd_chap03.html#tag_03_205 -" :help split() -" NOTE: -" it does nothing if the text is a correct POSIX text -function! s:repair_posix_text(text, ...) abort - let newline = get(a:000, 0, "\n") - return a:text =~# '\n$' ? a:text : a:text . newline -endfunction - -" NOTE: -" A definition of a TEXT file is "A file that contains characters organized -" into one or more lines." -" A definition of a LINE is "A sequence of zero or more non- s -" plus a terminating " -" REF: -" http://pubs.opengroup.org/onlinepubs/000095399/basedefs/xbd_chap03.html#tag_03_392 -" http://pubs.opengroup.org/onlinepubs/000095399/basedefs/xbd_chap03.html#tag_03_205 -function! s:join_posix_lines(lines, ...) abort - let newline = get(a:000, 0, "\n") - return join(a:lines, newline) . newline -endfunction - -" NOTE: -" A definition of a TEXT file is "A file that contains characters organized -" into one or more lines." -" A definition of a LINE is "A sequence of zero or more non- s -" plus a terminating " -" TEXT into List; split({text}, '\r\?\n', 1); add an extra empty line at the -" end of List because the end of TEXT ends with and keepempty=1 is -" specified. (btw. keepempty=0 cannot be used because it will remove -" emptylines in the head and the tail). -" That's why removing a trailing before proceeding to 'split' is required -" REF: -" http://pubs.opengroup.org/onlinepubs/000095399/basedefs/xbd_chap03.html#tag_03_392 -" http://pubs.opengroup.org/onlinepubs/000095399/basedefs/xbd_chap03.html#tag_03_205 -function! s:split_posix_text(text, ...) abort - let newline = get(a:000, 0, '\r\?\n') - let text = substitute(a:text, newline . '$', '', '') - return split(text, newline, 1) -endfunction - -let &cpo = s:save_cpo -unlet s:save_cpo -" vim:set et ts=2 sts=2 sw=2 tw=0: diff --git a/pack/acp/start/neocomplete.vim/autoload/vital/_neocomplete/Prelude.vim b/pack/acp/start/neocomplete.vim/autoload/vital/_neocomplete/Prelude.vim deleted file mode 100644 index 773c010..0000000 --- a/pack/acp/start/neocomplete.vim/autoload/vital/_neocomplete/Prelude.vim +++ /dev/null @@ -1,430 +0,0 @@ -" ___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#Prelude#import() abort - return map({'escape_pattern': '', 'is_funcref': '', 'path2directory': '', 'wcswidth': '', 'is_string': '', 'input_helper': '', 'is_number': '', 'is_cygwin': '', 'path2project_directory': '', 'strwidthpart_reverse': '', 'input_safe': '', 'is_list': '', 'truncate_skipping': '', 'glob': '', 'truncate': '', 'is_dict': '', 'set_default': '', 'is_numeric': '', 'getchar_safe': '', 'substitute_path_separator': '', 'is_mac': '', 'strwidthpart': '', 'getchar': '', 'is_unix': '', 'is_windows': '', 'globpath': '', 'escape_file_searching': '', 'is_float': '', 'smart_execute_command': ''}, 'function("s:" . v:key)') - endfunction -else - function! s:_SID() abort - return matchstr(expand(''), '\zs\d\+\ze__SID$') - endfunction - execute join(['function! vital#_neocomplete#Prelude#import() abort', printf("return map({'escape_pattern': '', 'is_funcref': '', 'path2directory': '', 'wcswidth': '', 'is_string': '', 'input_helper': '', 'is_number': '', 'is_cygwin': '', 'path2project_directory': '', 'strwidthpart_reverse': '', 'input_safe': '', 'is_list': '', 'truncate_skipping': '', 'glob': '', 'truncate': '', 'is_dict': '', 'set_default': '', 'is_numeric': '', 'getchar_safe': '', 'substitute_path_separator': '', 'is_mac': '', 'strwidthpart': '', 'getchar': '', 'is_unix': '', 'is_windows': '', 'globpath': '', 'escape_file_searching': '', 'is_float': '', 'smart_execute_command': ''}, \"function('%s_' . v:key)\")", s:_SID()), 'endfunction'], "\n") - delfunction s:_SID -endif -" ___vital___ -let s:save_cpo = &cpo -set cpo&vim - -if v:version > 703 || -\ (v:version == 703 && has('patch465')) - function! s:glob(expr) abort - return glob(a:expr, 1, 1) - endfunction -else - function! s:glob(expr) abort - return split(glob(a:expr, 1), '\n') - endfunction -endif - -if v:version > 704 || -\ (v:version == 704 && has('patch279')) - function! s:globpath(path, expr) abort - return globpath(a:path, a:expr, 1, 1) - endfunction -else - function! s:globpath(path, expr) abort - return split(globpath(a:path, a:expr, 1), '\n') - endfunction -endif - -" Wrapper functions for type(). -" NOTE: __TYPE_FLOAT = -1 when -float. -" this doesn't match to anything. -if has('patch-7.4.2071') - let [ - \ s:__TYPE_NUMBER, - \ s:__TYPE_STRING, - \ s:__TYPE_FUNCREF, - \ s:__TYPE_LIST, - \ s:__TYPE_DICT, - \ s:__TYPE_FLOAT] = [ - \ v:t_number, - \ v:t_string, - \ v:t_func, - \ v:t_list, - \ v:t_dict, - \ v:t_float] -else - let [ - \ s:__TYPE_NUMBER, - \ s:__TYPE_STRING, - \ s:__TYPE_FUNCREF, - \ s:__TYPE_LIST, - \ s:__TYPE_DICT, - \ s:__TYPE_FLOAT] = [ - \ type(3), - \ type(''), - \ type(function('tr')), - \ type([]), - \ type({}), - \ has('float') ? type(str2float('0')) : -1] -endif - -" Number or Float -function! s:is_numeric(Value) abort - let _ = type(a:Value) - return _ ==# s:__TYPE_NUMBER - \ || _ ==# s:__TYPE_FLOAT -endfunction - -" Number -function! s:is_number(Value) abort - return type(a:Value) ==# s:__TYPE_NUMBER -endfunction - -" String -function! s:is_string(Value) abort - return type(a:Value) ==# s:__TYPE_STRING -endfunction - -" Funcref -function! s:is_funcref(Value) abort - return type(a:Value) ==# s:__TYPE_FUNCREF -endfunction - -" List -function! s:is_list(Value) abort - return type(a:Value) ==# s:__TYPE_LIST -endfunction - -" Dictionary -function! s:is_dict(Value) abort - return type(a:Value) ==# s:__TYPE_DICT -endfunction - -" Float -function! s:is_float(Value) abort - return type(a:Value) ==# s:__TYPE_FLOAT -endfunction - - -function! s:truncate_skipping(str, max, footer_width, separator) abort - call s:_warn_deprecated('truncate_skipping', 'Data.String.truncate_skipping') - - let width = s:wcswidth(a:str) - if width <= a:max - let ret = a:str - else - let header_width = a:max - s:wcswidth(a:separator) - a:footer_width - let ret = s:strwidthpart(a:str, header_width) . a:separator - \ . s:strwidthpart_reverse(a:str, a:footer_width) - endif - - return s:truncate(ret, a:max) -endfunction - -function! s:truncate(str, width) abort - " Original function is from mattn. - " http://github.com/mattn/googlereader-vim/tree/master - - call s:_warn_deprecated('truncate', 'Data.String.truncate') - - 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 = s:wcswidth(a:str) - if width > a:width - let ret = s:strwidthpart(ret, a:width) - let width = s:wcswidth(ret) - endif - - if width < a:width - let ret .= repeat(' ', a:width - width) - endif - - return ret -endfunction - -function! s:strwidthpart(str, width) abort - call s:_warn_deprecated('strwidthpart', 'Data.String.strwidthpart') - - if a:width <= 0 - return '' - endif - let ret = a:str - let width = s:wcswidth(a:str) - while width > a:width - let char = matchstr(ret, '.$') - let ret = ret[: -1 - len(char)] - let width -= s:wcswidth(char) - endwhile - - return ret -endfunction -function! s:strwidthpart_reverse(str, width) abort - call s:_warn_deprecated('strwidthpart_reverse', 'Data.String.strwidthpart_reverse') - - if a:width <= 0 - return '' - endif - let ret = a:str - let width = s:wcswidth(a:str) - while width > a:width - let char = matchstr(ret, '^.') - let ret = ret[len(char) :] - let width -= s:wcswidth(char) - endwhile - - return ret -endfunction - -if v:version >= 703 - " Use builtin function. - function! s:wcswidth(str) abort - call s:_warn_deprecated('wcswidth', 'Data.String.wcswidth') - return strwidth(a:str) - endfunction -else - function! s:wcswidth(str) abort - call s:_warn_deprecated('wcswidth', 'Data.String.wcswidth') - - if a:str =~# '^[\x00-\x7f]*$' - return strlen(a:str) - end - - let mx_first = '^\(.\)' - let str = a:str - let width = 0 - while 1 - let ucs = char2nr(substitute(str, mx_first, '\1', '')) - if ucs == 0 - break - endif - let width += s:_wcwidth(ucs) - let str = substitute(str, mx_first, '', '') - endwhile - return width - endfunction - - " UTF-8 only. - function! s:_wcwidth(ucs) abort - let ucs = a:ucs - if (ucs >= 0x1100 - \ && (ucs <= 0x115f - \ || ucs == 0x2329 - \ || ucs == 0x232a - \ || (ucs >= 0x2e80 && ucs <= 0xa4cf - \ && ucs != 0x303f) - \ || (ucs >= 0xac00 && ucs <= 0xd7a3) - \ || (ucs >= 0xf900 && ucs <= 0xfaff) - \ || (ucs >= 0xfe30 && ucs <= 0xfe6f) - \ || (ucs >= 0xff00 && ucs <= 0xff60) - \ || (ucs >= 0xffe0 && ucs <= 0xffe6) - \ || (ucs >= 0x20000 && ucs <= 0x2fffd) - \ || (ucs >= 0x30000 && ucs <= 0x3fffd) - \ )) - return 2 - endif - return 1 - endfunction -endif - -let s:is_windows = has('win16') || has('win32') || has('win64') || has('win95') -let s:is_cygwin = has('win32unix') -let s:is_mac = !s:is_windows && !s:is_cygwin - \ && (has('mac') || has('macunix') || has('gui_macvim') || - \ (!isdirectory('/proc') && executable('sw_vers'))) -let s:is_unix = has('unix') - -function! s:is_windows() abort - return s:is_windows -endfunction - -function! s:is_cygwin() abort - return s:is_cygwin -endfunction - -function! s:is_mac() abort - return s:is_mac -endfunction - -function! s:is_unix() abort - return s:is_unix -endfunction - -function! s:_warn_deprecated(name, alternative) abort - try - echohl Error - echomsg 'Prelude.' . a:name . ' is deprecated! Please use ' . a:alternative . ' instead.' - finally - echohl None - endtry -endfunction - -function! s:smart_execute_command(action, word) abort - execute a:action . ' ' . (a:word ==# '' ? '' : '`=a:word`') -endfunction - -function! s:escape_file_searching(buffer_name) abort - return escape(a:buffer_name, '*[]?{}, ') -endfunction - -function! s:escape_pattern(str) abort - call s:_warn_deprecated( - \ 'escape_pattern', - \ 'Data.String.escape_pattern', - \) - return escape(a:str, '~"\.^$[]*') -endfunction - -function! s:getchar(...) abort - let c = call('getchar', a:000) - return type(c) == type(0) ? nr2char(c) : c -endfunction - -function! s:getchar_safe(...) abort - let c = s:input_helper('getchar', a:000) - return type(c) == type('') ? c : nr2char(c) -endfunction - -function! s:input_safe(...) abort - return s:input_helper('input', a:000) -endfunction - -function! s:input_helper(funcname, args) abort - let success = 0 - if inputsave() !=# success - throw 'vital: Prelude: inputsave() failed' - endif - try - return call(a:funcname, a:args) - finally - if inputrestore() !=# success - throw 'vital: Prelude: inputrestore() failed' - endif - endtry -endfunction - -function! s:set_default(var, val) abort - if !exists(a:var) || type({a:var}) != type(a:val) - let {a:var} = a:val - endif -endfunction - -function! s:substitute_path_separator(path) abort - return s:is_windows ? substitute(a:path, '\\', '/', 'g') : a:path -endfunction - -function! s:path2directory(path) abort - return s:substitute_path_separator(isdirectory(a:path) ? a:path : fnamemodify(a:path, ':p:h')) -endfunction - -function! s:_path2project_directory_git(path) abort - let parent = a:path - - while 1 - let path = parent . '/.git' - if isdirectory(path) || filereadable(path) - return parent - endif - let next = fnamemodify(parent, ':h') - if next == parent - return '' - endif - let parent = next - endwhile -endfunction - -function! s:_path2project_directory_svn(path) abort - let search_directory = a:path - let directory = '' - - let find_directory = s:escape_file_searching(search_directory) - let d = finddir('.svn', find_directory . ';') - if d ==# '' - return '' - endif - - let directory = fnamemodify(d, ':p:h:h') - - " Search parent directories. - let parent_directory = s:path2directory( - \ fnamemodify(directory, ':h')) - - if parent_directory !=# '' - let d = finddir('.svn', parent_directory . ';') - if d !=# '' - let directory = s:_path2project_directory_svn(parent_directory) - endif - endif - return directory -endfunction - -function! s:_path2project_directory_others(vcs, path) abort - let vcs = a:vcs - let search_directory = a:path - - let find_directory = s:escape_file_searching(search_directory) - let d = finddir(vcs, find_directory . ';') - if d ==# '' - return '' - endif - return fnamemodify(d, ':p:h:h') -endfunction - -function! s:path2project_directory(path, ...) abort - let is_allow_empty = get(a:000, 0, 0) - let search_directory = s:path2directory(a:path) - let directory = '' - - " Search VCS directory. - for vcs in ['.git', '.bzr', '.hg', '.svn'] - if vcs ==# '.git' - let directory = s:_path2project_directory_git(search_directory) - elseif vcs ==# '.svn' - let directory = s:_path2project_directory_svn(search_directory) - else - let directory = s:_path2project_directory_others(vcs, search_directory) - endif - if directory !=# '' - break - endif - endfor - - " Search project file. - if directory ==# '' - for d in ['build.xml', 'prj.el', '.project', 'pom.xml', 'package.json', - \ 'Makefile', 'configure', 'Rakefile', 'NAnt.build', - \ 'P4CONFIG', 'tags', 'gtags'] - let d = findfile(d, s:escape_file_searching(search_directory) . ';') - if d !=# '' - let directory = fnamemodify(d, ':p:h') - break - endif - endfor - endif - - if directory ==# '' - " Search /src/ directory. - let base = s:substitute_path_separator(search_directory) - if base =~# '/src/' - let directory = base[: strridx(base, '/src/') + 3] - endif - endif - - if directory ==# '' && !is_allow_empty - " Use original path. - let directory = search_directory - endif - - return s:substitute_path_separator(directory) -endfunction - -let &cpo = s:save_cpo -unlet s:save_cpo - -" vim:set et ts=2 sts=2 sw=2 tw=0: diff --git a/pack/acp/start/neocomplete.vim/autoload/vital/_neocomplete/Process.vim b/pack/acp/start/neocomplete.vim/autoload/vital/_neocomplete/Process.vim deleted file mode 100644 index 47f54c2..0000000 --- a/pack/acp/start/neocomplete.vim/autoload/vital/_neocomplete/Process.vim +++ /dev/null @@ -1,181 +0,0 @@ -" ___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(''), '\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('%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: diff --git a/pack/acp/start/neocomplete.vim/autoload/vital/_neocomplete/System/Cache/Deprecated.vim b/pack/acp/start/neocomplete.vim/autoload/vital/_neocomplete/System/Cache/Deprecated.vim deleted file mode 100644 index d81d6fe..0000000 --- a/pack/acp/start/neocomplete.vim/autoload/vital/_neocomplete/System/Cache/Deprecated.vim +++ /dev/null @@ -1,101 +0,0 @@ -" ___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(''), '\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('%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: diff --git a/pack/acp/start/neocomplete.vim/autoload/vital/neocomplete.vim b/pack/acp/start/neocomplete.vim/autoload/vital/neocomplete.vim deleted file mode 100644 index d428cc2..0000000 --- a/pack/acp/start/neocomplete.vim/autoload/vital/neocomplete.vim +++ /dev/null @@ -1,339 +0,0 @@ -let s:plugin_name = expand(':t:r') -let s:vital_base_dir = expand(':h') -let s:project_root = expand(':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(''), '\zs\d\+\ze__SID$') - endfunction - let s:_s = '' . 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 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(':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 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("\")), '"[\\x" . printf("%0x", char2nr("\"[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%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('%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 diff --git a/pack/acp/start/neocomplete.vim/autoload/vital/neocomplete.vital b/pack/acp/start/neocomplete.vim/autoload/vital/neocomplete.vital deleted file mode 100644 index 55fa256..0000000 --- a/pack/acp/start/neocomplete.vim/autoload/vital/neocomplete.vital +++ /dev/null @@ -1,8 +0,0 @@ -neocomplete -645fe7142afdf5ef90e07cd275a15657c3328f53 - -Prelude -Data.List -Data.String -Process -System.Cache.Deprecated diff --git a/pack/acp/start/neocomplete.vim/doc/neocomplete.txt b/pack/acp/start/neocomplete.vim/doc/neocomplete.txt deleted file mode 100644 index 5868d8d..0000000 --- a/pack/acp/start/neocomplete.vim/doc/neocomplete.txt +++ /dev/null @@ -1,1861 +0,0 @@ -*neocomplete.txt* Next generation of auto completion framework. - -Version: 2.2 -Author: Shougo -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. -}}} - -CONTENTS *neocomplete-contents* - -Introduction |neocomplete-introduction| -Install |neocomplete-install| -Interface |neocomplete-interface| - Commands |neocomplete-commands| - Variables |neocomplete-variables| - Sources variables |neocomplete-sources-variables| - Key mappings |neocomplete-key-mappings| - Functions |neocomplete-functions| -Examples |neocomplete-examples| -Sources |neocomplete-sources| - User sources |neocomplete-user-sources| -Create source |neocomplete-create-source| - Source attributes |neocomplete-source-attributes| - Candidate attributes |neocomplete-candidate-attributes| -Create filter |neocomplete-create-filter| - Filter attributes |neocomplete-filter-attributes| -FILTERS |neocomplete-filters| -External sources |neocomplete-external-sources| -FAQ |neocomplete-faq| - -============================================================================== -INTRODUCTION *neocomplete-introduction* - -*neocomplete* is the next generation auto completion framework and a superior -successor of the |neocomplcache| plugin. It provides a keyword completion -system by maintaining a keyword cache of the current buffer. The neocomplete -framework can be customized easily and has a lot more features than Vim's -standard completion. - -Note: neocomplete may consume more memory than other plugins do. - -Improvements in neocomplete in comparison to |neocomplcache|: - -1. Real fuzzy match behavior like |YouCompleteMe| by default. -2. Refactored source interface. -3. Removed legacy interface. -4. Requires |if_lua|. -5. Optimized completion speed. -6. Changed source names. -7. Changed variable names. -8. Added new features. - -============================================================================== -INSTALL *neocomplete-install* - -Install prerequisites - -In order to use neocomplete, the following prerequisites have to be met: - -1. Vim build with the |if_lua| feature -2. Vim version 7.3.885 or above - -The following sections describe where to get a Vim version, neocomplete -works with, for your operating system. - -On Windows: - -github release https://github.com/vim/vim-win32-installer/releases -For 32bit http://files.kaoriya.net/goto/vim73w32 -For 32bit (alternative) http://tuxproject.de/projects/vim/ - http://wyw.dcweb.cn/#download -For 64bit http://files.kaoriya.net/goto/vim73w64 - -On Mac: - -You can get |if_lua| enabled MacVim versions here: - -https://github.com/zhaocai/macvim -http://code.google.com/p/macvim-kaoriya/ - -Or install it with homebrew: -> - brew install macvim --with-cscope --with-lua --HEAD -< - -On Linux: - -As almost all Vim packages offered by distributions are too old, you should -build Vim manually using gnu make and enable |if_lua| in the configuration -step. The following steps show you the general process on how to build Vim: - -1. Get the source package -2. Unpack the sources -3. Configure the package (./configure). This step is essential to enable - the Vim features you like to use. -4. Build the package with gnu make -5. Install the package using your distributions package manager - -You can find detailed information on ho to configure and build Vim from source -under following link: http://vim.wikia.com/wiki/Building_Vim. Or follow the -guide on: -https://github.com/Valloric/YouCompleteMe/wiki/Building-Vim-from-source - -Install the plugin - -After you have installed the right version of Vim, you can go on to install -the neocomplete plugin. You can do this in a more old fashioned, manual way -or use a plugin manager like pathogen, vundle, neobundle. The second approach -is the recommended installation method. - -Manual: - -1. Get the plugin package -2. Extract the files and put them in your Vim directory - (usually ~/.vim/ or Program Files/Vim/vimfiles on Windows). -3. Execute |:NeoCompleteEnable| command or set following variable in your vimrc > - let g:neocomplete#enable_at_startup = 1 - -Package manager: - -For instructions on how to set up a Vim package manager see the documentation -of the package manager of your choice. For example after installing -neobundle you can install the neocomplete plugin with the following steps: - -1. Let the plugin manger know about the package (.vimrc) > - NeoBundle 'Shougo/neocomplete.vim' -< -2. Install the plugin with the install command > - :NeoBundleInstall -< - - *neocomplete-migration* - -In case you are planing to move from neocomplcache to neocomplete there is a -wiki page that offers a migration guide. -https://github.com/Shougo/neocomplete.vim/wiki/neocomplete-migration-guide - - *neocomplete-RECOMMENDATION* - - *neocomplete-asynchronous* - -If you have installed the |vimproc| plugin, neocomplete creates the caches -asynchronously. You can find vimproc at: http://github.com/Shougo/vimproc. -The vimproc plugin needs compilation before you can use it. You can find -further information in the vimproc documentation. - - *neocomplete-snippets* - -If you would like to use the snippet feature with neocomplete, you need to -install the neosnippet plugin (https://github.com/Shougo/neosnippet.vim) or -UltiSnips (https://github.com/SirVer/ultisnips). - - *neocomplete-context-filetype* - -If you would like to use the context filetype feature, you need to install the -context_filetype.vim plugin which you can find under the following repository: -https://github.com/Shougo/context_filetype.vim - - *neocomplete-include* - -If you want to complete the candidates from include files or include files -candidates, you need to install the neoinclude plugin -(https://github.com/Shougo/neoinclude.vim). - - *neocomplete-syntax* - -If you want to complete the candidates from syntax files, you need to install -the neco-syntax plugin (https://github.com/Shougo/neco-syntax). - - *neocomplete-neopairs* - -If you want to insert the parentheses pairs automatically, you need to install -the neopairs plugin (https://github.com/Shougo/neopairs.vim). - -============================================================================== -INTERFACE *neocomplete-interface* - ------------------------------------------------------------------------------- -COMMANDS *neocomplete-commands* - -:NeoCompleteEnable *:NeoCompleteEnable* - Validate neocomplete and initialize it. - Warning: Existing cache disappears. - -:NeoCompleteDisable *:NeoCompleteDisable* - Invalidate neocomplete and clean it up. - -:NeoCompleteToggle *:NeoCompleteToggle* - Change the lock/unlock state of neocomplete. - While neocomplete is in locking, you cannot use automatic - completions. - Note: This command also enables neocomplete if it is disabled. - -:NeoCompleteLock *:NeoCompleteLock* - Lock neocomplete. - While neocomplete is in locking, you cannot use automatic - completions but can use manual completions. - The lock status is local to each buffer. - Note: This command is disabled when neocomplete is disabled. - -:NeoCompleteUnlock *:NeoCompleteUnlock* - Unlock neocomplete. - Note: This command is disabled when neocomplete is disabled. - - *:NeoCompleteAutoCompletionLength* -:NeoCompleteAutoCompletionLength {length} - Change the length of chars to start automatic completion to - {length}. - Note: The length value is local to each buffer. - -:NeoCompleteClean *:NeoCompleteClean* - Clean files in |g:neocomplete#data_directory|. - -:NeoCompleteSetFileType [filetype] *:NeoCompleteSetFileType* - Change the filetype to [filetype] in the current buffer. - This filetype is only used by neocomplete, so syntax - highlighting and etc stay same. - - Note: You can get the current filetype by - |neocomplete#get_context_filetype()| - - -SOURCES COMMANDS *neocomplete-sources-COMMANDS* - -:NeoCompleteBufferMakeCache [bufname] *:NeoCompleteBufferMakeCache* - Make a cache based on the buffer with the name [bufname]. - The command selects the current buffer when you omit - [bufname]. - If [bufname] is not loaded, neocomplete will open - [bufname] automatically. - Note: It may take time considerably for the big buffer. - - *:NeoCompleteDictionaryMakeCache* -:NeoCompleteDictionaryMakeCache [filetype] - Make a cache from a dictionary file with [filetype]. - Selects the filetype of the current buffer if [filetype] is - omitted. - -:NeoCompleteTagMakeCache *:NeoCompleteTagMakeCache* - Make a cache from a tags file in current buffer. - -:NeoCompleteMemberMakeCache *:NeoCompleteMemberMakeCache* - Make a member cache based in current buffer. - ------------------------------------------------------------------------------- -VARIABLES *neocomplete-variables* - - *g:neocomplete#enable_at_startup* -g:neocomplete#enable_at_startup - neocomplete gets started automatically when Vim starts if - this value is 1. - - With the default value 0, you cannot use neocomplete - unless you start it manually. - - Note: This option has to be set in your .vimrc or _vimrc. - NOT IN the .gvimrc nor _gvimrc! - -g:neocomplete#max_list *g:neocomplete#max_list* - This variable controls the number of candidates displayed in a - pop-up menu. If the list of candidates exceeds the limit, not - all candidates will show up. - - Default value is 100. - - *g:neocomplete#max_keyword_width* -g:neocomplete#max_keyword_width - This variable controls the indication width of a candidate - displayed in a pop-up menu. If the keyword length exceeds - the length it will be cut down properly. - - Default value is 80. - - *g:neocomplete#auto_completion_start_length* -g:neocomplete#auto_completion_start_length - This variable controls the number of the input completion - at the time of key input automatically. - Note: |g:neocomplete#auto_completion_start_length| is used - for "keyword" kind source only. Please refer to - |neocomplete-source-attribute-min_pattern_length|. - - Default value is 2. - - *g:neocomplete#manual_completion_start_length* -g:neocomplete#manual_completion_start_length - This variable controls the number of the input completion - at the time of manual completion. It is convenient when you - reduce this value, but may get heavy when you deleted a - letter in or at popup indication time. - - Default value is 0. - - *g:neocomplete#min_keyword_length* -g:neocomplete#min_keyword_length - In a buffer or dictionary files, this variable controls - length of keyword becoming the targets of the completion at - the minimum. - - Default value is 4. - - *g:neocomplete#enable_ignore_case* -g:neocomplete#enable_ignore_case - When neocomplete looks for candidate completion, this - variable controls whether neocomplete ignores the upper- - and lowercase. If it is 1, neocomplete ignores case. - - Default value is 'ignorecase'. - - *g:neocomplete#enable_smart_case* -g:neocomplete#enable_smart_case - When a capital letter is included in input, neocomplete does - not ignore the upper- and lowercase. - - Default value is 'infercase'. - - *g:neocomplete#enable_camel_case* -g:neocomplete#enable_camel_case - When a capital letter is matched with the uppercase, but a - lower letter is matched with the upper- and lowercase. - Ex: "foB" is matched with "FooBar" not "foobar". - Note: This feature is only available in - |neocomplete-filter-matcher_fuzzy|. - - Default value is 0. - - *g:neocomplete#disable_auto_complete* -g:neocomplete#disable_auto_complete - This variable controls whether you invalidate automatic - completion. If it is 1, automatic completion becomes - invalid, but can use the manual completion by - |neocomplete#start_manual_complete()|. - - Default value is 0. - - *g:neocomplete#auto_complete_delay* -g:neocomplete#auto_complete_delay - It is the auto completion delay time after your input. - The unit is ms. - Note: It requires |+timers| feature. - Note: It is disabled in MacVim. - - Default value is 50. - - *g:neocomplete#enable_auto_select* -g:neocomplete#enable_auto_select - When neocomplete displays candidates, this option controls - whether neocomplete selects the first candidate - automatically. If you enable this option, neocomplete's - completion behavior is like |AutoComplPop|. - - Note: If you want to enable the feature in - |g:neocomplete#force_omni_input_patterns|, you need Vim - 7.4.775 or above. - - Default value is 0. - - *g:neocomplete#enable_auto_delimiter* -g:neocomplete#enable_auto_delimiter - This option controls whether neocomplete insert delimiter - automatically. For example, / (filenames) or # (Vim scripts.) - - Default value is 0. - - *g:neocomplete#enable_fuzzy_completion* -g:neocomplete#enable_fuzzy_completion - When you input one character, this variable controls whether - neocomplete takes an ambiguous searching as an end of the - words in it. For example, neocomplete comes to match it with - "public_html" or "PublicHtml" when you input it with "puh". - Note: The first letter must be matched. - - Default value is 1. - - *g:neocomplete#enable_refresh_always* -g:neocomplete#enable_refresh_always - Neocomplete refreshes the candidates automatically if this - value is 1. - Note: It increases the screen flicker. - - Default value is 0. - - *g:neocomplete#enable_multibyte_completion* -g:neocomplete#enable_multibyte_completion - If it is non-0, neocomplete can complete multibyte characters. - Note: This feature may conflict Input Method in Unix systems. - Note: To use multibyte completion, you must change - |g:neocomplete#keyword_patterns| variable. - - Default value is 0. - - *g:neocomplete#lock_buffer_name_pattern* -g:neocomplete#lock_buffer_name_pattern - This variable sets a pattern of the buffer name. If matched it, - neocomplete does not complete automatically. When it is an - empty character string, neocomplete will ignore it. - - Default value is ''. - -g:neocomplete#lock_iminsert *g:neocomplete#lock_iminsert* - If this variable is non-zero, neocomplete locks when - 'iminsert' is non-zero. - - Default value is 0. - -g:neocomplete#data_directory *g:neocomplete#data_directory* - This variable appoints the directory that neocomplete - begins to write a file at one time. When there is not the - directory which appointed here, it is made. For example, - buffer.vim stores cache of the keyword in this - 'buffer_cache' sub directory. - - Default value is "$XDG_CACHE_HOME/neocomplete" or - expand("~/.cache/neocomplete"); the absolute path of it. - - *g:neocomplete#keyword_patterns* -g:neocomplete#keyword_patterns - This dictionary records keyword patterns to completion. - This is appointed in regular expression every file type. - If the key is "_" or "default", it is used for default - pattern. - - Because it is complicated, refer to - neocomplete#init#_variables() in - autoload/neocomplete/init.vim for the initial value. -> - " Examples: - if !exists('g:neocomplete#keyword_patterns') - let g:neocomplete#keyword_patterns = {} - endif - let g:neocomplete#keyword_patterns._ = '\h\w*' -< - *g:neocomplete#force_omni_input_patterns* -g:neocomplete#force_omni_input_patterns - This dictionary records keyword patterns to Omni completion. - This is appointed in regular expression every file type. - If this pattern is not defined or empty pattern, neocomplete - does not call 'omnifunc'. - Note: If it is a set, neocomplete will call 'omnifunc' - directly. So almost neocomplete features are disabled. But - all Omni completion works instead of - |g:neocomplete#sources#omni#input_patterns|. -> - if !exists('g:neocomplete#force_omni_input_patterns') - let g:neocomplete#force_omni_input_patterns = {} - endif - let g:neocomplete#force_omni_input_patterns.ruby = - \ '[^. *\t]\.\w*\|\h\w*::' -< - Because it is complicated, refer to - neocomplete#init#_variables() in - autoload/neocomplete/init.vim for the initial value. - - *g:neocomplete#text_mode_filetypes* -g:neocomplete#text_mode_filetypes - It is a dictionary to define text mode filetypes. The - dictionary's key is filetype and value is number. If the - value is non-zero, this filetype is text mode. In text mode, - neocomplete supports word conversion to write English. - If the key is "_" and the value is non-zero, all filetypes are - text mode. - - For example, if you input "Fo", neocomplete will convert - candidate "foo" to "Foo". If you input "foo", neocomplete - will convert candidate "FooBar" to "foobar". If you input - "FO", neocomplete will convert candidate "foo" to "FOO". - Note: Text mode conversion is only used for "foobar" or - "Foobar" or "FOOBAR" words. Not "fooBar" or "FooBar". - - Because it is complicated, refer to - neocomplete#init#_variables() in - autoload/neocomplete/init.vim for the initial value. - - *g:neocomplete#delimiter_patterns* -g:neocomplete#delimiter_patterns - This variable appoints a delimiter pattern to smart complete a - function. This is appointed in string list every file type. - Note: This string is not regular expression. -> - " Examples: - if !exists('g:neocomplete#delimiter_patterns') - let g:neocomplete#delimiter_patterns= {} - endif - let g:neocomplete#delimiter_patterns.vim = ['#'] - let g:neocomplete#delimiter_patterns.cpp = ['::'] -< - Because it is complicated, refer to - neocomplete#init#_variables() in - autoload/neocomplete/init.vim for the initial value. - -g:neocomplete#sources *g:neocomplete#sources* - It is a dictionary to decide use source names. The key is - filetype and the value is source names list. If the key is - "_", the value will be used for default filetypes. For - example, you can disable some sources in C++ filetype. - If the value is "_", it will load all sources. - Default value is {}. -> - " Examples: - if !exists('g:neocomplete#sources') - let g:neocomplete#sources = {} - endif - let g:neocomplete#sources._ = ['buffer'] - let g:neocomplete#sources.cpp = ['buffer', 'dictionary'] -< -b:neocomplete_sources *b:neocomplete_sources* - It is a list to decide use source names in buffer local. -> - " Examples: - " In cmdwin, only use vim source. - autocmd CmdwinEnter * let b:neocomplete_sources = ['vim'] -< - *g:neocomplete#release_cache_time* -g:neocomplete#release_cache_time - This variable defines time of automatic released cache by a - second unit. - - Default value is 900. - - *g:neocomplete#tags_filter_patterns* -g:neocomplete#tags_filter_patterns - This dictionary records a pattern to filter a candidate in - the tag completion. For example, it can exclude a candidate - beginning in _ in file type of C/C++. - - Because it is complicated, refer to - neocomplete#init#_variables() in - autoload/neocomplete/init.vim for the initial value. - -g:neocomplete#use_vimproc *g:neocomplete#use_vimproc* - This variable is non 0, neocomplete uses |vimproc|. - Note: If this variable is non 0, neocomplete will make cache - asynchronously. - - Default value is vimproc auto detection result. - - *g:neocomplete#skip_auto_completion_time* -g:neocomplete#skip_auto_completion_time - It is a string for skip auto completion. - If completion time is higher than it, neocomplete will skip - auto completion. - If it is "", the skip feature will be disabled. - - Default value is "0.3". - {only available when compiled with the |+reltime| feature} - - *g:neocomplete#enable_auto_close_preview* -g:neocomplete#enable_auto_close_preview - If it is non-zero, neocomplete will close preview window - automatically. - - Default value is 0. - - *g:neocomplete#fallback_mappings* -g:neocomplete#fallback_mappings - Neocomplete fallback mappings. - If you want to complete keywords by neocomplete and the - omnifunc, it is useful. > - " Search from neocomplete, omni candidates, vim keywords. - let g:neocomplete#fallback_mappings = - \ ["\\", "\\"] -< - Default value is []. - -SOURCES VARIABLES *neocomplete-sources-variables* - - *g:neocomplete#sources#buffer#cache_limit_size* -g:neocomplete#sources#buffer#cache_limit_size - This variable sets file size to make a cache of a file. If - open file is bigger than this size, neocomplete does not - make a cache. - - Default value is 500000. - - *g:neocomplete#sources#buffer#disabled_pattern* -g:neocomplete#sources#buffer#disabled_pattern - This variable sets a pattern of the buffer file path. If - matched it, neocomplete does not save a cache of the buffer. - When it is an empty character string, neocomplete will - ignore. - - Default value is ''. - - *g:neocomplete#sources#buffer#max_keyword_width* -g:neocomplete#sources#buffer#max_keyword_width - If the keyword length exceeds the length it will be not shown - in popup menu. - - Default value is 80. - - *g:neocomplete#sources#dictionary#dictionaries* -g:neocomplete#sources#dictionary#dictionaries - It is a dictionary to connect a dictionary file with file - type. The dictionary's key is filetype and comma-separated - multiple value is a path to a dictionary file. If the - variable is unset or has an empty key, the native 'dictionary' - option will be inherited. When you set "text" - key, you will appoint dictionary files in text mode. If the - key is "_", it is loaded in every filetype. - Note: Global 'dictionary' file is not loaded automatically. - - Default value is {}. - - *g:neocomplete#sources#member#prefix_patterns* -g:neocomplete#sources#member#prefix_patterns - This variable appoints a prefix pattern to complete a member - in buffer. - This is appointed in regular expression every file type. - If filetype key is not set, disable member completion. - - Because it is complicated, refer in - autoload/neocomplete/sources/buffer.vim for the - initial value. - - *g:neocomplete#sources#member#input_patterns* -g:neocomplete#sources#member#input_patterns - This variable appoints a keyword pattern to complete a member - in buffer. - This is appointed in regular expression every file type. - If filetype key is not set, use filetype "_" setting. - - Because it is complicated, refer in - autoload/neocomplete/sources/buffer.vim for the - initial value. - - *g:neocomplete#sources#omni#functions* -g:neocomplete#sources#omni#functions - This dictionary which appoints omni source call functions. - The key is 'filetype'. The value is omnifunc name String or - List of omnifunc name String. - If |g:neocomplete#sources#omni#functions| [&filetype] is - undefined, omni source calls 'omnifunc'. - If the key is "_", used for all filetypes. - - Default value is {}. - - *g:neocomplete#sources#omni#input_patterns* -g:neocomplete#sources#omni#input_patterns - This dictionary records keyword patterns used in - omni source. This is appointed in regular expression - every file type or 'omnifunc' name. If this pattern is not - defined or empty pattern, neocomplete does not call - 'omnifunc'. - Note: ruby and php omnifunc are disabled, because they are too - slow. - Note: Partial omnifunc has problem when neocomplete call (Ex: - rubycomplete, jedi.vim, cocoa.vim, and clang_complete.) You - should |g:neocomplete#force_omni_input_patterns| instead. - - Because it is complicated, refer to s:source.initialize() - autoload/neocomplete/sources/omni.vim for the - initial value. -> - " Examples: - if !exists('g:neocomplete#sources#omni#input_patterns') - let g:neocomplete#sources#omni#input_patterns = {} - endif - let g:neocomplete#sources#omni#input_patterns.php = - \ '[^. \t]->\%(\h\w*\)\?\|\h\w*::\%(\h\w*\)\?' - let g:neocomplete#sources#omni#input_patterns.c = - \ '[^.[:digit:] *\t]\%(\.\|->\)\%(\h\w*\)\?' -< - *g:neocomplete#sources#tags#cache_limit_size* -g:neocomplete#sources#tags#cache_limit_size - This variable sets file size to make a cache of a file in - tag source. If open file is bigger than this size, - neocomplete does not make a tags cache. - - Default value is 500000. - - *g:neocomplete#sources#vim#complete_functions* -g:neocomplete#sources#vim#complete_functions - This dictionary which appoints vim source call function - when completes custom and customlist command. The key is - command name. The value is function name. - - Default value is {}. -> - " Examples: - if !exists('g:neocomplete#sources#vim#complete_functions') - let g:neocomplete#sources#vim#complete_functions = {} - endif - let g:neocomplete#sources#vim#complete_functions.Ref = - \ 'ref#complete' -< - *g:neocomplete#ignore_source_files* -g:neocomplete#ignore_source_files - Ignore source filenames (not full path.) You can optimize - source initialization. - - Note: You cannot use the sources in ignored source files. -> - let g:neocomplete#ignore_source_files = ['tag.vim'] -< - The default value is []. - ------------------------------------------------------------------------------- -FUNCTIONS *neocomplete-functions* - -neocomplete#initialize() *neocomplete#initialize()* - Initialize neocomplete and sources. - Note: It enables neocomplete. - Note: You should call it in |VimEnter| autocmd. - User customization for neocomplete must be set before - initialization of neocomplete. - -neocomplete#custom#source({source-name}, {option-name}, {value}) - *neocomplete#custom#source()* - Set {source-name} source specialized {option-name} - to {value}. You may specify multiple sources with - separating "," in {source-name}. - If {source-name} is "_", sources default option will be - change. - - These options below are available: - |neocomplete-source-attributes| - Note: User customization for neocomplete must be set before - initialization of neocomplete. - - *neocomplete#custom_source()* - neocomplete#custom_source() is used for compatibility. - - *neocomplete#get_context_filetype()* -neocomplete#get_context_filetype() - Get current context filetype of the cursor. This is smarter - than 'filetype' about handling nested filetypes. - Note: To enable context filetype feature, you must install - context_filetype.vim. - https://github.com/Shougo/context_filetype.vim - - For example html filetype has javascript inside. Say, you have - a buffer which content is below with filetype is html. -> - -< - At the line 1 and 3, neocomplete#get_context_filetype() is - "html" and at the line 2 it's "javascript", while at any - lines 'filetype' is "html". - - *neocomplete#disable_default_dictionary()* -neocomplete#disable_default_dictionary({variable-name}) - Disable default {variable-name} dictionary initialization. - Note: It must be called in .vimrc. - - *neocomplete#get_default_matchers()* -neocomplete#get_default_matchers() - Get default matchers in current buffer. - - *neocomplete#set_default_matchers()* -neocomplete#set_default_matchers({names}) - Chang default matchers in current buffer. -> - call neocomplete#set_default_matchers('matcher_head') -< ------------------------------------------------------------------------------- -KEY MAPPINGS *neocomplete-key-mappings* - - *neocomplete#start_manual_complete()* -neocomplete#start_manual_complete([{sources}]) - Use this function on inoremap . The keymapping call the - completion of neocomplete. When you rearrange the completion - of the Vim standard, you use it. - If you give {sources} argument, neocomplete call {sources}. - {sources} is name of source or list of sources name. -> - inoremap neocomplete#start_manual_complete() -< - *neocomplete#close_popup()* -neocomplete#close_popup() - Insert candidate and close popup menu for neocomplete. - Note: It is deprecated function. You should use "\" - character instead. - - *neocomplete#cancel_popup()* -neocomplete#cancel_popup() - Cancel completion menu for neocomplete. - Note: It is deprecated function. You should use "\" - character instead. - - *neocomplete#smart_close_popup()* -neocomplete#smart_close_popup() - Insert candidate and re-generate popup menu for neocomplete. - Unlike |neocomplete#close_popup()|, this function changes - behavior by |g:neocomplete#enable_auto_select| smart. - Note: This mapping is conflicted with |SuperTab| or |endwise| - plugins. - Note: This key mapping is for or keymappings. - You should not use it for . - - *neocomplete#undo_completion()* -neocomplete#undo_completion() - Use this function on inoremap to undo inputted - candidate. Because there is not mechanism to cancel - candidate in Vim, it will be convenient when it inflects. -> - inoremap neocomplete#undo_completion() -< - *neocomplete#complete_common_string()* -neocomplete#complete_common_string() - Use this function on inoremap to complete common - string in candidates. It will be convenient when candidates - have long common string. -> - inoremap neocomplete#complete_common_string() - inoremap - \ neocomplete#complete_common_string() != '' ? - \ neocomplete#complete_common_string() : - \ pumvisible() ? "\" : "\" -< - *(neocomplete_start_unite_complete)* -(neocomplete_start_unite_complete) - Start completion with |unite|. - Note: unite.vim Latest ver.3.0 or above is required. - Note: In unite interface, uses partial match instead of head - match. - - *(neocomplete_start_quick_match)* -(neocomplete_start_unite_quick_match) - Start completion with |unite| and start quick match mode. - Note: unite.vim Latest ver.3.0 or above is required. - -============================================================================== -EXAMPLES *neocomplete-examples* -> - " Note: This option must set it in .vimrc (_vimrc). - " NOT IN .gvimrc (_gvimrc)! - " Disable AutoComplPop. - let g:acp_enableAtStartup = 0 - " Use neocomplete. - let g:neocomplete#enable_at_startup = 1 - " Use smartcase. - let g:neocomplete#enable_smart_case = 1 - - " Define dictionary. - let g:neocomplete#sources#dictionary#dictionaries = { - \ 'default' : '', - \ 'vimshell' : $HOME.'/.vimshell_hist', - \ 'scheme' : $HOME.'/.gosh_completions' - \ } - - " Define keyword. - if !exists('g:neocomplete#keyword_patterns') - let g:neocomplete#keyword_patterns = {} - endif - let g:neocomplete#keyword_patterns['default'] = '\h\w*' - - " Plugin key-mappings. - inoremap neocomplete#undo_completion() - inoremap neocomplete#complete_common_string() - - " Recommended key-mappings. - " : close popup and save indent. - inoremap =my_cr_function() - function! s:my_cr_function() - return (pumvisible() ? "\" : "" ) . "\" - " For no inserting key. - "return pumvisible() ? "\" : "\" - endfunction - " : completion. - inoremap - \ pumvisible() ? "\" : - \ check_back_space() ? "\" : - \ neocomplete#start_manual_complete() - function! s:check_back_space() abort "{{{ - let col = col('.') - 1 - return !col || getline('.')[col - 1] =~ '\s' - endfunction"}}} - " , : close popup and delete backword char. - inoremap neocomplete#smart_close_popup()."\" - inoremap neocomplete#smart_close_popup()."\" - " Close popup by . - "inoremap pumvisible() ? "\" : "\" - - " AutoComplPop like behavior. - "let g:neocomplete#enable_auto_select = 1 - - " Shell like behavior (not recommended.) - "set completeopt+=longest - "let g:neocomplete#enable_auto_select = 1 - "let g:neocomplete#disable_auto_complete = 1 - "inoremap pumvisible() ? "\" : - " \ neocomplete#start_manual_complete() - - " Enable omni completion. - autocmd FileType css setlocal omnifunc=csscomplete#CompleteCSS - autocmd FileType html,markdown setlocal omnifunc=htmlcomplete#CompleteTags - autocmd FileType javascript setlocal omnifunc=javascriptcomplete#CompleteJS - autocmd FileType python setlocal omnifunc=pythoncomplete#Complete - autocmd FileType xml setlocal omnifunc=xmlcomplete#CompleteTags - - " Enable heavy omni completion. - if !exists('g:neocomplete#sources#omni#input_patterns') - let g:neocomplete#sources#omni#input_patterns = {} - endif - if !exists('g:neocomplete#force_omni_input_patterns') - let g:neocomplete#force_omni_input_patterns = {} - endif - "let g:neocomplete#sources#omni#input_patterns.php = - "\ '[^. \t]->\%(\h\w*\)\?\|\h\w*::\%(\h\w*\)\?' - "let g:neocomplete#sources#omni#input_patterns.c = - "\ '[^.[:digit:] *\t]\%(\.\|->\)\%(\h\w*\)\?' - "let g:neocomplete#sources#omni#input_patterns.cpp = - "\ '[^.[:digit:] *\t]\%(\.\|->\)\%(\h\w*\)\?\|\h\w*::\%(\h\w*\)\?' - - " For perlomni.vim setting. - " https://github.com/c9s/perlomni.vim - let g:neocomplete#sources#omni#input_patterns.perl = - \ '[^. \t]->\%(\h\w*\)\?\|\h\w*::\%(\h\w*\)\?' - - " For smart TAB completion. - "inoremap pumvisible() ? "\" : - " \ check_back_space() ? "\" : - " \ neocomplete#start_manual_complete() - " function! s:check_back_space() "{{{ - " let col = col('.') - 1 - " return !col || getline('.')[col - 1] =~ '\s' - " endfunction"}}} -< -============================================================================== -SOURCES *neocomplete-sources* - -neocomplete reads automatically sources saved in an -autoload/neocomplete/sources directory. - -buffer *neocomplete-source-buffer* - This source collects keywords from buffer. - -member *neocomplete-source-member* - This source collects use of member variables from buffer. - -tag *neocomplete-source-tag* - This source analyzes a tag file from tagfiles() for completion. - When a huge tag file (above - |g:neocomplete#sources#tags#cache_limit_size|) is set, - neocomplete does not make cache if you do not execute - |:NeoCompleteTagMakeCache| command. Because tag is - too slow if tag read a big tags file. You should use - more convenient include source completion now. - -dictionary *neocomplete-source-dictionary* - This source adds candidates from 'dictionary' or - |g:neocomplete#sources#dictionary#dictionaries|. - -file *neocomplete-source-file* - This source collects filename candidates. - Note: It is relative path to current buffer directory. - -omni *neocomplete-source-omni* - This source calls 'omnifunc' automatically when cursor - text is matched with - |g:neocomplete#sources#omni#input_patterns|. If - |g:neocomplete_omni_function_list| is defined, neocomplete - will give priority it. - Note: It supports the fuzzy match using the previous result. - - -suffix of complete candidates in popup menu declaration. -(This will be good for user to know where candidate from and what it is.) - - file -> [F] {filename} - file/include -> [FI] {filename} - dictionary -> [D] {words} - member -> [M] member - buffer -> [B] {buffer} - syntax -> [S] {syntax-keyword} - include -> [I] - neosnippet -> [neosnip] - UltiSnips -> [US] - vim -> [vim] type - omni -> [O] - tag -> [T] - other sources -> [plugin-name-prefix] - ------------------------------------------------------------------------------- -USER SOURCES *neocomplete-user-sources* - -This section, introduce non default neocomplete sources. - -neosnippet *neocomplete-sources-neosnippet* - This source is for snippets completion. - https://github.com/Shougo/neosnippet - -UltiSnips *neocomplete-sources-ultisnips* - This source is for UltiSnips snippets completion. - https://github.com/SirVer/ultisnips - -neco-ghc *neocomplete-sources-neco-ghc* - https://github.com/eagletmt/neco-ghc - eagletmt originally implemented and ujihisa added some new - features. It completes a source file written in Haskell. - It requires ghc-mod . - -neco-vim *neocomplete-sources-neco-vim* - https://github.com/Shougo/neco-vim - It analyzes context and start Omni completion of Vim script. - It does not work other than editing time of Vim script. I - created it because neocomplete cannot call |i_CTRL-X_CTRL-V|. - Local variable and a script variable, a function and the - analysis of the command are implemented now. - -============================================================================== -FILTERS *neocomplete-filters* - -To custom candidates, neocomplete uses the filters. There are three kinds of -filters are available. "matcher" is to filter candidates by user input. -"sorter" is to sort candidates. "converter" is to candidates conversion. - -Default sources are below. But you can create original filters (cf: -|neocomplete-create-filter|) and set them by -|neocomplete#custom#source()|. -> - call neocomplete#custom#source( - \ 'buffer', 'converters', []) - - " Change default matcher. - call neocomplete#custom#source('_', 'matchers', - \ ['matcher_head', 'matcher_length']) - - " Change default sorter. - call neocomplete#custom#source('_', 'sorters', - \ ['sorter_length']) - - " Disable sort. - call neocomplete#custom#source('_', 'sorters', []) - - " Change default converter. - call neocomplete#custom#source('_', 'converters', - \ ['converter_remove_overlap', 'converter_remove_last_paren', - \ 'converter_delimiter', 'converter_abbr']) -< - *neocomplete-filter-matcher_default* -Default matchers: - If |g:neocomplete#enable_fuzzy_completion|: - ['matcher_head', 'matcher_length'] - Otherwise: - ['matcher_fuzzy', 'matcher_length'] - - You can change it by |neocomplete#set_default_matchers()|. - - *neocomplete-filter-sorter_default* -Default sorters: ['sorter_rank']. - - *neocomplete-filter-converter_default* -Default converters: ['converter_remove_overlap', - \ 'converter_delimiter', 'converter_abbr']. - - *neocomplete-filter-matcher_head* -matcher_head Head matching matcher. - - *neocomplete-filter-matcher_fuzzy* -matcher_fuzzy Fuzzy matching matcher. - - *neocomplete-filter-matcher_length* -matcher_length Input keyword length matcher. It removes candidates which is - less than input keyword length. - - *neocomplete-filter-matcher_nothing* -matcher_nothing Nothing matcher. It disables the matcher filtering. - - *neocomplete-filter-sorter_rank* -sorter_rank Matched rank order sorter. The higher the matched word is - already selected or in current buffer - - *neocomplete-filter-sorter_length* -sorter_length Candidates length order sorter. - - *neocomplete-filter-sorter_word* -sorter_word Candidates word order sorter. - - *neocomplete-filter-converter_abbr* -converter_abbr - The converter which abbreviates a candidate's abbr. - - *neocomplete-filter-converter_disable_abbr* -converter_disable_abbr - The converter which disables a candidate's abbr. - - *neocomplete-filter-converter_delimiter* -converter_delimiter - The converter which abbreviates a candidate's delimiter. - (cf: |g:neocomplete#delimiter_patterns|) - - *neocomplete-filter-converter_remove_overlap* -converter_remove_overlap - The converter which removes overlapped text in a candidate's - word. - Note: It removes candidates which is not overlapped - (it is in auto completion only). - - *neocomplete-filter-converter_remove_last_paren* -converter_remove_last_paren - The converter which removes last parentheses in a - candidate's word. It is useful if you use auto closing - parentheses plugins. - - *neocomplete-filter-converter_add_paren* -converter_add_paren - The converter which adds parentheses in a candidate's word. It - is useful if you use |neopairs.vim| or |neosnippet.vim| - plugins. - -============================================================================== -CREATE SOURCE *neocomplete-create-source* - -In this clause, I comment on a method to make source of neocomplete. The -ability of neocomplete will spread by creating source by yourself. - -The files in autoload/neocomplete/sources are automatically loaded and it -calls neocomplete#sources#{source_name}#define() whose return value is the -source. Each return value can be a list so you can return an empty list to -avoid adding undesirable sources. To add your own sources dynamically, you -can use |neocomplete#define_source()|. - ------------------------------------------------------------------------------- -SOURCE ATTRIBUTES *neocomplete-source-attributes* - - *neocomplete-source-attribute-name* -name String (Required) - The name of a source. Allowed characters are: - - a-z - - 0-9 - - _ - - / - - - (Not head) - - *neocomplete-source-attribute-kind* -kind String (Optional) - The kind of the source. It decides the behaviour of the - complete position. The following values are available: - - "manual": The source decides the complete position manually - with the "get_complete_position" attribute. - See also: - |neocomplete-source-attribute-get_complete_position| - - "keyword": The source decides the complete position with - |g:neocomplete#keyword_patterns|. This pattern is - also used to filter the candidates. - - Note that "plugin", "complfunc" and "ftplugin" are old values - that are no longer accepted. - - - *neocomplete-source-attribute-filetypes* -filetypes Dictionary (Optional) - Available filetype dictionary. - - For example: -> - let source = { - \ 'name' : 'test', - \ 'kind' : 'manual', - \ 'filetypes' : { 'vim' : 1, 'html' : 1 }, - \} -< - The source is available in vim and html filetypes. - - If you omit it, this source available in all filetypes. - - *neocomplete-source-attribute-disabled_filetypes* -disabled_filetypes Dictionary (Optional) - Not available filetype dictionary. - If the key is "_", the source is disabled in all sources. - - *neocomplete-source-attribute-rank* -rank Number (Optional) - Source priority. Higher values imply higher priority. - If you omit it, it is set below value. - Note: It is high priority than match position. - - If kind attribute is "keyword": 5 - If filetype attribute is empty: 10 - Otherwise: 100 - - Example: -> - " Change vim source default rank value of 300. - call neocomplete#custom#source('ultisnips', 'rank', 1000) -< - *neocomplete-source-attribute-min_pattern_length* -min_pattern_length - Number (Optional) - Required pattern length for completion. - - If you omit it, it is set to - |g:neocomplete#auto_completion_start_length| - - *neocomplete-source-attribute-input_pattern* -input_pattern - String (Optional) - If it is matched, neocomplete ignores - |neocomplete-source-attribute-min_pattern_length|. - It is useful for omni function sources. - - If you omit it, it is set to "". - - *neocomplete-source-attribute-max_candidates* -max_candidates - Number (Optional) - The maximum number of candidates. - - This attribute is optional; if it is not given, 0 is used as - the default value. This means maximum number is infinity. - - *neocomplete-source-attribute-keyword_patterns* -keyword_patterns - Dictionary (Optional) - This dictionary changes keyword patterns to completion for - specific types. -> - let keyword_patterns = {} - let keyword_patterns.tex = '\\\?\h\w*' - call neocomplete#custom#source('dictionary', - \ 'keyword_patterns', keyword_patterns) -< - This attribute is optional; if it is not given, - |g:neocomplete#keyword_patterns| is used as the default value. - - *neocomplete-source-attribute-is_volatile* -is_volatile Number (Optional) - Whether the source recalculates the candidates everytime the - input is changed. - This attribute is optional. - If it's not given, 0 is set as the default value. In this - case, candidates are cached. - - *neocomplete-source-attribute-disabled* -disabled Number (Optional) - This attribute is optional. - If it's not given, 0 is set as the default value. - Otherwise, the source is disabled. - - *neocomplete-source-attribute-hooks* -hooks Dictionary (Optional) - You may put hook functions in this dictionary in which the key - is the position to hook and the value is the reference to the - function to be called. The following hook functions are - defined: - - *neocomplete-source-attribute-hooks-on_init* - on_init - Called when initializing the source. - This function takes {context} as its parameters. - - *neocomplete-source-attribute-hooks-on_final* - on_final - Called after executing |:NeoCompleteDisable|. - This function takes {context} as its parameters. - - *neocomplete-source-attribute-hooks-on_post_filter* - on_post_filter - Called after the filters to narrow down the - candidates. This is used to set attributes. This - filters is to avoid adversely affecting the - performance. - This function takes {context} as its parameters. - - *neocomplete-source-attribute-get_complete_position* -get_complete_position Function (Optional) - This function takes {context} as its parameter and returns - complete position in current line. - Here, {context} is the context information when the source is - called(|neocomplete-notation-{context}|). - If you omit it, neocomplete will use the position using - |g:neocomplete#keyword_patterns|. - Note: If the source returns candidates which are not matched - |g:neocomplete#keyword_patterns|, you must define - |neocomplete-source-attribute-get_complete_position|. - - *neocomplete-source-attribute-gather_candidates* -gather_candidates Function (Required) - This function is called in gathering candidates. If you - enabled fuzzy completion by - |g:neocomplete#enable_fuzzy_completion| , this function is - called whenever the input string is changed. This function - takes {context} as its parameter and returns a list of - {candidate}. Here, {context} is the context information when - the source is called(|neocomplete-notation-{context}|). - -{context} *neocomplete-notation-{context}* - A dictionary to give context information. - The followings are the primary information. - The global context information can be acquired by - |neocomplete#get_context()|. - - input (String) - The input string of current line. - - complete_pos (Number) - The complete position of current source. - - complete_str (String) - The complete string of current source. - - source__{name} (Unknown) (Optional) - Additional source information. - Note: Recommend sources save - variables instead of s: variables. - ------------------------------------------------------------------------------- -CANDIDATE ATTRIBUTES *neocomplete-candidate-attributes* - - *neocomplete-candidate-attribute-name* -word String (Required) - The completion word of a candidate. It is used for matching - inputs. - - *neocomplete-candidate-attribute-abbr* -abbr String (Optional) - The abbreviation of a candidate. It is displayed in popup - window. It is omitted by |g:neocomplete#max_keyword_width|. - - *neocomplete-candidate-attribute-kind* -kind String (Optional) - The kind of a candidate. It is displayed in popup window. - - *neocomplete-candidate-attribute-menu* -menu String (Optional) - The menu information of a candidate. It is displayed in popup - window. - - *neocomplete-candidate-attribute-info* -info String (Optional) - The preview information of a candidate. If 'completeopt' - contains "preview", it will be displayed in |preview-window|. - - *neocomplete-candidate-attribute-rank* -rank Number (Optional) - The completion priority. - -CONTEXT *neocomplete-context* - -============================================================================== -CREATE FILTER *neocomplete-create-filter* - -The files in autoload/neocomplete/filters are automatically loaded and it -calls neocomplete#filters#{filter_name}#define() whose return value is the -filter. Each return value can be a list so you can return an empty list to -avoid adding undesirable filters. To add your own filters dynamically, you -can use |neocomplete#define_filter()|. - ------------------------------------------------------------------------------- -FILTER ATTRIBUTES *neocomplete-filter-attributes* - - - *neocomplete-filter-attribute-name* -name String (Required) - The filter name. - - *neocomplete-filter-attribute-filter* -filter Function (Required) - The filter function. This function takes {context} as its - parameter and returns a list of {candidate}. - The specification of the parameters and the returned value is - same as |neocomplete-source-attribute-gather_candidates|. - - *neocomplete-filter-attribute-description* -description String (Optional) - The filter description string. - -============================================================================== -UNITE SOURCES *neocomplete-unite-sources* - - *neocomplete-unite-source-neocomplete* -neocomplete - Nominates neocomplete completion candidates. The kind is - "completion". This source is used in - |(neocomplete_start_unite_complete)|. -> - imap (neocomplete_start_unite_complete) - imap (neocomplete_start_unite_quick_match) -< -============================================================================== -EXTERNAL SOURCES *neocomplete-external-sources* - -neosnippet source: - -https://github.com/Shougo/neosnippet.vim - -include, file/include sources: - -https://github.com/Shougo/neoinclude.vim - -UltiSnips source: - -https://github.com/SirVer/ultisnips - -vimshell source: - -https://github.com/Shougo/vimshell.vim - -look source: - -https://github.com/ujihisa/neco-look - -ghc source: - -https://github.com/eagletmt/neco-ghc - -calc source: - -https://github.com/hrsh7th/vim-neco-calc - -============================================================================== -FAQ *neocomplete-faq* - -Q: My customization for neocomplete is invalid. Why? - -A: User customization for neocomplete must be set before initialization of -neocomplete. For example: |neocomplete#custom#source()| - -Q: I want to use head match instead of default fuzzy match. - -A: -> - let g:neocomplete#enable_fuzzy_completion = 0 -< -or -> - call neocomplete#custom#source('_', 'matchers', - \ ['matcher_head', 'matcher_length']) -< -Q: I want to sort candidates by different way. - -A: -> -> - call neocomplete#custom#source('_', 'sorters', - \ ['sorter_length']) -< -Q: Is there a way to control the colors used for popup menu using highlight -groups?: - -A: Like this: -> - highlight Pmenu ctermbg=8 guibg=#606060 - highlight PmenuSel ctermbg=1 guifg=#dddd00 guibg=#1f82cd - highlight PmenuSbar ctermbg=0 guibg=#d6d6d6 -< - -Q: Python (or Ruby) interface crashes Vim when I use neocomplete or not -responding when input ".": - -A: This is not neocomplete's issue. Please report to the maintainers of the -omnicomplete (rubycomplete or pythoncomplete) and its Vim interface. You -should disable omni source in python or ruby. -> - if !exists('g:neocomplete#sources#omni#input_patterns') - let g:neocomplete#sources#omni#input_patterns = {} - endif - let g:neocomplete#sources#omni#input_patterns.python = '' - let g:neocomplete#sources#omni#input_patterns.ruby = '' -< - -Q: Where are the snippets for neocomplete? - -A: https://github.com/Shougo/neosnippet or -https://github.com/SirVer/ultisnips - - -Q: How can I disable python omni complete of neocomplete?: - -A: -> - if !exists('g:neocomplete#sources#omni#input_patterns') - let g:neocomplete#sources#omni#input_patterns = {} - endif - let g:neocomplete#sources#omni#input_patterns.python = '' -< - -Q: Can I enable quick match?: - -A: Quick match feature had been removed in latest neocomplete -because quick match turned into hard to implement. -But you can use |unite.vim| instead to use quick match. -> - imap - pumvisible() ? - \ "\(neocomplete_start_unite_quick_match)" : '-' -< - -Q: neocomplete cannot create cache files in "sudo vim": - -A: Because neocomplete (and other plugins) creates temporary files in super -user permission by sudo command. You must use sudo.vim or set "Defaults -always_set_home" in "/etc/sudoers", or must use "sudoedit" command. - -Ubuntu has a command "sudoedit" which can work well with neocomplete. -I'm not sure if other distros has this command... - -http://www.vim.org/scripts/script.php?script_id=729 - - -Q: Error occurred in ruby omni complete using -|g:neocomplete#sources#omni#input_patterns|. -https://github.com/vim-ruby/vim-ruby/issues/95 - -A: Please set |g:neocomplete#force_omni_input_patterns| instead of -|g:neocomplete#sources#omni#input_patterns|. - -Q: Does not work with clang_complete. - -A: Please try below settings. -> - if !exists('g:neocomplete#force_omni_input_patterns') - let g:neocomplete#force_omni_input_patterns = {} - endif - let g:neocomplete#force_omni_input_patterns.c = - \ '[^.[:digit:] *\t]\%(\.\|->\)\w*' - let g:neocomplete#force_omni_input_patterns.cpp = - \ '[^.[:digit:] *\t]\%(\.\|->\)\w*\|\h\w*::\w*' - let g:neocomplete#force_omni_input_patterns.objc = - \ '\[\h\w*\s\h\?\|\h\w*\%(\.\|->\)' - let g:neocomplete#force_omni_input_patterns.objcpp = - \ '\[\h\w*\s\h\?\|\h\w*\%(\.\|->\)\|\h\w*::\w*' - let g:clang_complete_auto = 0 - let g:clang_auto_select = 0 - let g:clang_omnicppcomplete_compliance = 0 - let g:clang_make_default_keymappings = 0 - "let g:clang_use_library = 1 -< - -Q: I want to support omni patterns for external plugins. - -A: You can add find some already found omni patterns and functions at here. - -Note: Some patterns are omitted here, (someone should check out those plugin's -source code's complete function, and find out the omni pattern). -> - " Go (plugin: gocode) - let g:neocomplete#sources#omni#functions.go = - \ 'gocomplete#Complete' - " Clojure (plugin: vim-clojure) - let g:neocomplete#sources#omni#functions.clojure = - \ 'vimclojure#OmniCompletion' - " SQL - let g:neocomplete#sources#omni#functions.sql = - \ 'sqlcomplete#Complete' - " R (plugin: vim-R-plugin) - let g:neocomplete#sources#omni#input_patterns.r = - \ '[[:alnum:].\\]\+' - let g:neocomplete#sources#omni#functions.r = - \ 'rcomplete#CompleteR' - " XQuery (plugin: XQuery-indentomnicomplete) - let g:neocomplete#sources#omni#input_patterns.xquery = - \ '\k\|:\|\-\|&' - let g:neocomplete#sources#omni#functions.xquery = - \ 'xquerycomplete#CompleteXQuery' -< - -Q: Does not indent when I input "else" in ruby filetype. - -A: - -You must install "vim-ruby" from github to indent in neocomplete first. -https://github.com/vim-ruby/vim-ruby - -neocomplete pops up a completion window automatically, but if the popup -window is already visible, Vim cannot indent text. So you must choose "close -popup window manually by or mappings" or "close popup window by - user mappings". - -Q: mapping conflicts with |SuperTab| or |endwise| plugins. - -A: Please try below settings. -> - " : close popup and save indent. - inoremap =my_cr_function() - function! s:my_cr_function() - return (pumvisible() ? "\" : "" ) . "\" - " For no inserting key. - "return pumvisible() ? "\" : "\" - endfunction -> -Q: Suggestions are case insensitive in "gitcommit" buffers, but not -"javascript". - -A: This is g:neocomplete#text_mode_filetypes feature. -You can disable it by following code. -> - if !exists('g:neocomplete#text_mode_filetypes') - let g:neocomplete#tags_filter_patterns = {} - endif - let g:neocomplete#text_mode_filetypes.gitcommit = 0 -< -Q: I want to use Ruby omni completion. - -A: Please set |g:neocomplete#force_omni_input_patterns|. But this completion -is heavy, so disabled by default. -Note: But you should use |vim-monster| instead of rubycomplete. -https://github.com/osyo-manga/vim-monster -> - autocmd FileType ruby setlocal omnifunc=rubycomplete#Complete - if !exists('g:neocomplete#force_omni_input_patterns') - let g:neocomplete#force_omni_input_patterns = {} - endif - let g:neocomplete#force_omni_input_patterns.ruby = - \ '[^. *\t]\.\w*\|\h\w*::' -< -Q: I want to use jedi omni completion. -https://github.com/davidhalter/jedi-vim - -A: Please set |g:neocomplete#force_omni_input_patterns| as below. -> - autocmd FileType python setlocal omnifunc=jedi#completions - let g:jedi#completions_enabled = 0 - let g:jedi#auto_vim_configuration = 0 - let g:jedi#smart_auto_mappings = 0 - let g:neocomplete#force_omni_input_patterns.python = - \ '\%([^. \t]\.\|^\s*@\|^\s*from\s.\+import \|^\s*from \|^\s*import \)\w*' - " alternative pattern: '\h\w*\|[^. \t]\.\w*' -< -Q: Candidates are not found in heavy completion (neco-look, etc.) - -A: It may be caused by skip completion. - - -Q: I want to disable skip completion. - -A: -> - let g:neocomplete#skip_auto_completion_time = '' -< -Q: I want to initialize neocomplete in .vimrc. - -A: Please call neocomplete#initialize() in .vimrc. But this function slows -your Vim initialization. -> - call neocomplete#initialize() -< -Q: neocomplete conflicts when multibyte input in GVim. - -A: Because Vim multibyte IME integration is incomplete. -You should use "fcitx" instead of "ibus". -If you set |g:neocomplete#lock_iminsert| is non-zero, it may be fixed. - -Q: Freeze for a while and close opened folding when I begin to insert. -https://github.com/Shougo/neocomplcache.vim/issues/368 - -A: I think you use 'foldmethod' is "expr" or "syntax". It is too heavy to use -neocomplete (or other auto completion.) You should change 'foldmethod' -option or install FastFold plugin. - -https://github.com/Konfekt/FastFold - -Note: In current version, neocomplete does not restore 'foldmethod'. Because -it is too heavy. - -Q: I want to use Pydiction with neocomplete. - -A: You should set |g:neocomplete#sources#dictionary#dictionaries|. -neocomplete can load Pydiction dictionary file. - -Q: Why does neocomplcache use if_lua besides if_python? Many people may not be -able to use it because they do not have the root privilege to recompile vim. - -A: -Because of the following reasons. - 1. Python interface is not available on every Vim environment. For example, - Android, iOS, non configured Vim, or etc. - 2. Incompatibility between Python2 and Python3. I must rewrite for it. - 3. Loading Python interface is slow (10~20ms), but loading Lua interface is - absolutely fast (270ns). - 4. Python2 and Python3 are not loaded at the same time on Unix environment. - 5. Python itself is too large. - 6. Python interface is slower than Lua interface (almost twice.) - 7. Lua interface is stable (no crashes on latest Vim.) - 8. Using C module (like vimproc, YouCompleteMe) is hard to compile on Windows - environment. - 9. Using both Python and C, like YouCompleteMe, is too unstable. Your Vim may - crashes or causes mysterious errors. - 10. To build if_lua is easy. - 11. I think if_lua is the second level language in Vim (The first is Vim - script.) - -Q: I want to disable preview window. - -A: -> - set completeopt-=preview -< - -Q: I want to use "vim-lua-ftplugin". -https://github.com/xolox/vim-lua-ftplugin - -A: Please set |g:neocomplete#sources#omni#input_patterns| as below. -Note: You can not use "vim-lua-ftplugin" on 7.3.885 or below, -because if_lua has double-free problem. -> - let g:lua_check_syntax = 0 - let g:lua_complete_omni = 1 - let g:lua_complete_dynamic = 0 - let g:lua_define_completion_mappings = 0 - - let g:neocomplete#sources#omni#functions.lua = - \ 'xolox#lua#omnifunc' - let g:neocomplete#sources#omni#input_patterns.lua = - \ '\w\+[.:]\|require\s*(\?["'']\w*' -< - -Q: I want to disable sources in certain filetype. - -A: -> - " Disable dictionary source in python filetype. - call neocomplete#custom#source('dictionary', - \ 'disabled_filetypes', {'python' : 1}) -< - -Q: neocomplete closes DiffGitCached window from vim-fugitive -https://github.com/Shougo/neocomplcache.vim/issues/424 -A: -> - let g:neocomplete#enable_auto_close_preview = 0 -< - -Q: I want to use PHP omni completion. - -A: -Note: You should use this omni completion for PHP. -https://github.com/shawncplus/phpcomplete.vim -> - let g:neocomplete#sources#omni#input_patterns.php = - \ '\h\w*\|[^. \t]->\%(\h\w*\)\?\|\h\w*::\%(\h\w*\)\?' -< - -Q: Eclim does not work well with neocomplete. -https://github.com/Shougo/neocomplete.vim/issues/39 - -A: neocomplete does not support eclim. You should use -|g:neocomplete#force_omni_input_patterns| instead of -|g:neocomplete#sources#omni#input_patterns|. -> - if !exists('g:neocomplete#force_omni_input_patterns') - let g:neocomplete#force_omni_input_patterns = {} - endif - let g:neocomplete#force_omni_input_patterns.java = - \ \'\%(\h\w*\|)\)\.\w* - -Q: I want to get quiet messages in auto completion. -https://github.com/Shougo/neocomplcache.vim/issues/448 - -A: Before 7.4 patch 314 it was not possible because of vim's default -behavior. If you are using a recent version of vim you can disable the -messages through the 'shortmess' option. -> - if has("patch-7.4.314") - set shortmess+=c - endif -< -For earlier vim versions you can try to hide them by using the settings below -> - autocmd VimEnter * - \ highlight ModeMsg guifg=bg guibg=bg | highlight WarningMsg guifg=bg -< - -Q: I don't want to complete too long words. -https://github.com/Shougo/neocomplete.vim/issues/69 - -A: You can use |g:neocomplete#sources#buffer#max_keyword_width|. - -Q: neocomplete will change external completeopt value (longest.) -https://github.com/Shougo/neocomplcache.vim/issues/453 - -A: It is feature. Because "longest" completeopt conflicts with auto -completion. To use "longest" option, you must disable auto completion. -"longest" is good feature. But it is for manual completion only. - -Q: autoclose conflicts with neocomplete. -https://github.com/Shougo/neocomplcache.vim/issues/350 - -A: It is autoclose mappings problem. I cannot fix it. You should use -auto-pairs plugin instead of it. -https://github.com/jiangmiao/auto-pairs - -Q: I want to complete by Erlang omnifunc. -https://github.com/vim-erlang/vim-erlang-omnicomplete - -A: > - if !exists('g:neocomplete#force_omni_input_patterns') - let g:neocomplete#force_omni_input_patterns = {} - endif - let g:neocomplete#force_omni_input_patterns.erlang = - \ '\<[[:digit:][:alnum:]_-]\+:[[:digit:][:alnum:]_-]*' - -Q: I want to look selected function's arguments in neocomplete. But I don't -like preview window feature. -https://github.com/Shougo/neocomplete.vim/issues/120 - -A: You can do it by |echodoc|. -http://github.com/Shougo/echodoc.vim - -Q: In ||g:neocomplete#force_omni_input_patterns|, -|g:neocomplete#enable_auto_select| feature is not work. -https://github.com/Shougo/neocomplete.vim/issues/139 - -A: Please update your Vim to 7.4.775 or above. - -Q: I want to disable all sources by default. - -A: > - call neocomplete#custom#source('_', 'disabled', 1) - -Q: I want to disable candidates abbr in tag source. -https://github.com/Shougo/neocomplete.vim/issues/158 - -A: > - call neocomplete#custom#source('tags', 'converters', - \ ['converter_remove_overlap', 'converter_remove_last_paren', - \ 'converter_delimiter', 'converter_disable_abbr', 'converter_abbr']) - -Q: does not work. -https://github.com/Shougo/neocomplete.vim/issues/305 - -A: It is feature. -You must use |neocomplete#start_manual_complete()| instead of . - -Q: My mapping never works. - -A: https://github.com/Shougo/neocomplete.vim/issues/334 -Note: It is fixed in Vim 7.4.653. - -Q: When I press enter, Vim inserts new line instead of selected item. - -A: It is Vim's default behavior (feature.) If you want to select the item, you -should map . > - - inoremap pumvisible()? "\" : "\" - -Q: After updating Vim, some completion plugins automatically select the last -candidate in the popup menu. - -A: Vim 7.4.775 introduced "noselect" and "noinsert" options for 'completeopt'. -It is likely that those completion plugins use keymappings such as to -display the popup menu. However, there is no need to do this after 7.4.775 -since neocomplete.vim handles that part. If that's the case, you will need to -contact the author of the plugin and have it not send those key strokes if -"noselect" or "noinsert" option is present in 'completeopt'. - -Q: Any plan to support Vim 8.0 async API? - -A: No. - -============================================================================== -vim:tw=78:ts=8:ft=help:norl:noet:fen:noet: diff --git a/pack/acp/start/neocomplete.vim/plugin/neocomplete.vim b/pack/acp/start/neocomplete.vim/plugin/neocomplete.vim deleted file mode 100644 index 1c17170..0000000 --- a/pack/acp/start/neocomplete.vim/plugin/neocomplete.vim +++ /dev/null @@ -1,63 +0,0 @@ -"============================================================================= -" FILE: neocomplete.vim -" AUTHOR: Shougo Matsushita -" 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() -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 diff --git a/pack/acp/start/neocomplete.vim/plugin/neocomplete/buffer.vim b/pack/acp/start/neocomplete.vim/plugin/neocomplete/buffer.vim deleted file mode 100644 index db3da89..0000000 --- a/pack/acp/start/neocomplete.vim/plugin/neocomplete/buffer.vim +++ /dev/null @@ -1,24 +0,0 @@ -"============================================================================= -" FILE: buffer.vim -" AUTHOR: Shougo Matsushita -"============================================================================= - -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() -"}}} - -let &cpo = s:save_cpo -unlet s:save_cpo - -let g:loaded_neocomplete_buffer = 1 - -" vim: foldmethod=marker diff --git a/pack/acp/start/neocomplete.vim/plugin/neocomplete/dictionary.vim b/pack/acp/start/neocomplete.vim/plugin/neocomplete/dictionary.vim deleted file mode 100644 index 39d6294..0000000 --- a/pack/acp/start/neocomplete.vim/plugin/neocomplete/dictionary.vim +++ /dev/null @@ -1,24 +0,0 @@ -"============================================================================= -" FILE: dictionary.vim -" AUTHOR: Shougo Matsushita -"============================================================================= - -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() -"}}} - -let &cpo = s:save_cpo -unlet s:save_cpo - -let g:loaded_neocomplete_dictionary = 1 - -" vim: foldmethod=marker diff --git a/pack/acp/start/neocomplete.vim/plugin/neocomplete/member.vim b/pack/acp/start/neocomplete.vim/plugin/neocomplete/member.vim deleted file mode 100644 index 9670160..0000000 --- a/pack/acp/start/neocomplete.vim/plugin/neocomplete/member.vim +++ /dev/null @@ -1,24 +0,0 @@ -"============================================================================= -" FILE: member.vim -" AUTHOR: Shougo Matsushita -"============================================================================= - -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 diff --git a/pack/acp/start/neocomplete.vim/plugin/neocomplete/tag.vim b/pack/acp/start/neocomplete.vim/plugin/neocomplete/tag.vim deleted file mode 100644 index ff58ff3..0000000 --- a/pack/acp/start/neocomplete.vim/plugin/neocomplete/tag.vim +++ /dev/null @@ -1,24 +0,0 @@ -"============================================================================= -" FILE: tag.vim -" AUTHOR: Shougo Matsushita -"============================================================================= - -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 diff --git a/pack/acp/start/neocomplete.vim/test/neocomplete.vim b/pack/acp/start/neocomplete.vim/test/neocomplete.vim deleted file mode 100644 index 1657764..0000000 --- a/pack/acp/start/neocomplete.vim/test/neocomplete.vim +++ /dev/null @@ -1,58 +0,0 @@ - -let s:suite = themis#suite('parser') -let s:assert = themis#helper('assert') - -function! s:suite.escape() abort - call s:assert.equals( - \ neocomplete#filters#fuzzy_escape('abc'), 'a.*b.*c.*') - call s:assert.equals( - \ neocomplete#filters#fuzzy_escape('%a%b%c'), '%%a.*%%b.*%%c.*') - call s:assert.equals( - \ neocomplete#filters#fuzzy_escape('%[ab]c'), '%%%[a.*b.*%]c.*') - call s:assert.equals( - \ neocomplete#filters#fuzzy_escape('.abc'), '%.a.*b.*c.*') -endfunction - -function! s:suite.sort() abort - let candidates = [] - for i in range(1, 1000) - call add(candidates, { 'word' : i, 'rank' : i }) - endfor - function! CompareRank(i1, i2) abort - let diff = (get(a:i2, 'rank', 0) - get(a:i1, 'rank', 0)) - return (diff != 0) ? diff : (len(a:i1.word) < len(a:i2.word)) ? 1 : -1 - endfunction" - - " Benchmark. - let start = reltime() - call sort(copy(candidates), 'CompareRank') - echomsg reltimestr(reltime(start)) - let start = reltime() - call neocomplete#filters#sorter_rank#define().filter( - \ {'candidates' : copy(candidates), 'input' : '' }) - echomsg reltimestr(reltime(start)) - - call s:assert.equals(sort(copy(candidates), 'CompareRank'), - \ neocomplete#filters#sorter_rank#define().filter( - \ {'candidates' : copy(candidates), 'input' : '' })) -endfunction - -function! s:suite.fuzzy() abort - call s:assert.equals(neocomplete#filters#matcher_fuzzy#define().filter( - \ {'complete_str' : 'ae', 'candidates' : ['~/~']}), []) -endfunction - -function! s:suite.overlap() abort - call s:assert.equals(neocomplete#filters#converter_remove_overlap# - \length('foo bar', 'bar baz'), 3) - call s:assert.equals(neocomplete#filters#converter_remove_overlap# - \length('foobar', 'barbaz'), 3) - call s:assert.equals(neocomplete#filters#converter_remove_overlap# - \length('foob', 'baz'), 1) - call s:assert.equals(neocomplete#filters#converter_remove_overlap# - \length('foobar', 'foobar'), 6) - call s:assert.equals(neocomplete#filters#converter_remove_overlap# - \length('тест', 'ст'), len('ст')) -endfunction - -" vim:foldmethod=marker:fen: