Skip to content

Commit

Permalink
Merge branch 'ctrlpvim:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
edlanglois authored Feb 7, 2022
2 parents 40b41ae + ed04d2e commit a085452
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 9 deletions.
13 changes: 13 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -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']
14 changes: 13 additions & 1 deletion autoload/ctrlp.vim
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down Expand Up @@ -1386,6 +1387,7 @@ fu! s:MarkToOpen()
en
en
sil! cal ctrlp#statusline()
redr
endf

fu! s:OpenMulti(...)
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down
10 changes: 7 additions & 3 deletions autoload/ctrlp/buffertag.vim
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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)
Expand Down
18 changes: 13 additions & 5 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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

0 comments on commit a085452

Please sign in to comment.