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.
1 Answer
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.
completion-ignored-extensions
doesn't work in that context? That's what ordinaryfile-name-completion
respects. See (elisp)File Name Completion and (emacs)Completion Options. Of course, that's just extensions...counsel-find-file-ignore-regexp
, one of the options is to usecompletion-ignored-extensions
.