From 5ed6b49b753ad36b2ff05317474baede65d02c5c Mon Sep 17 00:00:00 2001 From: Phuntsok Drak-pa Date: Thu, 24 Oct 2019 14:24:58 +0200 Subject: [PATCH] Added dired-hide-details-mode and dired-git-info shortcuts, better configuration --- packages.el | 40 +++++++++++++++++++++++++++++++++------- 1 file changed, 33 insertions(+), 7 deletions(-) diff --git a/packages.el b/packages.el index 7517c7c..e4ef817 100644 --- a/packages.el +++ b/packages.el @@ -11,19 +11,38 @@ (global-set-key (kbd "") (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