kien / ctrlp.vim Goto Github PK
View Code? Open in Web Editor NEWFuzzy file, buffer, mru, tag, etc finder.
Home Page: kien.github.com/ctrlp.vim
Fuzzy file, buffer, mru, tag, etc finder.
Home Page: kien.github.com/ctrlp.vim
It would be awesome, if when searching for file with ctrlp files that match pattern and are closer to current file (directory wise) would get higher weight
It make good sense, directories are used to store files by some logical groups. Files that are in same directory usually are related. Having files, that match patter and are closer to current file sowing before other files (that are not so close) could decrease amount of characters user needs to input to open file, that he/she want's to open.
For example think about ruby on rails apps
If you're editing app/view/some_name/_form.html.erb
and then you want to open index.html.erb
typing index (or less) could be enough for app/view/some_name/index.html.erb to be first match.
However, if such mathematics would slow vim a lot, better not to do it. I love ctrlp exactly for it's speed
P.S.
I hope you understand what I mean
I've been trying to use ctrlp at work and on our main large project (a rails project) I try to find "user.rb" and it matches things like "app/controllers/status_controller.rb".
Is this a config issue on my end or an actual bug?
It would be nice if the standard command could be open in buffer (or any other) mode by default. Right now, this behavior can be achieved by binding some other key to the default CtrlP command, and then binding to CtrlPBuffer. But this is wasteful if the first mode is never used. An option like 'g:ctrlp_default_open_mode' would be great.
I have g:ctrlp_working_path_mode = 1 since implementation of #30
I open vim in project directory
Now if have some file opened and open ctrlp, type some file name, and press it will be created in project directory, instead of current buffer directory. (note, I haven't switched to project directory with '/' yet)
In case when g:ctrlp_working_path_mode = 1 and current buffer is not in project root, ctrlp should create files relative current buffer directory, unless user switched to project root dir (with /).
This might be a bit hard to explain.
From what I see, each time a new character is added, the same huge list of items is filtered. It would speed things up quite a bit the list is filtered by the input (but not by the max height), and the result is used for subsequent filtering. Only the displayed list should then be reduced by the max height option.
It appears that ctrlp does not find dotfiles/dotdirs with the current globbing. Would it be possible for you to add support for this, possibly by adding a second call to globpath
? I was unable to find a single glob that will expand to both normal files and dotfiles, but I admit I haven't spent much time looking into it yet.
When i'm in a vertical split and attempt to open a horizontal split, it opens it below the vertical buffer instead of in the buffer. CommandT would split the vertical buffer itself as if you typed :split.
Is there any way to have ctrlp do this?
After opening a file of about 200 lines, performing a search becomes extremely slow. I'll type my query, and watch it catch up to me at about 1 letter per second.
The one feature that is keeping me on FuzzyFinder at the moment is the :FufTag
mode. Would it be possible to add a fuzzy tag search to ctrlp?
map <silent><leader><C-p> :ClearCtrlPCache<CR>:CtrlP<CR>
It would be an improvement if, when the ctrlp window appears, the updatetime is changed to something small, and the list of matching items is only updated when that autocommand is triggered.
That would speed things up quite a bit, when you know what you want to write
Perhaps there is a workaround I am not aware of.
In LustyExplorer it is possible to create new files, by typing the name of an non-existing file and pressing CTRL-e. Would it be possible to add a similar feature to ctrlp?
I've noticed that ctrlp seems to freeze when a search is initiated inside a SFTP volume. I mount a lot of remote servers via SFTP with osxfuse and use my local MacVim configuration to work with remote files in this manner. Is there any chance that this problem can be correct? Thanks, for the great plugin!
It seems the plugin doesn't see files that have accented characters (for example some of these: ěščřžýáíé
) in the path.
I experienced the issue on this path: /Users/martin/Desktop/vš/_novell/TEXPR
. Opened vim in there, pressed ^P and saw this:
The directory isn't empty:
And I can get to the files from the ^P when I switch to the MRU files listing:
Is it possible to add a rudimentary history in the prompt?
Let user set g:ctrlp_cache_dir entirely, and don't append "/.ctrlp_cache"
If I set g:ctrlp_cache_dir to my custom directory such as ~/tmp/.vim/ctrlp there is no point in "/.ctrlp_cache" part.
But it's very annoying if I want to cd to it.
Ok, I can set g:ctrlp_cache_dir to ~/tmp/.vim/, but again, there will be invisible, and annoying.
So please let the user set full path for cache directory
set wildignore+=*/.git/*,*/.hg/*,*/.svn/*,*.so
Is a bad idea, It breaks fugitive plugin.
A much better is to simply
let g:ctrlp_user_command = "find %s -type f | egrep -v '/\.(git|hg|svn)/' | egrep -v '\.(swp|swo|log|gitkep|keepme|so|o)$'"
This is very fast and it will filter all directories and files, that you really don't want to find without breaking fugitive.
Perhaps some info about this in help and/or from page should be added
Otherwise this is great plugin.
Hi,
Your plugin is simply fantastic. The only thing that is a discomfort is buffer handling. I use vim tabs as split-windows layouts. That's why I often open same buffer in different tabs. Unfortunately ctrlp's buffer selector always jumps to buffer if it's visible anywhere. It would be great if this behavior was customizable - jump to buffer or (re)open buffer.
How to reproduce:
Open 2 files in a split.
Create a tab.
Go to tab.
Try to open any file from first tab with :CtrlPBuffer
Vim will jump to first tab and activate open buffer.
Now what I'd love is to select a buffer with you plugin and use c-x,c-v or c-t to reopen it again. Ideally the plugin could exclude current buffer from search this way :)
Missing tags in vim help for:
:CtrlPTag
:CtrlPDir
:CtrlPQuickfix
Hi,
When I run vim via vim .
to open it with the current directory listing and then ctrl-p to another file, the new split window is opened instead of using the current one.
I explicitly set the following options:
let g:ctrlp_split_window = 0
let g:ctrlp_open_new_file = 0
After some digging in the code I found that netrw sets noma
, nobl
and bf=nofile
.
This "breaks" s:normcmd
call in the ctrlp#acceptfile
and executes bo vne ...
instead of bo e ...
.
Maybe there is some work around for such an issue? Netrw lets me redefine its buffer settings via g:netrw_bufsettings
but honestly I don't want to see its buffers in the 'ls' and make them modifiable.
I'd appreciate your help, thanks!
is there a command to refresh cache?
help says that setting ctrlp_working_path_mode to one means
1 - the parent directory of the current file.
However ctrlp opens file directory
for example:
/some/path/to/current_file
/some/path/to = current_file directory
/some/path = parent directory of current_file
You should remove "the parent" (or simply "parent") part
So I did:
set gcr=a:blinkon0
In my .vimrc
as well as set a color for the cursor in my theme. The problem is that it works fine, but when I pull up CtrlP, it somehow resets the color of the cursor to something else (transparent in MacVim). This only happens when I add the above line to turn off blinking. I tried searching around the code, the only relevant thing I could find was this but I don't know if it'd be the culprit.
Guess no one has used these yet! I tracked these down to the following lines
if exists('a:1') && len(a:1) == 1 && !type('a:1')
let l:pathmode = a:1
elseif exists('a:1') && len(a:1) > 1 && type('a:1')
which should be changed to
if exists('a:1') && len(a:1) == 1 && !type(a:1)
let l:pathmode = a:1
elseif exists('a:1') && len(a:1) > 1 && type(a:1)
Anyone else seeing quite bad performance? For example, :CtrlPBuffer
takes up to 1 second before displaying anything on screen, even with relatively small buffer counts, like 3. I'd like this to be lightning fast, if possible...
Hey Kien,
I get some weird results when in comes to matches of a query,
In one particular Rails project I work on there's a break model (app/models/break.rb) and unit test file (test/unit/break_test.rb).
But when I search break_test
with CtrlP instead of getting the unit test I get a migration file with the name: db/migrate/xxx_break_out_custom_charge_settings.rb
:S
I noticed ctrlp sometimes doesn't open selected file. At first I thought it was a bug, but then I found out that that's because buffre wasn't saved.
It would be nice, if there was at least a warning about that.
I start vim from a directory that contains a folder named cache
and have the following settings:
let g:ctrlp_working_path_mode = 0
set wildignore=cache/*
Using :edit
command, the cache
directory is not listed but I can find it in ctrlp files list. I have to set wildignore with */cache/*
to really filter it.
Is it possible that ctrlp can have the same behavior as vim?
Thank you for the excellent plugin!
It would be super cool, if when g:ctrlp_working_path_mode is set to 1
When you open ctrlp and start typing file name with / (i.e. / is first character you typed), ctrlp would switch to project directory (g:ctrlp_working_path_mode == 2)
This would be extremely flexible and super useful
Haven't looked into this closely but value of 0 is not clearing the old value.
When I press <down>
or <up>
a "A" or "B" is insert in file.
<crtl-p>
and <ctrl-n>
work ok for move up or down.
I use vim 7.3 in OSX Lion.
Hi!
You're plugin is super promising. While using it, though, I started running into issues where VIM would randomly segfault on me. I wasn't getting that any time prior to installing your plugin, so it's likely the culprit. I'm more than happy to help out with debugging any way I can.
Cheers!
Using version 7.2.445
from the repos
This is a weird one and I have finally been able to reproduce it.
dir/
hi.php
inner/
hey.php
dir
in a different directory, and navigate there (I don't know if this is the problem or not)dir
directory, open the file inner/hey.php
ctrlp
, ..
and then open hi.php
After trying to open that file, the ctrlp window stays open. If I try to ctrlp it again I get this.
If I try and close I get this
And then generally I mash :q
and end up with this
.vimrc
to a different folder, so I do not think that is a factorI really really like this script (awesome job), although this little bug is making it unusable at the moment.
It would be nice to be able to set what files/directories to ignore without changing the wildignore setting. I use both ctrlp and Nerd Tree, but I want them to ignore different things. I don't want ctrlp to look inside the node_modules directory, but I want Nerd Tree to show the contents of that folder.
After opening buffer from CtrlP result, CtrlP overrides unnamed register with "^[yPVyPP...". Please restore original content of unnamed register after sil! norm! gv"vy
in s:lastvisual()
same as 'v' register.
When using CtrlP in the home directory, which usually contains a lot of files, it take a lot of time to index all of them to default depth 40. Is there a way to limit the depth to 1 only when opening CtrlP in the home directory (or any other "troublesome" directory for that matter)?
When we use Ctrlp we choose a file, we open a new buffer, then usually i re-press <c-p>
to activate "finder" but create a new instance (with some problems) instead to activate old one.
The docs say to use
set wildignore+=/.git/,/.hg/,/.svn/ " Linux/MacOSX
However after doing this BundleInstall does not work from the vundo plugin. Perhaps this is actually an issue with vundo - but I encountered this problem and thought I should mention it.
With the following line in my vimrc:
let g:ctrlp_working_path_mode = 2
Every time I invoke ctrlp, I receive the following error:
Error detected while processing function ctrlp#init..ctrlp#SetWorkingPath..56_FindRoot:
line 10:
E121: Undefined variable: a:1
E116: Invalid arguments for function 56_FindRoot
line 11:
E171: Missing :endif
line 10:
E121: Undefined variable: a:1
E116: Invalid arguments for function 56_FindRoot
line 11:
E171: Missing :endif
line 10:
E121: Undefined variable: a:1
E116: Invalid arguments for function 56_FindRoot
line 11:
E171: Missing :endif
line 10:
E121: Undefined variable: a:1
E116: Invalid arguments for function 56_FindRoot
line 11:
E171: Missing :endif
line 10:
E121: Undefined variable: a:1
It would be awesome to be able to run a ctrlP command to search through the current tags, that way I could jump to a specific function rather than just the file.
Would you consider adding an option to stop enumerating files once a maximum is reached.
Thanks
Currently, when 'hidden' is off and the current buffer is not saved, attempting to open a file with ctrl-p fails silently. It would be great to have a config option to make open the file in a tab or a split in this situation.
Or at least display the "No write since last change" error so the user knows what's going on.
This is related to issue #30
Right now I'm at work, and using ctrlp as usual (except that I use new feature).
It works good, but it's annoying to press enter after / (and it slows you down)
ctrlp should switch mode automatically, because there are no files with / in filename anyway.
This would make it faster to navigate.
Think about this scenario:
let g:ctrlp_working_path_mode = 1
open buffer and search for file, switch to it.
Now you need to open some other file in other directory.
Since you know file is in other directory, you open ctrlp and type /
ctrlp immediately switches to project root
and you type your file you want to search.
Having user hit Enter after typing / isn't really useful in this case, don't you think.
It'd be cool to be able to do something like mark multiple to all be opened at once.
I would like ignore only .git/objects, for this I put in ´~/.vimrc´
set wildignore+=.git/objects/*
But if I write a j
in ctrlp plugin, this show
> .git/objects/00/ff78...
> .git/objects/00/632...
...
I use vim 7.3 in OSX Lion
When I try to open a file with # in its filename it doesn't open the file. The message error is bellow:
Error detected while processing function 53_AcceptSelection:
line 80:
E499: Empty file name for '%' or '#', only works with ":p:h": bo e /home/thiago/
Sources/Cormen/#1/mergesort.py
I've only seen this happen a couple of times, but when typing fast to search for files I've had a ":" inserted a few times mid search.
Hi, finally I think I found the problem,
when I invoke ctrlp, then I press <esc>
when I can found the file, this will not close ctrlp
and switch to another buffer. Re-calling ctrlp
create a new instance.
How I can close it when no matches was found?
When I have the prompt open and I'm typing to filter results, if I make a typo and then hit backspace to delete it, it doesn't actually delete the character, it just moves to the left of it as if I hit the "left" key.
Is this the expected behavior or could it be some other plugin on my end causing this?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.