Skip to content

Commit e6b652a

Browse files
author
Vonfry
committed
Add mpdired
1 parent 99fd054 commit e6b652a

File tree

2 files changed

+83
-0
lines changed

2 files changed

+83
-0
lines changed

evil-collection.el

+1
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,7 @@ See `evil-collection-init' and `evil-collection--modes-with-delayed-setup'."
256256
monky
257257
mpc
258258
mpdel
259+
mpdired
259260
mu4e
260261
mu4e-conversation
261262
neotree
+82
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
;;; evil-collection-mpdel.el --- Evil bindings for mpdired -*- lexical-binding: t -*-
2+
3+
;; Copyright (C) 2024 Ruoyu Feng
4+
5+
;; Author: Ruoyu Feng <[email protected]>
6+
;; Maintainer: James Nguyen <[email protected]>
7+
;; Pierre Neidhardt <[email protected]>
8+
;; URL: https://github.com/emacs-evil/evil-collection
9+
;; Version: 0.0.1
10+
;; Package-Requires: ((emacs "29.1"))
11+
;; Keywords: evil, tools, mpd
12+
13+
;; This file is free software; you can redistribute it and/or modify
14+
;; it under the terms of the GNU General Public License as published
15+
;; by the Free Software Foundation; either version 3, or (at your
16+
;; option) any later version.
17+
;;
18+
;; This file is distributed in the hope that it will be useful,
19+
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
20+
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21+
;; GNU General Public License for more details.
22+
;;
23+
;; For a full copy of the GNU General Public License
24+
;; see <http://www.gnu.org/licenses/>.
25+
26+
;;; Commentary:
27+
;; Evil bindings for mpdired.
28+
29+
;;; Code:
30+
31+
(require 'mpdired nil t)
32+
(require 'evil-collection)
33+
34+
(defvar mpdired-core-map)
35+
36+
(defconst evil-collection-mpdired-maps '(mpdired-mode-map))
37+
38+
(defconst evil-collection-mpdired-modes '(mpdired-mode-map))
39+
40+
;;;###autoload
41+
(defun evil-collection-mpdired-setup ()
42+
"Set up `evil' bindings for `mpdired'."
43+
44+
(evil-collection-set-readonly-bindings 'mpdired-mode-map)
45+
(dolist (mode evil-collection-mpdired-modes)
46+
(evil-set-initial-state mode 'normal))
47+
48+
(evil-collection-define-key 'normal 'mpdired-mode-map
49+
"j" 'mpdired-next-line
50+
"k" 'mpdired-previous-line
51+
(kbd "RET") 'mpdired-enter
52+
"^" 'mpdired-goto-parent
53+
"o" 'mpdired-toggle-view
54+
"g r" 'mpdired-update
55+
"g R" 'mpdired-db-update
56+
"J" 'mpdired-next-internal
57+
"K" 'mpdired-previous-internal
58+
"a" 'mpdired-add
59+
"d" 'mpdired-flag-at-point
60+
"x" 'mpdired-flagged-delete
61+
"D" 'mpdired-delete
62+
"p" 'mpdired-pause-internal
63+
(kbd "SPC") 'mpdired-pause-internal
64+
"gv" 'mpdired-set-volume-internal
65+
"ss" 'mpdired-stop
66+
"sR" 'mpdired-toggle-repeat
67+
"sr" 'mpdired-toggle-random
68+
"sS" 'mpdired-toggle-single
69+
"sc" 'mpdired-toggle-consume
70+
"gc" 'mpdired-playlist-create
71+
"ga" 'mpdired-playlist-append
72+
"m" 'mpdired-mark-at-point
73+
"M" 'mpdired-change-marks
74+
"u" 'mpdired-unmark-at-point
75+
"U" 'mpdired-unmark-all-marks
76+
"t" 'mpdired-toggle-marks
77+
"T" 'mpdired-previous-unmark
78+
"%d" 'mpdired-flag-files-regexp
79+
"%m" 'mpdired-mark-files-regexp))
80+
81+
(provide 'evil-collection-mpdired)
82+
;;; evil-collection-mpdired.el ends here

0 commit comments

Comments
 (0)