When using stock find-file or counsel-find-file, is there a way to ignore certain files that I almost never want to open by hand? Examples include .elc files and backups.

  • Option completion-ignored-extensions doesn't work in that context? That's what ordinary file-name-completion respects. See (elisp)File Name Completion and (emacs)Completion Options. Of course, that's just extensions...
    – Drew
    Jan 10, 2017 at 5:58
  • 2
    If you customize counsel-find-file-ignore-regexp, one of the options is to use completion-ignored-extensions. Dec 13, 2017 at 0:12

1 Answer 1


Yes, use counsel-find-file-ignore-regexp.

For the simple example you provide use

    (setq counsel-find-file-ignore-regexp "\\.elc\\'")

The are more examples in the docstring for that variable.

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.