I sometimes "accidentally" hit TAB again when I've already completed myself into a subdirectory. This means the current dir ./ is highlighted and ivy opens it with dired.

This is basically never ever ever what I want to do. I will do it one million times by accident for every time I actually want to open ./ with dired. So I rebound TAB from ivy-partial-or-done to ivy-partial. But this means ivy doesn't actually enter subdirs on TAB, it just completes them. This works, but forces an extra RET press every time I want to enter a subdir.

So what I basically want is the default behaviour, BUT have ivy special-case ./ by doing nothing. Is this possible?

  • Alternatively, you can retrain yourself to use / to enter directories instead of TAB. – Omar Oct 7 '17 at 1:55

This might be the best solution:

(setq ivy-extra-directories nil)

Not only will you not accidentally dired into ./, it's not even displayed as a candidate. And ../ is redundant too because you can just use the keyboard shortcut for "up one level"

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.