ctrlp.vim icon indicating copy to clipboard operation
ctrlp.vim copied to clipboard

CtrlP finds no entries

Open AdrienGiboire opened this issue 10 years ago • 34 comments

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?

AdrienGiboire avatar May 02 '14 19:05 AdrienGiboire

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.

nobuf avatar Jun 16 '14 18:06 nobuf

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.

AdrienGiboire avatar Jun 18 '14 13:06 AdrienGiboire

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:

  1. ~/Projects/blog
  2. ~/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.

mtchavez avatar Jul 20 '14 01:07 mtchavez

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..

amaltson avatar Jul 23 '14 15:07 amaltson

@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 avatar Dec 13 '14 20:12 goddamnyouryan

@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 avatar Dec 16 '14 04:12 mtchavez

@mtchavez I probably could, it's not a huge deal either way, it's just weird! Every other directory works except for blog.

goddamnyouryan avatar Dec 16 '14 15:12 goddamnyouryan

+1 I can confirm this, same thing happens to me (the word blog in the folder name makes ctrlp return no entries)

chalmagean avatar Feb 18 '15 15:02 chalmagean

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.

crsmithdev avatar Mar 12 '15 00:03 crsmithdev

Same happens to me. As @crsmithdev says, removing '-' from directory name solves problem for now.

thefron avatar Mar 17 '15 03:03 thefron

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.

alexlafroscia avatar Apr 24 '15 01:04 alexlafroscia

wtf .. for me too the missing set shell=/bin/bash was the culprit .. i was googling for hours, huge thanks @nobuf

0x7061 avatar May 02 '15 21:05 0x7061

@codingrogue @nobuf I tried setting my shell to bash and it still didn't work for finding files in the blog directory.

goddamnyouryan avatar May 03 '15 00:05 goddamnyouryan

+1

nicohvi avatar May 06 '15 15:05 nicohvi

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

BRMatt avatar May 14 '15 13:05 BRMatt

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 avatar Oct 03 '15 16:10 jdart

@jdart nice! yes definitely good to have that information here, but also to note that this is not the cause of our issue either.

goddamnyouryan avatar Oct 03 '15 20:10 goddamnyouryan

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. 🍺

JmeHsieh avatar Oct 09 '16 08:10 JmeHsieh

The *,cover line in my .gitignore also breaks ctrlP

ramseydsilva avatar Mar 16 '17 15:03 ramseydsilva

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/*

gouegd avatar Mar 22 '17 16:03 gouegd

shell=/bin/bash works for me, thanks @nobuf

ChenXiyu avatar Jul 12 '17 01:07 ChenXiyu

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.

calvinwoo avatar Sep 13 '17 06:09 calvinwoo

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']

sjking avatar Oct 27 '17 17:10 sjking

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 avatar Mar 16 '18 16:03 lmiller1990

@lmiller1990 thanks, it works. any idea why that fixes it?

sungwoncho avatar Aug 17 '18 14:08 sungwoncho

@sungwoncho I have no idea, sorry. I just tried removing parts of the regex bit by bit and it worked. 👎

lmiller1990 avatar Aug 17 '18 15:08 lmiller1990

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'

jslby avatar Jan 12 '19 19:01 jslby

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.

alexshen avatar Dec 05 '19 14:12 alexshen

As @sjking said, adding let g:ctrlp_user_command = ['.git', 'cd %s && git ls-files -co --exclude-standard'] to my ~/.vimrc works.

htlee6 avatar Sep 20 '20 07:09 htlee6

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.

ErdlingProductions avatar May 12 '21 12:05 ErdlingProductions

Ctrlp doesn't work on paths with '#'.

j5shi avatar May 16 '21 04:05 j5shi

Also appears to not work on paths containing a comma or a ~.

sporkl avatar Mar 25 '22 02:03 sporkl