diff options
author | Martin Polden <mpolden@mpolden.no> | 2020-05-02 11:46:25 +0200 |
---|---|---|
committer | Martin Polden <mpolden@mpolden.no> | 2020-05-02 11:46:25 +0200 |
commit | 59fc0cfe9885b43e5b989ca4e5d9e6a90783f465 (patch) | |
tree | 3a387aa14b7710f01013d5e617af86fed69b655f /lisp/init-dired.el | |
parent | a89c0cdbabf6426e55a82b5e45ed9a3f3425d4cf (diff) |
C-c C-o opens file in dired
Diffstat (limited to 'lisp/init-dired.el')
-rw-r--r-- | lisp/init-dired.el | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/lisp/init-dired.el b/lisp/init-dired.el index 2195402..ac6f24b 100644 --- a/lisp/init-dired.el +++ b/lisp/init-dired.el @@ -1,3 +1,11 @@ +(defun dired-open-or-shell-command () + (interactive) + (if (eq system-type 'darwin) + ;; call open directly on darwin + (dired-do-shell-command "open" nil (dired-get-marked-files t)) + ;; otherwise prompt for shell command + (call-interactively 'dired-do-shell-command))) + (use-package dired :ensure nil ;; package is bundled with emacs :init @@ -7,7 +15,8 @@ ;; show human readable free space (setq directory-free-space-args "-h") - :bind ("M-<up>" . dired-up-directory) + :bind (("M-<up>" . dired-up-directory) + ("C-c C-o" . dired-open-or-shell-command)) :config ;; group directories first in dired if supported |