emacs - Disable opening directories with TAB in find-file

This commit is contained in:
madmaurice 2017-10-18 22:55:06 +02:00
parent 0355168a26
commit 992fcc1849

View file

@ -407,6 +407,11 @@
"WIP: Tells evil-jump to save position before jumping via imenu (or counsel-imenu)"
(evil--jumps-push))
;; Prevents opening directories in dired when pressing TAB
(defun my/ivy-dont-tab-dir (orig &rest args)
(when (> (length ivy-text) 0)
(apply orig args)))
(use-package ivy
:ensure t
:demand t
@ -417,7 +422,8 @@
(setq ivy-count-format "(%d/%d) ")
(advice-add 'imenu :before 'my/save-imenu-jump)
(define-key ivy-minibuffer-map (kbd "<C-return>") 'ivy-immediate-done)
(set-face-attribute 'ivy-current-match nil :foreground "gold"))
(set-face-attribute 'ivy-current-match nil :foreground "gold")
(advice-add 'ivy--directory-done :around #'my/ivy-dont-tab-dir))
(use-package counsel
:ensure t