Calming Mouse Interaction in Dired
07 Apr 2026 Charles Choi
Conventional file managers have conditioned me to expect that a single left-button mouse click (<mouse-1>) will select a file (or directory) and double-click will open it. This is not the default behavior of Dired, where a single click is an open action. I find this far too twitchy for my taste.
This post shows how to make Dired mouse interaction align with a conventional file manager where:
-
Single-click on a file or directory will move the point to it, making it the implicit target for any subsequent Dired command.
-
Left double-click on file or directory will open it.
-
Selecting multiple files is emulated using Dired marking, in this case using the binding
M-<mouse-1>to toggle marking a file.
The first two points above can be addressed with the global variable mouse-1-click-follows-link. Dired uses this variable to control its mouse behavior, but we don’t want to change it everywhere, just for Dired buffers. This can be implemented by setting mouse-1-click-follows-link locally as a hook to dired-mode-hook:
1 2 3 4 | |
To address multiple file selection, we can define a function cc/dired-mouse-toggle-mark and bind it to M-<mouse-1>.
1 2 3 4 5 6 7 8 9 10 | |
Coupled with Anju support for a Dired specific context menu and many basic file manager operations can be done in Dired via mouse with minimal fuss.