Include ignored files in Projectile file search
This commit is contained in:
@@ -1752,6 +1752,7 @@ bind-key and global-set-key forms.
|
||||
((projectile-require-project-root nil)
|
||||
(projectile-enable-caching nil)
|
||||
(projectile-git-submodule-command nil)
|
||||
(projectile-git-use-fd t)
|
||||
(project-vc-merge-submodules nil)
|
||||
(projectile-current-project-on-switch 'keep))
|
||||
:config
|
||||
@@ -1765,6 +1766,43 @@ bind-key and global-set-key forms.
|
||||
`(let ((default-directory ,directory))
|
||||
,@forms))
|
||||
|
||||
(defvar imalison:projectile-find-ignore-file ".projectile-find-ignore"
|
||||
"Project-local fd ignore file used only for Projectile file finding.")
|
||||
|
||||
(defun imalison:projectile-fd-ignore-file-arg ()
|
||||
"Return a shell fragment that adds `imalison:projectile-find-ignore-file' when present."
|
||||
(let ((ignore-file (shell-quote-argument imalison:projectile-find-ignore-file)))
|
||||
(format "$(test -f %s && printf -- '--ignore-file %s')" ignore-file ignore-file)))
|
||||
|
||||
(defun imalison:projectile-fd-command (&optional pattern)
|
||||
"Build an fd command for Projectile file finding.
|
||||
The command includes ignored and hidden files by default, then applies
|
||||
`imalison:projectile-find-ignore-file' when that file exists in the project
|
||||
root. PATTERN is passed as fd's search pattern when non-nil."
|
||||
(mapconcat
|
||||
#'identity
|
||||
(delq nil
|
||||
(list projectile-fd-executable
|
||||
pattern
|
||||
"-H"
|
||||
"--no-ignore"
|
||||
(imalison:projectile-fd-ignore-file-arg)
|
||||
"-0"
|
||||
"-E .git"
|
||||
"-tf"
|
||||
"--strip-cwd-prefix"
|
||||
"-c never"))
|
||||
" "))
|
||||
|
||||
(when projectile-fd-executable
|
||||
(setq projectile-git-fd-args
|
||||
(replace-regexp-in-string
|
||||
(concat "^" (regexp-quote projectile-fd-executable) " ")
|
||||
""
|
||||
(imalison:projectile-fd-command)))
|
||||
(setq projectile-generic-command
|
||||
(imalison:projectile-fd-command ".")))
|
||||
|
||||
(defun imalison:do-rg-default-directory (&rest args)
|
||||
(interactive)
|
||||
(let ((consult-ripgrep-args (concat consult-ripgrep-args " --no-ignore" " --hidden")))
|
||||
|
||||
Reference in New Issue
Block a user