Sunday, February 5, 2012

Re: Fuzzy Finder vs CtrlP

Michael Ludwig schrieb am 06.02.2012 um 00:33 (+0100):

> I really wonder why [exact substring matching] is not an option yet.

It is easy to make it one. In file autoload/ctrlp.vim, locate the
s:SplitPattern(str) function and shortcut the code that translates
the user input into an all-too liberal pattern that will give you
"MangoldSchinkenCannelloni" if you ask for just "gcc":

diff --git a/autoload/ctrlp.vim b/autoload/ctrlp.vim
index 2730172..e46288e 100644
--- a/autoload/ctrlp.vim
+++ b/autoload/ctrlp.vim
@@ -327,6 +327,10 @@ fu! s:SplitPattern(str) "{{{1
if s:regexp || match(str, '\\\(<\|>\)\|[*|]') >= 0
let pat = s:regexfilter(str)
el
+ " Milu: ...
+ " ...
+ " "gcc" die "MangoldSchinkenCannelloni" liefert.
+ return str
let lst = split(str, '\zs')
if exists('+ssl') && !&ssl
cal map(lst, 'escape(v:val, ''\'')')

Michael

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments: