ctrlp.vim
ctrlp.vim copied to clipboard
CtrlP finds no entries
It used to work and still does in all my other projects AFAIK, but I'm currently working on one basic rails app and for no obvious reason, when I'm at the root of the project, it finds no entries.
Here is the structure of my project:
-rw-r--r-- 1 Adrien staff 1392 Apr 28 20:08 .env
-rw-r--r-- 1 Adrien staff 1420 Apr 28 18:43 .env.example
drwxr-xr-x 16 Adrien staff 544 May 2 21:04 .git
-rw-r--r-- 1 Adrien staff 930 Apr 28 18:43 .gitignore
drwxr-xr-x 3 Adrien staff 102 Apr 30 21:28 .profile.d
-rw-r--r-- 1 Adrien staff 9 Apr 22 08:45 .ruby-gemset
-rw-r--r-- 1 Adrien staff 10 Apr 22 08:45 .ruby-version
-rw-r--r-- 1 Adrien staff 952 Apr 22 08:45 Capfile
-rw-r--r-- 1 Adrien staff 2639 Apr 29 10:22 Gemfile
-rw-r--r-- 1 Adrien staff 11020 May 2 20:41 Gemfile.lock
-rw-r--r-- 1 Adrien staff 134 Apr 28 20:07 Procfile
-rw-r--r-- 1 Adrien staff 1382 May 2 20:41 README.md
-rw-r--r-- 1 Adrien staff 272 Apr 22 08:45 Rakefile
drwxr-xr-x 9 Adrien staff 306 Apr 22 08:45 app
drwxr-xr-x 17 Adrien staff 578 Apr 29 10:22 config
-rw-r--r-- 1 Adrien staff 157 Apr 28 18:43 config.ru
drwxr-xr-x 3 Adrien staff 102 Apr 22 08:45 db
drwxr-xr-x 3 Adrien staff 102 Apr 22 08:45 doc
drwxr-xr-x 8 Adrien staff 272 Apr 22 08:45 lib
drwxr-xr-x 5 Adrien staff 170 Apr 22 09:24 log
drwxr-xr-x 11 Adrien staff 374 Apr 22 08:45 public
drwxr-xr-x 4 Adrien staff 136 Apr 24 12:26 script
drwxr-xr-x 6 Adrien staff 204 Apr 29 10:22 spec
-rwxr-xr-x 1 Adrien staff 51 May 1 19:56 start
-rwxr-xr-x 1 Adrien staff 103 Apr 28 18:43 stop
drwxr-xr-x 8 Adrien staff 272 Apr 22 08:45 test
drwxr-xr-x 8 Adrien staff 272 Apr 25 18:03 tmp
drwxr-xr-x 4 Adrien staff 136 Apr 22 08:45 vendor
I might be missing something because I have no similar issue in other rails app as well.
I use Vundle to manage my plugins. I removed all of them in case of conflicts but it changed nothing.
Any hints?
I've faced the same error after switching to fishshell from zsh. I ended up adding set shell=/bin/bash
in vimrc and it started working again.
It seems like it was actually a problem in the name of my directory. I worked in /Users/adrien/code/geroni.mo
and migrate the code in /Users/adrien/code/geronimo
and it works.
I don't know what raises this issue exactly.
OK so I just had a giant response written and when I got to the end I had written out some of my problem directories that would say no entries
and saw a pattern and was able to fix my issue.
@AdrienGiboire might be right that there is something particular about the directory path. So my specific problem was the word blog
. I had these two directories that would not work regardless of what I tried to ignore or what shell was set or anything. I also tried to install Command-T to see if it was a plugin specific issue and saw the same issue with no entries.
Directories:
-
~/Projects/blog
-
~/Projects/companyx/blog
I had suspected it was either vim regex issues on specific directories or something to do with using bundler to bundle to the vendor directory for some projects. Simply renaming the directories fixed my issue. But I am curious why blog
is an issue or in @AdrienGiboire's case geroni.mo
. I can't find anywhere where I am ignoring blog
or telling ctrlp to not look in blog
directories.
Hopefully this helps.
I'm running into this issue too when editing a project that was in a tmp
directory in my Users folder. It turns out the name (or more explicitly the directory) was to blame. In my .vimrc
I have a config for ctrl-p to ignore some directories
let g:ctrlp_custom_ignore = 'tmp$\|\.git$\|\.hg$\|...<lots more directories here>
The behaviour that I was expecting is for ctrl-p to ignore the tmp directory starting from the directory where I open vim, not the parent directories. Hope that helps some how..
@mtchavez I am having the exact same issue with my dirs named blog
. Did you ever figure out what was causing this? I can't rename my directories, unfortunately.
@goddamnyouryan Not really. I tried a few different approaches and other plugins, not sure what the issue is. I luckily could re-name my directories. Can you do something with symlinks or rsync to a separate place not named blog
? Never tried that.
@mtchavez I probably could, it's not a huge deal either way, it's just weird! Every other directory works except for blog
.
+1 I can confirm this, same thing happens to me (the word blog in the folder name makes ctrlp return no entries)
Same issue...working in one particular project where ctrlp finds no files whatsoever...after some trial and error, found that if I remove the '-' from the parent directory name, it works.
Same happens to me. As @crsmithdev says, removing '-' from directory name solves problem for now.
I'm getting this too, with a pwd
that has dashes in it. Unfortunately it's a Go project, so I can't easily change the path, because it needs to match the URL for where it was downloaded from.
wtf .. for me too the missing set shell=/bin/bash
was the culprit .. i was googling for hours, huge thanks @nobuf
@codingrogue @nobuf I tried setting my shell to bash and it still didn't work for finding files in the blog
directory.
+1
I had a similar issue with go projects that were cloned from github. Seems I had the following in my vimrc file:
let g:ctrlp_custom_ignore = {
\ 'dir': 'node_modules\|DS_Store\|.git'
\ }
The unescaped dot character was matching a forward slash. See also https://github.com/carlhuda/janus/pull/550
Since this is the top search result for "Ctrlp no entries" I thought I'd add why ctrlp reported no entries in my case even though it's likely unrelated with this thread. I was working in a project folder with no .git folder - doing a git init in my project folder allowed ctrlp to find the files.
@jdart nice! yes definitely good to have that information here, but also to note that this is not the cause of our issue either.
Not sure if anyone has the same cause as mine, but here the bug I find:
I have this old vim plugin installed: vim-scripts/gitignore
which will parse my .gitignore
file
And I have my .gitignore
containing this line: *,cover
(yes, that strange comma is not a mistake, according to this comment)
That's my bug.
If I delete the comma in my .gitignore
, everything is fine now.
If I remove the plugin, everything is fine even with that strange comma.
So I decide to remove the plugin. 🍺
The *,cover line in my .gitignore also breaks ctrlP
Had to change my init.vim
and do as @nobuf .
I could see it was a zsh-related error as it displayed:
zsh:1: no matches found: !*/tmp/*
shell=/bin/bash
works for me, thanks @nobuf
I had the issue a lot of others seemed to get where files weren't listed specifically in a folder named blog
. Turns out, I had let g:ctrlp_custom_ignore
set to include log
, which lead to a partial match with blog
.
Setting the custom user command to ignore files in .gitignore
works for me to fix this issue:
let g:ctrlp_user_command = ['.git', 'cd %s && git ls-files -co --exclude-standard']
I had
let g:ctrlp_custom_ignore = 'node_modules\|DS_Store\|git'
in my .vimrc
. Changing to
let g:ctrlp_custom_ignore = 'node_modules\|DS_Store\'
fixed it for me.
@lmiller1990 thanks, it works. any idea why that fixes it?
@sungwoncho I have no idea, sorry. I just tried removing parts of the regex bit by bit and it worked. 👎
If the name of the folder with your projects contains "git", then all files are ignored. Solved with the help:
let g:ctrlp_custom_ignore = 'node_modules\|DS_Store\|\.git'
I've got the same issue which is caused by a bug of ag
. It seems that ag
cannot correctly parse .gitignore
and all the negating patterns are completely ignored (see https://github.com/ggreer/the_silver_searcher/issues/1233). Letting git ls-files
do the search fixes the issue.
As @sjking said, adding let g:ctrlp_user_command = ['.git', 'cd %s && git ls-files -co --exclude-standard']
to my ~/.vimrc
works.
I also had this error, which was also caused by my .gitignore
file. I had a line containing a single *
, which caused the issue. After removing it, it worked.
Ctrlp doesn't work on paths with '#'.
Also appears to not work on paths containing a comma or a ~
.