4

I have a thing where I just don't like editing directories in emacs, and I never want to enter dired mode. Any time anything might want to put me into dired mode, I would prefer it not do that and instead do something else useful or else do nothing at all (perhaps there could be some obscure keypress to edit the directory).

In particular one thing that annoys me about the otherwise excellent ivy / counsel-find-file is that it always shows "." and ".." as the first two entries in any completion buffer. If I happen to hit TAB twice (maybe I'm over-zealously completing from the last directory) it will open dired on the local directory.

Ideally I'd like way to tell counsel-find-file it should never open a directory (maybe unless I use immediate-open).

But if not that, I'd at least like a way to tell it to never display the "." and ".." entries. These take up useful screen space that could be showing actual files I might want to visit.

Or if not that, then at least sort those entries at the bottom of the list instead of the top.

How can I do this?

1 Answer 1

5

You can hide those entries with (setq ivy-extra-directories nil).

1
  • 1
    Nice... now that I know the variable name and search for that I see a lot of similar answers but my original search terms were using "." and ".." directly and come up with nothing :( Maybe searchers like me will find this one. Aug 17, 2020 at 18:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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