Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
51 lines (38 sloc) 1.51 KB
(require 'dired)
;; Make dired less verbose
(require 'dired-details)
(setq-default dired-details-hidden-string "--- ")
;; Reload dired after creating a directory
(defadvice dired-create-directory (after revert-buffer-after-create activate)
;; Reload dired after quitting wdired
(defadvice wdired-abort-changes (after revert-buffer-after-abort activate)
;; C-a is nicer in dired if it moves back to start of files
(defun dired-back-to-start-of-files ()
(backward-char (- (current-column) 2)))
(define-key dired-mode-map (kbd "C-a") 'dired-back-to-start-of-files)
;; M-up is nicer in dired if it moves to the third line - straight to the ".."
(defun dired-back-to-top ()
(next-line 2)
(define-key dired-mode-map (kbd "M-<up>") 'dired-back-to-top)
;; M-down is nicer in dired if it moves to the last file
(defun dired-jump-to-bottom ()
(next-line -1)
(define-key dired-mode-map (kbd "M-<down>") 'dired-jump-to-bottom)
;; Delete with C-x C-k to match file buffers and magit
(define-key dired-mode-map (kbd "C-x C-k") 'dired-do-delete)
(eval-after-load "wdired"
(define-key wdired-mode-map (kbd "C-a") 'dired-back-to-start-of-files)
(define-key wdired-mode-map (kbd "M-<up>") 'dired-back-to-top)
(define-key wdired-mode-map (kbd "M-<down>") 'dired-jump-to-bottom)))
(provide 'setup-dired)