Is it possible to actually find files?..
May'be I just don't get it, but how do I search files in folder structure?.. What I essentially mean - launch emacs, cd to some folder, and fuzzy search inside it for some specific file, that may not be even a part of a certain repo, or there's may be no repo at all.
The situation is, that I have a project on a remote server with CentOS, that uses subversion, and I attach this project as an sshfs instance to my PC with ArchLinux. I don't use subversion at my pc, because svn that is used on the server is old, and svn in Arch repos is newer and incompatible. Therefore I don't have subversion installed, and when I try projectile-find-file I want to search files not by using svn. Ok. So I've read the Wiki, and set the projectile-svn-command to fd . -0. Fine, now projectile shows me my files.
But then I have a git repo, which has git repos inside it, but they are not submodules, and are just cloned inside by another software. And when I use projectile-find-file again, I see just files from the first git repo. So again, I need to set projectile-git-command to something like fd/find/rg etc.
But then I have a setting, that allows me to use projectile no matter what: projectile-require-project-root nil, and if there is no .git or .svn or any other folder in it what search tool will be used?
As I see, there's no projectile-file-command settings or something like that. I would like to set it to find . \( -path '*/.svn*' -o -path '*/.git*' \) -prune -o -type f -print0 so I could fuzzy search for any file in any folder structure on any posix complaint system. Is it possible with projectile, or am I missing something?
I don't actually need to have all that smart project detection, but I actually want to have ability to search over file structure, grep over it, tag over it, without semantic deduction what tool to use. Because I only need maybe 3 tools: find, ripgrep, git ls-tree. So what I expected from this plugin is to have functions like projectile-find-git-file, projectile-find-svn-file and projectile-find-file, but it seems that projectile-find-file tries to be smart, but in fact becomes ambiguous. So am I missing the point, or this package is oriented to different task, and I should find something else?
Sorry, this issue is not a bug report or feature request really, and rather a question, because after reading readme, I've thought that this is general purpose tool, but in fact I find that this tool is bound tight to VCS systems.
There's a projectile-generic-command that's used outside of VC dirs, and you can set the type of a project explicitly using .dir-locals.el to whatever you want. There's also a projectile-find-file-in-dir (or something like this) that does pretty much what you asked for. Probably we also need find-file-current-dir, so it's be more convenient to use this.
Thanks for your reply!
Hm. I dig into the docs yesterday, but didn't find that projectile-generic-command. Strange. However this can be used. I'll check the docs for .dir-locals.el too.
There's also a projectile-find-file-in-dir (or something like this) that does pretty much what you asked for.
I don't think so, because it will not recursively search for file in set of folders, with projectile-generic-command, but will prompt me selected dir contents. I essentially asking about recursive file search with fuzzy matching, similar to how it does fzf in other editors, like Vim, or Kakoune (but the fzf.el isn't usable at all unfortunately), so a command like projectile-find-file-gen that just uses projectile-generic-command no matter what, wold be really useful in some cases.
Edit: Yeah, with such settings, I can use projectile just like generic fuzzy-like file finder:
(use-package projectile :ensure t
:init
(setq projectile-svn-command "find . \\( -path '*/.svn*' -o -path '*/.git*' \\) -prune -o -type f -print0"
projectile-generic-command "find . \\( -path '*/.svn*' -o -path '*/.git*' \\) -prune -o -type f -print0"
projectile-git-command "find . \\( -path '*/.svn*' -o -path '*/.git*' \\) -prune -o -type f -print0"
projectile-require-project-root nil
projectile-enable-caching t
projectile-completion-system 'ivy)
:config
(define-key projectile-mode-map (kbd "C-x p") 'projectile-command-map)
(projectile-mode 1))
I think that this gonna be a workaround for now.
so a command like projectile-find-file-gen that just uses projectile-generic-command no matter what, wold be really useful in some cases.
Sure. That's something that's very easy to add. I'll do it when I can.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contribution and understanding!
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contribution and understanding!
Actually, It will be strange if the issue will be closed without a fix after receiving confirmation from @bbatsov that fix would arrive at some point.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contribution and understanding!
This issues been automatically closed due to lack of activity. Feel free to re-open it if you ever come back to it.
Nice!
Sorry about this. I've had really little time for Projectile lately and unfortunately there haven't been many contributors either. I've reopened and pinned this ticket.
I'll try to look into this issue as well, seems easy to add, so expect a PR I'm little bit more experienced in ELisp now than I was year ago