Added dired-hide-details-mode and dired-git-info shortcuts, better configuration

This commit is contained in:
Phuntsok Drak-pa 2019-10-24 14:24:58 +02:00
parent 28b6443817
commit 5ed6b49b75

View File

@ -11,19 +11,38 @@
(global-set-key (kbd "<s-f1>") (lambda () (interactive) (dired "~/")))
(defconst dired-phundrak-packages '(dired-x image-dired+ org-download)
(defconst dired-phundrak-packages '(dired
diredfl
dired-git-info
dired-x
image-dired+
org-download)
"The list of Lisp packages required by the dired-phundrak layer.")
(defun dired-phundrak/post-init-dired ()
(use-package dired
:defer t
:bind (:map dired-mode-map
("(" . dired-hide-details-mode))))
(defun dired-phundrak/init-diredfl ()
"Initializes diredfl and ensures it is enabled globally"
(use-package diredfl
:ensure t
:defer t
:config
(diredfl-global-mode 1)))
(defun dired-phundrak/post-init-dired-x ()
"Initializes dired-x and adds keybindings for its exposed functionalities."
(use-package dired-x
:defer t
:init (progn
(define-key dired-mode-map "f" 'phundrak//open-marked-files)
(define-key dired-mode-map "F" 'xah//open-in-external-app)
(define-key dired-mode-map "s" 'xah//dired-sort)
(define-key dired-mode-map "-" 'xah//dired-rename-space-to-hyphen)
(define-key dired-mode-map "_" 'xah//dired-rename-space-to-underscore))))
:bind (:map dired-mode-map
("f" . phundrak//open-marked-files)
("F" . xah//open-in-external-app)
("s" . xah//dired-sort)
("-" . xah//dired-rename-space-to-hyphen)
("_" . xah//dired-rename-space-to-underscore))))
(defun dired-phundrak/init-image-dired+ ()
"Initializes image-dired+ and adds keybindings for its exposed functionalities."
@ -37,4 +56,11 @@
:defer t
:init ()))
(defun dired-phundrak/init-dired-git-info ()
"Initializes dired-git-info package and add keybinding"
(use-package dired-git-info
:ensure t
:bind (:map dired-mode-map
(")" . dired-git-info-mode))))
;;; packages.el ends here