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?

Drew
  • 75,699
  • 9
  • 109
  • 225
MadScientist
  • 143
  • 3

1 Answers1

5

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

Swarnendu Biswas
  • 1,378
  • 1
  • 11
  • 24
  • 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. – MadScientist Aug 17 '20 at 18:03