'How can I get Emacs Projectile to operate like VScode's "C-p" ?
I have installed Projectile on my emacs26 installation. My configuration looks like as below:
(projectile-mode +1)
(define-key projectile-mode-map (kbd "s-p") 'projectile-command-map)
(define-key projectile-mode-map (kbd "C-c p") 'projectile-command-map)
(projectile-global-mode) ;; to enable in all buffers
(setq projectile-enable-caching t) ;; to prevent constantly reindexing projectsx
I installed Projectile using Melpa.
I would like Projectile to find files in a project similar to how the command C-p works in vscode. Given the following directory:
src/
views/
cars.html
dogs.html
models/
animals/
dogs.js
cats.js
vehicles/
cars.js
trucks.js
In vscode if I do C-p dogs (no <RET>), I would see a selectable list containing dogs.html and dogs.js. As far as I can tell, this is duplicated by Projectile's C-c p f. The problem is when I do a search like models/dogs. In vscode, this would return only dogs.js, in Projectile, it returns nothing (reasonable, but not what I want).
I have large collections/model directories with many subdirectories and so I'm hoping to emulate this vscode behavior in Emacs if possible.
How can I have Projectile (or another Emacs plugin) file-search similarly to how vscode's C-p file-searches when dealing with multi-nested directories?
I investigated projectile-fix, but it does not seem to do as I want, and is also apparently incompatible with Helm, which I am starting to use and like.
Solution 1:[1]
You could use helm or ivy and its corresponding projectile plugins helm-projectile or counsel-projectile.
But this means you would have to pretty much change your way of using emacs (at least in the short term). Anyway this will help you be more productive on the future so it's a good investment.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 |
