[Dired] Restructuring local key bindings

This commit is contained in:
Daniel - 2018-09-07 17:58:19 +02:00
parent c48a75048b
commit 1b7f3dcf85
Signed by: dbo
GPG Key ID: 4F63DB96D45AA9C6
1 changed files with 7 additions and 15 deletions

22
init.el
View File

@ -755,6 +755,12 @@ are assumed to be of the form *.crt."
(use-package dired
:defer t
:bind (:map dired-mode-map
("e" . ora-ediff-files)
("z" . dired-get-size)
([remap beginning-of-buffer] . dired-back-to-top)
([remap end-of-buffer] . dired-jump-to-bottom)
("<f1>" . nil))
:config (progn
(setq dired-dwim-target t)
(put 'dired-find-alternate-file 'disabled nil)
@ -809,11 +815,6 @@ are assumed to be of the form *.crt."
(when on-windows
(setq directory-free-space-program nil))
;; custom keybindings
(unbind-key "s" dired-mode-map)
(unbind-key "<f1>" dired-mode-map)
(defun ora-ediff-files ()
"Compare marked files in dired with ediff."
;; from: https://oremacs.com/2017/03/18/dired-ediff/
@ -835,7 +836,6 @@ are assumed to be of the form *.crt."
(setq ediff-after-quit-hook-internal nil)
(set-window-configuration wnd))))
(error "No more than 2 files should be marked"))))
(bind-key "e" #'ora-ediff-files dired-mode-map)
(defun dired-back-to-top ()
"Jump to first non-trivial line in dired."
@ -843,18 +843,12 @@ are assumed to be of the form *.crt."
(goto-char (point-min))
(dired-next-line 1))
(bind-key [remap beginning-of-buffer]
#'dired-back-to-top dired-mode-map)
(defun dired-jump-to-bottom ()
"Jump to last non-trivial line in dired."
(interactive)
(goto-char (point-max))
(dired-next-line -1))
(bind-key [remap end-of-buffer]
'dired-jump-to-bottom dired-mode-map)
(defun dired-get-size () ; from emacswiki, via oremacs
"Print size of all files marked in the current dired buffer."
(interactive)
@ -865,9 +859,7 @@ are assumed to be of the form *.crt."
"size of all marked files: %s"
(progn
(re-search-backward "\\(^[0-9.,]+[a-za-z]+\\).*total$")
(match-string 1))))))
(bind-key "z" #'dired-get-size dired-mode-map)))
(match-string 1))))))))
(use-package find-dired
:commands (find-dired)