diff --git a/emacs/.emacs.d/init.el b/emacs/.emacs.d/init.el index 983a21c..d8823fc 100644 --- a/emacs/.emacs.d/init.el +++ b/emacs/.emacs.d/init.el @@ -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 "") '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