Skip to content

Commit

Permalink
Elpaca: Update (#774)
Browse files Browse the repository at this point in the history
  • Loading branch information
jojojames committed Mar 21, 2024
1 parent f1bb473 commit 89aea40
Showing 1 changed file with 21 additions and 57 deletions.
78 changes: 21 additions & 57 deletions modes/elpaca/evil-collection-elpaca.el
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@

(defvar elpaca-info-mode-map)
(defvar elpaca-ui-mode-map)
(defvar elpaca-ui-view-map)
(declare-function elpaca-ui-search "elpaca-ui")
(declare-function elpaca-ui-visit "elpaca-ui")

Expand All @@ -50,19 +51,6 @@ When this is true, move the `elpaca-visit' to gv and gd."
:group 'evil-collection
:type 'boolean)

(defcustom evil-collection-elpaca-want-u-unmark t
"When non nil, use u to unmark.
If this is t, flip the u/U bindings.
If this is nil, match original `elpaca' behavior."
:group 'evil-collection
:type 'boolean)

(defcustom evil-collection-elpaca-want-g-filters t
"When non nil, put `elpaca' filters on g prefix."
:group 'evil-collection
:type 'boolean)

(defun evil-collection-elpaca-ui-visit-build-dir ()
"Visit package's build-dir."
(interactive)
Expand All @@ -78,6 +66,16 @@ If this is nil, match original `elpaca' behavior."

(defun evil-collection-elpaca-setup ()
"Set up `evil' bindings for elpaca."
(evil-collection-define-key 'normal 'elpaca-ui-view-map
(kbd "a") (evil-collection-elpaca-defsearch marked "#unique #marked")
(kbd "i") (evil-collection-elpaca-defsearch installed "#unique #installed")
(kbd "l") 'elpaca-log
(kbd "m") 'elpaca-manager
(kbd "o") (evil-collection-elpaca-defsearch orphaned "#unique #orphan")
(kbd "r") 'elpaca-ui-search-refresh
(kbd "t") (evil-collection-elpaca-defsearch tried "#unique #installed !#declared")
(kbd "b") 'evil-collection-elpaca-ui-visit-build-dir)

(evil-collection-define-key 'normal 'elpaca-info-mode-map
(kbd "TAB") 'forward-button
(kbd "<tab>") 'forward-button
Expand All @@ -89,66 +87,32 @@ If this is nil, match original `elpaca' behavior."
(evil-collection-define-key 'normal 'elpaca-ui-mode-map
(kbd "RET") 'elpaca-ui-info
(kbd "!") 'elpaca-ui-send-input
(kbd "R") 'elpaca-ui-search-refresh
(kbd "gr") 'elpaca-ui-search-refresh
(kbd "+") 'elpaca-ui-show-hidden-rows
(kbd "c") 'elpaca-ui-copy
(kbd "d") 'elpaca-ui-mark-delete
(kbd "g") elpaca-ui-view-map
(kbd "i") 'elpaca-ui-mark-try
(kbd "m") 'elpaca-manager
(kbd "m") 'elpaca-ui-mark-merge
(kbd "p") 'elpaca-ui-mark-pull
(kbd "r") 'elpaca-ui-mark-rebuild
(kbd "s") 'elpaca-ui-search
(kbd "x") 'elpaca-ui-execute-marks
(kbd "+") 'elpaca-ui-show-hidden-rows
(kbd "=") 'elpaca-ui-show-hidden-rows
(kbd "gb") 'evil-collection-elpaca-ui-visit-build-dir)

(if evil-collection-elpaca-want-u-unmark
(evil-collection-define-key 'normal 'elpaca-ui-mode-map
(kbd "u") 'elpaca-ui-unmark
(kbd "U") 'elpaca-ui-mark-merge)
(evil-collection-define-key 'normal 'elpaca-ui-mode-map
(kbd "U") 'elpaca-ui-unmark
(kbd "u") 'elpaca-ui-mark-merge))
(kbd "u") 'elpaca-ui-unmark
(kbd "x") 'elpaca-ui-execute-marks)

(if evil-collection-elpaca-want-v
(evil-collection-define-key 'normal 'elpaca-ui-mode-map
(kbd "gv") 'elpaca-ui-visit
(kbd "gd") 'elpaca-ui-visit)
(evil-collection-define-key 'normal 'elpaca-ui-view-map
(kbd "v") 'elpaca-ui-visit)
(evil-collection-define-key 'normal 'elpaca-ui-mode-map
(kbd "v") 'elpaca-ui-visit))

(if evil-collection-elpaca-want-g-filters
(evil-collection-define-key 'normal 'elpaca-ui-mode-map
(kbd "gI")
(evil-collection-elpaca-defsearch installed "#unique #installed")
(kbd "gM")
(evil-collection-elpaca-defsearch marked "#unique #marked")
(kbd "gO")
(evil-collection-elpaca-defsearch orphaned "#unique #orphan")
(kbd "gT")
(evil-collection-elpaca-defsearch tried "#unique #installed !#declared"))
(evil-collection-define-key 'normal 'elpaca-ui-mode-map
(kbd "I")
(evil-collection-elpaca-defsearch installed "#unique #installed")
(kbd "M")
(evil-collection-elpaca-defsearch marked "#unique #marked")
(kbd "O")
(evil-collection-elpaca-defsearch orphaned "#unique #orphan")
(kbd "T")
(evil-collection-elpaca-defsearch tried "#unique #installed !#declared")))

(if evil-collection-elpaca-want-movement
(evil-collection-define-key 'normal 'elpaca-ui-mode-map
(kbd "B") 'elpaca-ui-browse-package ;; b -> B
(kbd "F") 'elpaca-ui-mark-fetch ;; f -> F
(kbd "L") 'elpaca-log ;; l -> L
(kbd "gs") 'elpaca-status ;; t -> gs + gS
(kbd "gS") 'elpaca-status)
)
(evil-collection-define-key 'normal 'elpaca-ui-mode-map
(kbd "b") 'elpaca-ui-browse-package
(kbd "f") 'elpaca-ui-mark-fetch
(kbd "l") 'elpaca-log
(kbd "t") 'elpaca-status)))
(kbd "f") 'elpaca-ui-mark-fetch)))

(provide 'evil-collection-elpaca)
;;; evil-collection-elpaca.el ends here

0 comments on commit 89aea40

Please sign in to comment.