Explanation of g:ctrlp_by_filename:
*'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
To match filename only, the regex should
- End with
[^/]$
- No
/ matches between input letters
Now I see the code is
if a:mmode == 'filename-only'
let s:matchregex .= '[\^\\]*'
endif
If I input a, the regex will be \v\c[\^\\]*a
This is not correct.
The correct regex should be \v\ca[^/]*$
In Windows it should be \v\ca[^\\]*$
If I input ab, the regex will be \v\c[\^\\]*a[^a]*b
And it should be \v\ca[^a/]*b[^/]*$ to avoid / between a and b.
Explanation of
g:ctrlp_by_filename:To match filename only, the regex should
[^/]$/matches between input lettersNow I see the code is
If I input
a, the regex will be\v\c[\^\\]*aThis is not correct.
The correct regex should be
\v\ca[^/]*$In Windows it should be
\v\ca[^\\]*$If I input
ab, the regex will be\v\c[\^\\]*a[^a]*bAnd it should be
\v\ca[^a/]*b[^/]*$to avoid/betweenaandb.