aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorYudi Zhou2022-03-22 23:24:05 -0700
committerYudi Zhou2022-03-22 23:24:05 -0700
commitaf9c8def6dad637953d827636164591f3342ba8f (patch)
tree76f34b7722e6e8309a1c9a5ec1c067fa1ef4e516
parent8150fdd845a8c26326ceb9418d054370863e826c (diff)
downloadctrlp.vim-af9c8def6dad637953d827636164591f3342ba8f.tar.gz

Improve CtrlP fuzzy finding results on large directories

-rw-r--r--autoload/ctrlp.vim4
-rw-r--r--doc/ctrlp.txt11
2 files changed, 13 insertions, 2 deletions
diff --git a/autoload/ctrlp.vim b/autoload/ctrlp.vim
index db3b66e..2dbb2b6 100644
--- a/autoload/ctrlp.vim
+++ b/autoload/ctrlp.vim
@@ -95,7 +95,7 @@ let [s:pref, s:bpref, s:opts, s:new_opts, s:lc_opts] =
\ 'brief_prompt': ['s:brfprt', 0],
\ 'match_current_file': ['s:matchcrfile', 0],
\ 'match_natural_name': ['s:matchnatural', 0],
- \ 'compare_lim': ['s:compare_lim', 3000],
+ \ 'compare_lim': ['s:compare_lim', 0],
\ 'bufname_mod': ['s:bufname_mod', ':t'],
\ 'bufpath_mod': ['s:bufpath_mod', ':~:.:h'],
\ 'formatline_func': ['s:flfunc', 's:formatline(v:val)'],
@@ -396,7 +396,7 @@ fu! ctrlp#files()
en
" Remove base directory
cal ctrlp#rmbasedir(g:ctrlp_allfiles)
- if len(g:ctrlp_allfiles) <= s:compare_lim
+ if !s:compare_lim || len(g:ctrlp_allfiles) <= s:compare_lim
cal sort(g:ctrlp_allfiles, 'ctrlp#complen')
en
cal s:writecache(cafile)
diff --git a/doc/ctrlp.txt b/doc/ctrlp.txt
index bfa8f7e..da1d515 100644
--- a/doc/ctrlp.txt
+++ b/doc/ctrlp.txt
@@ -847,6 +847,17 @@ Example: >
This is possible to change no-limit mode for match type "path".
+ *ctrlp_compare_lim*
+If your search directory has more number of files than this limit, no sorting
+will be performed for the first readout. You can improve CtrlP performance by
+setting this to a proper value, but no sorting on the first readout can reduce
+the quality of fuzzy finding results.
+Example:
+ let g:ctrlp_compare_lim = 100
+
+Set the value to 0 for unlimited sorting. Default is 0.
+
+
===============================================================================
COMMANDS *ctrlp-commands*