c
--
Chris Lott <ch...@chrislott.org>
I used FuzzyFinder over a year ago and am now using CtrlP. I also used
Command-t in between. Of those 3 plugins, CtrlP is IMHO by far the best,
although command-t is also nice.
I found FuzzyFinder to be rather slow and have some strange behaviour
from time to time. Command-t is fast, because it uses a small external
application (written in C I believe) to scan for files. CtrlP is also
very fast, because it caches the file list. CtrlP is entirely written in
Vimscript, and that is one of the advantages over Command-T. I can use
CtrlP without any problem on my Nokia N900, while command-t is a lot
more difficult because of it's dependencies on Ruby and a C compiler.
Also CtrlP has more features. It can scan files in the current
directory, from the root of your repository (if using Git for example),
it can scan open buffers, most recently used files, tags etc. With ctrlp
you can also create files and open multiple files at once.
Hope this helps,
Jeroen
--
website: http://budts.be/ - twitter: @teranex
___________________________________
Registered Linux User #482240 - GetFirefox.com - ubuntu.com
> Also CtrlP has more features. It can scan files in the current
> directory, from the root of your repository (if using Git for
> example) […]
Just discoved CtrlP through your message. Looks just great. Does
anyone happen to know how I can make it ignore files und my Mercurial
directory ( .hg ) as I sure don't want to edit those? (Sorry for the
hijack.)
Michael
> Does anyone happen to know how I can make it ignore files und my
> Mercurial directory ( .hg ) as I sure don't want to edit those?
Haha, found it! Documented in the fine manual:
:set wildignore+=*/.hg/*
What a great Vim extension! Sorry for the distraction …
Michael
> What a great Vim extension!
[Re: Fuzzy Finder vs CtrlP]
What would you use if you didn't need or want the fuzziness of the
matching because you found exact matching on filenames or directory
names more useful?
I've read the CtrlP manual, and while there are many options to
configure things there does not see to be one to switch from fuzzy
to exact matching.
Michael
> As far as I know there is no exact matching. There is however
> regex-matching, which does nearly the same. If you enable regex
> matching, for example by pressing ctrl-r while the ctrlp window is
> open, you can just start typing and it will only give you exact
> matches, unless ofcourse, you use special 'regex-characters'.
> However, I found that it can become rather slow on large trees.
Thanks, Jeroen. That's a significant improvement over fuzzy matching.
I agree with your observation on speed. Consider that exact substring
matching should be at least as fast as fuzzy matching. I really wonder
why this is not an option yet. If you type "gcc" and CtrlP comes up
with a suggestion of "kochen\MangoldSchinkenCannelloni.html", it might
be funny and wet your appetite but it's not what you were looking for.
Michael
Me too. I'm not sure if I'll end up using it over Command-T (or
Peepopen), but I am going to play around with it and see how it goes.
> 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
In Oct. 2011, I've tried FuzzyFinder, CtrlP, CtrlT, Peepopen and
several other plaugins and found FuzzyFinder suits me best. YMMV.
Well, CtrlP released its first version in Oct. 2011. So, things might
have changed, and CtrlP may be a true competitor or even surpass
fuzzyfinder now.
It seems this fuzzy matching is part of a new-fuzzled definition of
usability. Here's an excerpt from the Command-T homepage:
To search efficiently, especially in large projects, you should
adopt a "path-centric" rather than a "filename-centric" mentality.
That is you should think more about where the desired file is
found rather than what it is called. This means narrowing your
search down by including some characters from the upper path
components rather than just entering characters from the filename
itself. -- https://github.com/wincent/Command-T
Does that work well for you? Maybe for project where all files have the
same names because some framework favors Convention Over Configuration?
I guess most humans find it easier to remember words or part of words
instead of "some characters from the upper path components".
Michael
> Here's an excerpt from the Command-T homepage:
>
> To search efficiently, especially in large projects, you should
> adopt a "path-centric" rather than a "filename-centric" mentality.
> That is you should think more about where the desired file is
> found rather than what it is called. This means narrowing your
> search down by including some characters from the upper path
> components rather than just entering characters from the filename
> itself. -- https://github.com/wincent/Command-T
>
> Does that work well for you? Maybe for project where all files have the
> same names because some framework favors Convention Over Configuration?
The screencast "Live demonstration" from [1] confirms this suspicion.
[1] https://wincent.com/products/command-t
CtrlP and Command-T seem close in terms of functionality. One point in
favour of CtrlP: It's in VimL where Command-T is in Ruby.
Michael
It works pretty well. If you remember the file name, or parts of it,
and you type it in, it will find it pretty quick. If you have multiple
files with the same (or similar names), like a bunch of 'index.html'
files, you'll obviously have to type in some of the parent directory
names to narrow down your search.
But, if you only have one file named 'file.txt' and you type in
'filetxt', it will be the suggested file, even if it's many levels deep.
When Ctrl-P starts in a non-SCM-controled directory, it starts very
slow (because it tries to read all files). For example, try cd /etc
and then use vim ctrlp...
If you do never start vim outside your project, Ctrl-P is better than
fuzzyfinder.
On Sun, Feb 5, 2012 at 8:34 AM, Chris Lott <ch...@chrislott.org> wrote:
It should measure the depth of the sea before attempting to dive to the
bottom. There are some options giving you control, though:
The maximum number of files to scan, set to 0 for no limit:
let g:ctrlp_max_files = 10000
The maximum depth of a directory tree to recurse into:
let g:ctrlp_max_depth = 40
Specify an external tool to use for listing files instead of using
Vim’s |globpath()|. Use %s in place of the target directory:
let g:ctrlp_user_command = ''
:help 'ctrlp'
--
Michael