I am 100 % a keyboard only user, but sometimes i want to relax and browse dired only with one hand. But the standart behaviour of dired , when clicking on files or directories, is really ass. Thus i wrote some code to gain this functionality:

Left-Mouse-Click: The same as Pressing Enter

Right-Mouse-Click: close current buffer and go to last visible buffer

thus you can left click on entry, then go back with right click which is super fast and handy. Try it out !!!

(I am using evil, but you can easily bind the keys with :

(define-key dired-mode-map .... )

code:

(defun my/dired-jump (event)

(interactive "e")

(mouse-drag-region event)

(dired-find-file))

(defun my/dired-jump-close ()

(interactive)

(kill-current-buffer))

(evil-global-set-key 'normal (kbd "") 'my/dired-jump-close)

(evil-define-key '(normal visual motion emacs) dired-mode-map

(kbd "") 'my/dired-jump)

EDIT: CHECK OUT THIS DEMO

https://imgur.com/a/G6K8JKO

  • Exhausted-Engineer@alien.topB
    link
    fedilink
    English
    arrow-up
    1
    ·
    10 months ago

    If you use evil, why not just bind l to go into the directory and h to go one level up ?

    100% no mouse and you stay on home row