4

There are certain files I never access from Helm, such as those in my global .gitignore file:

# Emacs backup files #
##############################
*~
*#

etc.

Is there any way of telling Helm to ignore these files?

  • 1
    For grepping, there's helm-grep-ignored-files and helm-grep-ignored-directories. There's nothing like that for helm-find-files. – Tianxiang Xiong Jan 25 '17 at 23:08
  • Thanks for letting me know--if you post that as an answer I'll mark the question as resolved. – tcelferact Jan 25 '17 at 23:48
3

This doesn't exactly answer your question directly, but if you are working on something Projectile recognizes as a project, you could try using helm-projectile-find-file instead of helm-find-files. The functionality is rather different (it searches all file names and paths in the project simultaneously, rather than letting you navigate to individual directories in the project), but it does have the benefit that it understands and uses .gitignore files.

2

I'm not sure when this functionality was introduced, but you can exclude files from helm-find-files by setting helm-ff-skip-boring-files to t and making sure the ignored pattern is on helm-boring-file-regexp-list. From its documentation:

Non--nil to skip files matching regexps in helm-boring-file-regexp-list. This take effect in helm-find-files and file completion used by helm-mode i.e helm-read-file-name.

And the documentation for helm-boring-file-regexp-list says that by default it is built from completion-ignored-extensions.

1

For grepping, there's helm-grep-ignored-files and helm-grep-ignored-directories. There's nothing like that for helm-find-files.

1

search that respects ignored dirs/files:

  1. install ack (An alternative to grep. I install via homebrew.)

  2. put --ignore-case in your ~.ackrc file (assuming you want to ignore case)

  3. bind helm-projectile-ack to a key. I do this in my emacs init via:

(use-package helm
  ...
  :bind (...
         ("C-c p s a" . helm-projectile-ack)
        )
  ...
)
  1. create a .projectile file. E.g.,
-.dot
-.jcs
-.svg
-.txt

use

C-c p s a     ;; search that respects .projectile ignore

or

C-c s p g     ;; search everything

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.