diff options
| author | Eric Langlois | 2022-02-07 15:05:02 -0500 |
|---|---|---|
| committer | GitHub | 2022-02-07 15:05:02 -0500 |
| commit | a085452bb6535cd32395f92d5bb6d08a413ee11f (patch) | |
| tree | 1e85458216f483201c37cbc80265c06f98da0d34 | |
| parent | 40b41ae302596d30de199e0a63f741f93f89fef4 (diff) | |
| parent | ed04d2ec91c78748f0d8ddf69df2f6e5cffa7bb8 (diff) | |
| download | ctrlp.vim-a085452bb6535cd32395f92d5bb6d08a413ee11f.tar.gz | |
Merge branch ‘ctrlpvim:master’ into master
| -rw-r--r-- | .github/FUNDING.yml | 13 | ||||
| -rw-r--r-- | autoload/ctrlp.vim | 14 | ||||
| -rw-r--r-- | autoload/ctrlp/buffertag.vim | 10 | ||||
| -rw-r--r-- | readme.md | 18 |
4 files changed, 46 insertions, 9 deletions
diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 0000000..d8c27bb --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1,13 @@ +# These are supported funding model platforms + +github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] +patreon: # Replace with a single Patreon username +open_collective: ctrlpvim # Replace with a single Open Collective username +ko_fi: # Replace with a single Ko-fi username +tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel +community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry +liberapay: # Replace with a single Liberapay username +issuehunt: # Replace with a single IssueHunt username +otechie: # Replace with a single Otechie username +lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry +custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] diff --git a/autoload/ctrlp.vim b/autoload/ctrlp.vim index 7c0a316..1b6b8c5 100644 --- a/autoload/ctrlp.vim +++ b/autoload/ctrlp.vim @@ -428,7 +428,8 @@ endf if has('patch-8.2-0995') fu! s:GlobPath(dirs, depth) let entries = [] - for e in split(a:dirs, ',') + let dirs = substitute(a:dirs, '\\\([%# ]\)', '\1', 'g') + for e in split(dirs, ',') sil let files = readdir(e, '1', {'sort': 'none'}) if !s:showhidden | cal filter(files, 'v:val[0] != "."') | en let entries += map(files, 'e.s:lash.v:val') @@ -1386,6 +1387,7 @@ fu! s:MarkToOpen() en en sil! cal ctrlp#statusline() + redr endf fu! s:OpenMulti(...) @@ -2712,6 +2714,15 @@ fu! ctrlp#nosy() retu !( has('syntax') && exists('g:syntax_on') ) endf +fu! s:hiupdate() + for [ke, va] in items(s:hlgrps) + let ke = 'CtrlP' . ke + if hlexists(ke) + exe 'hi link' ke va + en + endfo +endf + fu! ctrlp#hicheck(grp, defgrp) if !hlexists(a:grp) exe 'hi link' a:grp a:defgrp @@ -2845,6 +2856,7 @@ if has('autocmd') au BufEnter ControlP cal s:checkbuf() au BufLeave ControlP noa cal s:Close() au VimLeavePre * cal s:leavepre() + au ColorScheme * cal s:hiupdate() aug END en diff --git a/autoload/ctrlp/buffertag.vim b/autoload/ctrlp/buffertag.vim index f36a5cf..4f75e6d 100644 --- a/autoload/ctrlp/buffertag.vim +++ b/autoload/ctrlp/buffertag.vim @@ -203,10 +203,14 @@ endf fu! s:parseline(line) let vals = matchlist(a:line, - \ '\v^([^\t]+)\t(.+)\t[?/]\^?(.{-1,})\$?[?/]\;\"\t(.+)\tline(no)?\:(\d+)') + \ '\v^([^\t]+)\t(.+)\t[?/]\^?(.{-1,})\$?[?/]\;\"\t(.+)\tline(no)?\:(\d+)\t?([^\t]*)') 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] + if len(vals) > 7 && vals[7] != '' + retu vals[1].' '.vals[4].'|'.bufnr.':'.bufname.'|'.vals[6].'|'.vals[7].'| '.vals[3] + else + retu vals[1].' '.vals[4].'|'.bufnr.':'.bufname.'|'.vals[6].'| '.vals[3] + en endf fu! s:syntax() @@ -249,7 +253,7 @@ endf fu! ctrlp#buffertag#accept(mode, str) let vals = matchlist(a:str, - \ '\v^[^\t]+\t+[^\t|]+\|(\d+)\:[^\t|]+\|(\d+)\|\s(.+)$') + \ '\v^[^\t]+\t+[^\t|]+\|(\d+)\:[^\t|]+\|(\d+)%(\|[^\t|]+)?\|\s(.+)$') let bufnr = str2nr(get(vals, 1)) if bufnr cal ctrlp#acceptfile(a:mode, bufnr) @@ -11,6 +11,17 @@ Full path fuzzy __file__, __buffer__, __mru__, __tag__, __...__ finder for Vim. ![ctrlp][1] +## Install + +vim 8+ manages packages all on its own. Installing `ctrlp` is this simple: + +```bash +mkdir -p ~/.vim/pack/plugins/start +git clone --depth=1 https://github.com/ctrlpvim/ctrlp.vim.git ~/.vim/pack/plugins/start/ctrlp +``` + +Of course you can use your favorite plugin manager or check the [quick installation guide][3] for a primitive installation method. + ## 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. @@ -97,13 +108,10 @@ Use `:diffthis` when opening multiple files to run `:diffthis` on the first 4 fi Check `:help ctrlp-options` for other options. -## Installation -Use your favorite method or check the homepage for a [quick installation guide][3]. - ## License CtrlP is distributed under Vim's [license][4]. -[1]: http://i.imgur.com/aOcwHwt.png +[1]: https://i.imgur.com/aOcwHwt.png [2]: https://github.com/ctrlpvim/ctrlp.vim/tree/extensions -[3]: http://ctrlpvim.github.io/ctrlp.vim#installation +[3]: https://ctrlpvim.github.io/ctrlp.vim#installation [4]: http://vimdoc.sourceforge.net/htmldoc/uganda.html |