diff options
| author | Jack Jamison <jackqjamison@gmail.com> | 2026-07-05 01:19:30 -0400 |
|---|---|---|
| committer | Jack Jamison <jackqjamison@gmail.com> | 2026-07-05 01:19:30 -0400 |
| commit | bdf9a71ab7baa2b1de9abcfd5df1a9107a55d141 (patch) | |
| tree | c4524e6c41aa5107211103401dabfaefc81aa882 /.config/emacs/lisp/evil-collection/modes/emms | |
| parent | fe3984f541bd32bdfa418afb305b614176b55ca0 (diff) | |
add a bunch of emacs packages HELP
Diffstat (limited to '.config/emacs/lisp/evil-collection/modes/emms')
| -rw-r--r-- | .config/emacs/lisp/evil-collection/modes/emms/README.org | 131 | ||||
| -rw-r--r-- | .config/emacs/lisp/evil-collection/modes/emms/evil-collection-emms.el | 266 |
2 files changed, 397 insertions, 0 deletions
diff --git a/.config/emacs/lisp/evil-collection/modes/emms/README.org b/.config/emacs/lisp/evil-collection/modes/emms/README.org new file mode 100644 index 0000000..cd6d6af --- /dev/null +++ b/.config/emacs/lisp/evil-collection/modes/emms/README.org @@ -0,0 +1,131 @@ +* emms + + Evil bindings for [[https://www.gnu.org/software/emms/][EMMS]]. + +** emms-browser-mode-map + + Insert state is inhibited; the browser is forced into normal state. + + | Command | Original | Evil | + |--------------------------------------------+-------------+-------------------| + | =emms-pause= | =P= | =x= | + | =emms-stop= | =s= | =X= | + | =emms-random= | =r= | =r= | + | =emms-seek-backward= | =<= | =<= | + | =emms-seek-forward= | =>= | =>= | + | =emms-browser-add-tracks= | =RET= | =RET= | + | =emms-browser-add-tracks-and-play= | =C-RET= | =C-RET= | + | =emms-volume-raise= | =+= | =+=, === | + | =emms-volume-lower= | =-= | =-= | + | =emms-playlist-mode-undo= | =C-/= | =u= | + | =emms-browser-prev-non-track= | =<backtab>= | =[[=, =C-k=, =gk= | + | =emms-browser-next-non-track= | n/a | =]]=, =C-j=, =gj= | + | =emms-browser-toggle-subitems-recursively= | n/a | =TAB=, =S-TAB= | + | =emms-browser-move-up-level= | =^= | =^= | + | =emms-browser-toggle-subitems= | =SPC= | =SPC= | + | =emms-browser-collapse-all= | =1= | =g1=, =zm=, =zc= | + | =emms-browser-expand-to-level-2= | =2= | =g2= | + | =emms-browser-expand-to-level-3= | =3= | =g3= | + | =emms-browser-expand-to-level-4= | =4= | =g4= | + | =emms-browser-expand-all= | =E= | =g0=, =zr= | + | =emms-browser-expand-one-level= | n/a | =zo= | + | =emms-browse-by-artist= | =b 1= | =ga= | + | =emms-browse-by-album= | =b 2= | =gA= | + | =emms-browse-by-genre= | =b 3= | =gb= | + | =emms-browse-by-year= | =b 4= | =gy= | + | =emms-browse-by-composer= | =b 5= | =gc= | + | =emms-browse-by-performer= | =b 6= | =gp= | + | =emms-isearch-buffer= | =/= | =/= | + | =isearch-repeat-forward= | n/a | =n= | + | =isearch-repeat-backward= | n/a | =N= | + | =emms-browser-clear-playlist= | =C= | =C= | + | =emms-browser-delete-files= | =D= | (default) | + | =emms-browser-remove-tracks= | n/a | =D= | + | =emms-browser-view-in-dired= | =d= | =d=, =gd= | + | (parent =W= prefix) | =W= | =g= | + | (parent =s= prefix) | =s= | =s= | + +** emms-playlist-mode-map + + Initial evil state is normal. + + | Command | Original | Evil | + |-----------------------------------------------------------+------------+-------------| + | =emms-pause= | =P= | =x= | + | =emms-stop= | =s= | =X= | + | =emms-random= | =r= | =r= | + | =emms-seek-backward= | =<= | =<= | + | =emms-seek-forward= | =>= | =>= | + | =emms-next= | =n= | =C-j=, =gj= | + | =emms-previous= | =p= | =C-k=, =gk= | + | =emms-playlist-mode-play-smart= | =RET= | =RET= | + | =emms-volume-raise= | =+= | =+=, === | + | =emms-volume-lower= | =-= | =-= | + | =emms-playlist-mode-undo= | =C-/= | =u= | + | =emms-playlist-mode-first= | =M-<= | =gg= | + | =emms-playlist-mode-last= | =M->= | =G= | + | =emms-playlist-mode-next= | =M-n= | =]]= | + | =emms-playlist-mode-previous= | =M-p= | =[[= | + | =emms-playlist-mode-kill-track= | =C-k=, =D= | =D= | + | =emms-playlist-clear= | =C= | =C= | + | =evil-collection-emms-playlist-mode-insert-newline-above= | n/a | =O= | + | =evil-collection-emms-playlist-mode-insert-newline-below= | n/a | =o= | + | =evil-collection-emms-playlist-mode-paste-before= | n/a | =P= | + | =evil-collection-emms-playlist-mode-paste-after= | n/a | =p= | + | =emms-tag-editor-edit= | n/a | =ze= | + | =emms-tag-editor-rename= | n/a | =R= | + | =emms-playlist-mode-center-current= | =c= | =.= | + | =emms-playlist-mode-goto-dired-at-point= | =d= | =d=, =gd= | + | =emms-show= | =f= | =zs= | + | =emms-playlist-mode-add-contents= | =a= | =a= | + | =emms-playlist-set-playlist-buffer= | =b= | =zp= | + | (parent =S= sort prefix) | =S= | =S= | + | (parent =/= filter prefix) | =/= | =s= | + | =emms-playlist-mode-yank-pop= | =M-y= | =M-y= | + | =emms-playlist-mode-kill= (visual) | =C-w= | =D= | + +** emms-browser-search-mode-map + + | Command | Original | Evil | + |----------------------------+----------+------| + | =emms-browser-kill-search= | n/a | =q= | + +** emms-metaplaylist-mode-map + + Initial evil state is normal. + + | Command | Original | Evil | + |-----------------------------------------+----------+-------| + | =emms-metaplaylist-mode-goto-current= | =RET= | =RET= | + | =emms-metaplaylist-mode-set-active= | =SPC= | =SPC= | + | =emms-metaplaylist-mode-update= | =g= | =gr= | + | =emms-metaplaylist-mode-new-buffer= | =C= | =C= | + | =emms-metaplaylist-mode-center-current= | =c= | =.= | + | =emms-metaplaylist-mode-kill-buffer= | =C-k= | =D= | + | =kill-current-buffer= | =q= | =q= | + +** emms-stream-mode-map + + Initial evil state is normal. + + | Command | Original | Evil | + |-------------------------------------+----------+----------| + | =emms-stream-play= | =RET= | =RET= | + | =emms-stream-next-line= | =n= | =j= | + | =emms-stream-previous-line= | =p= | =k= | + | =emms-stream-yank-bookmark= | =y= | =y= | + | =emms-stream-kill-bookmark= | =k= | =d= | + | =emms-stream-edit-bookmark= | =e= | =c=, =r= | + | =emms-stream-info-bookmark= | =i= | =i= | + | =emms-stream-save-bookmarks-file= | =s= | =s= | + | =emms-stream-toggle-default-action= | =t= | =x= | + | =emms-stream-quit= | =q= | =q= | + +** New commands + + | Command | Purpose | + |-----------------------------------------------------------+---------------------------------------------------------------| + | =evil-collection-emms-playlist-mode-insert-newline-above= | =O= equivalent that respects =emms-with-inhibit-read-only-t=. | + | =evil-collection-emms-playlist-mode-insert-newline-below= | =o= variant. | + | =evil-collection-emms-playlist-mode-paste-before= | =P= -- yank playlist items before point. | + | =evil-collection-emms-playlist-mode-paste-after= | =p= -- yank playlist items after point. | diff --git a/.config/emacs/lisp/evil-collection/modes/emms/evil-collection-emms.el b/.config/emacs/lisp/evil-collection/modes/emms/evil-collection-emms.el new file mode 100644 index 0000000..47b4e8d --- /dev/null +++ b/.config/emacs/lisp/evil-collection/modes/emms/evil-collection-emms.el @@ -0,0 +1,266 @@ +;;; evil-collection-emms.el --- Evil bindings for EMMS -*- lexical-binding: t -*- + +;; Copyright (C) 2017, 2024 Pierre Neidhardt + +;; Author: Pierre Neidhardt <mail@ambrevar.xyz> +;; Maintainer: James Nguyen <james@jojojames.com> +;; Pierre Neidhardt <mail@ambrevar.xyz> +;; URL: https://github.com/emacs-evil/evil-collection +;; Version: 0.0.1 +;; Package-Requires: ((emacs "26.3")) +;; Keywords: evil, emms, tools + +;; This file is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published +;; by the Free Software Foundation; either version 3, or (at your +;; option) any later version. +;; +;; This file is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. +;; +;; For a full copy of the GNU General Public License +;; see <http://www.gnu.org/licenses/>. + +;;; Commentary: +;; Evil bindings for EMMS. + +;;; Code: +(require 'emms nil t) +(require 'evil-collection) + +(declare-function emms-with-inhibit-read-only-t "emms") +(declare-function emms-playlist-mode-correct-previous-yank "emms-playlist-mode") +(declare-function emms-playlist-mode-yank "emms-playlist-mode") + +(defvar emms-browser-mode-map) +(defvar emms-playlist-mode-map) + +(defconst evil-collection-emms-maps '(emms-browser-mode-map + emms-playlist-mode-map + emms-browser-search-mode-map + emms-metaplaylist-mode-map + emms-stream-mode-map)) + +(defun evil-collection-emms-playlist-mode-insert-newline-above () + "Insert a newline above point." + (interactive) + (emms-with-inhibit-read-only-t + (evil-insert-newline-above))) + +(defun evil-collection-emms-playlist-mode-insert-newline-below () + "Insert a newline below point." + (interactive) + (emms-with-inhibit-read-only-t + (evil-insert-newline-below))) + +(defun evil-collection-emms-playlist-mode-paste-before () + "Pastes the latest yanked playlist items before the cursor position. +The return value is the yanked text." + (interactive) + (emms-with-inhibit-read-only-t + (goto-char (line-beginning-position)) + (emms-playlist-mode-yank) + (emms-playlist-mode-correct-previous-yank) + (evil-previous-line) + (evil-beginning-of-line))) + +(defun evil-collection-emms-playlist-mode-paste-after () + "Pastes the latest yanked playlist items behind point. +The return value is the yanked text." + (interactive) + (unless (eobp) (evil-next-line)) + (evil-collection-emms-playlist-mode-paste-before)) + +;;;###autoload +(defun evil-collection-emms-browser-setup () + "Set up `evil' bindings for `emms-browser'." + ;; TODO: Why doesn't evil-set-initial-state work with emms-browser-mode? + + (evil-collection-inhibit-insert-state 'emms-browser-mode-map) + (add-hook 'emms-browser-mode-hook 'evil-normal-state) + (evil-collection-define-key 'normal 'emms-browser-mode-map + ;; The following overrides other "g-" and "s-" prefixed keys so we set it first. + "g" nil + "g" (lookup-key emms-browser-mode-map (kbd "W")) + "s" nil + "s" (lookup-key emms-browser-mode-map (kbd "s")) + + ;; playback controls + "x" 'emms-pause + "X" 'emms-stop + "r" 'emms-random + "<" 'emms-seek-backward + ">" 'emms-seek-forward + (kbd "RET") 'emms-browser-add-tracks + (kbd "C-<return>") 'emms-browser-add-tracks-and-play + + ;; volume controls + "+" 'emms-volume-raise + "=" 'emms-volume-raise + "-" 'emms-volume-lower + + "u" 'emms-playlist-mode-undo + + ;; motion + "[[" 'emms-browser-prev-non-track + "]]" 'emms-browser-next-non-track + (kbd "C-k") 'emms-browser-prev-non-track + (kbd "C-j") 'emms-browser-next-non-track + "gk" 'emms-browser-prev-non-track + "gj" 'emms-browser-next-non-track + + (kbd "<tab>") 'emms-browser-toggle-subitems-recursively + (kbd "<backtab>") 'emms-browser-toggle-subitems-recursively + "^" 'emms-browser-move-up-level + (kbd "SPC") 'emms-browser-toggle-subitems + "g1" 'emms-browser-collapse-all + "g2" 'emms-browser-expand-to-level-2 + "g3" 'emms-browser-expand-to-level-3 + "g4" 'emms-browser-expand-to-level-4 + "g0" 'emms-browser-expand-all + "ga" 'emms-browse-by-artist + "gA" 'emms-browse-by-album + "gb" 'emms-browse-by-genre + "gy" 'emms-browse-by-year + "gc" 'emms-browse-by-composer + "gp" 'emms-browse-by-performer + "zm" 'emms-browser-collapse-all + "zr" 'emms-browser-expand-all + "zo" 'emms-browser-expand-one-level + ;; TODO find a real replacement for zc + "zc" 'emms-browser-collapse-all + + ;; TODO find a way to integrate this with evil-collection-evil-search + "/" 'emms-isearch-buffer ; This shows hidden items during search. + "n" 'isearch-repeat-forward + "N" 'isearch-repeat-backward + + ;; filter + ;; "" 'emms-browser-previous-filter ; TODO: What does this do? + ;; "" 'emms-browser-next-filter + + + "C" 'emms-browser-clear-playlist + "D" 'emms-browser-remove-tracks + "d" 'emms-browser-view-in-dired + ;; "d" does the same, keep "gd" for consistency. + "gd" 'emms-browser-view-in-dired) + + (unless evil-collection-always-run-setup-hook-after-load + (run-hook-with-args 'evil-collection-setup-hook + 'emms '(emms-browser-mode-map)))) + +;;;###autoload +(defun evil-collection-emms-playlist-setup () + "Set up `evil' bindings for `emms-playlist'." + (evil-set-initial-state 'emms-playlist-mode 'normal) + (evil-collection-define-key 'normal 'emms-playlist-mode-map + ;; playback controls + "x" 'emms-pause + "X" 'emms-stop + "r" 'emms-random + "<" 'emms-seek-backward + ">" 'emms-seek-forward + (kbd "C-j") 'emms-next + (kbd "C-k") 'emms-previous + "gj" 'emms-next + "gk" 'emms-previous + (kbd "RET") 'emms-playlist-mode-play-smart + + ;; volume controls + "+" 'emms-volume-raise + "=" 'emms-volume-raise + "-" 'emms-volume-lower + + "u" 'emms-playlist-mode-undo + + ;; motion + "gg" 'emms-playlist-mode-first + "G" 'emms-playlist-mode-last + "]]" 'emms-playlist-mode-next + "[[" 'emms-playlist-mode-previous + + "D" 'emms-playlist-mode-kill-track ; emms-browser uses "D" + "C" 'emms-playlist-clear + "O" 'evil-collection-emms-playlist-mode-insert-newline-above + "o" 'evil-collection-emms-playlist-mode-insert-newline-below + "P" 'evil-collection-emms-playlist-mode-paste-before + "p" 'evil-collection-emms-playlist-mode-paste-after + + "u" 'emms-playlist-mode-undo + + "ze" 'emms-tag-editor-edit + "R" 'emms-tag-editor-rename + + "." 'emms-playlist-mode-center-current + "d" 'emms-playlist-mode-goto-dired-at-point + "gd" 'emms-playlist-mode-goto-dired-at-point ; "d" does the same, keep "gd" for consistency. + + "zs" 'emms-show + "a" 'emms-playlist-mode-add-contents + "zp" 'emms-playlist-set-playlist-buffer + + ;; filter + "S" (lookup-key emms-playlist-mode-map (kbd "S")) + "s" (lookup-key emms-playlist-mode-map (kbd "/")) + ;; "" 'emms-playlist-limit-to-all ; TODO: Test. + + (kbd "M-y") 'emms-playlist-mode-yank-pop) + + (evil-collection-define-key 'visual 'emms-playlist-mode-map + ;; "d" 'emms-playlist-mode-kill + "D" 'emms-playlist-mode-kill) + + (unless evil-collection-always-run-setup-hook-after-load + (run-hook-with-args 'evil-collection-setup-hook + 'emms '(emms-playlist-mode-map)))) + +;;;###autoload +(defun evil-collection-emms-setup () + "Set up `evil' bindings for `emms'." + ;; emms-browser and emms-playlist-mode must be set up after they are loaded + ;; because we need the mode map to be defined when we `(lookup-key + ;; ...-mode-map ...)'. + (with-eval-after-load 'emms-browser + (evil-collection-emms-browser-setup)) + (with-eval-after-load 'emms-playlist-mode + (evil-collection-emms-playlist-setup)) + + (evil-collection-define-key 'normal 'emms-browser-search-mode-map + "q" 'emms-browser-kill-search) + + (evil-set-initial-state 'emms-metaplaylist-mode 'normal) + (evil-collection-define-key 'normal 'emms-metaplaylist-mode-map + (kbd "RET") 'emms-metaplaylist-mode-goto-current + (kbd "<space>") 'emms-metaplaylist-mode-set-active + "gr" 'emms-metaplaylist-mode-update + "C" 'emms-metaplaylist-mode-new-buffer + "." 'emms-metaplaylist-mode-center-current + "D" 'emms-metaplaylist-mode-kill-buffer + "q" 'kill-current-buffer) + + (evil-set-initial-state 'emms-stream-mode 'normal) + (evil-collection-define-key 'normal 'emms-stream-mode-map + (kbd "RET") 'emms-stream-play + "j" 'emms-stream-next-line + "k" 'emms-stream-previous-line + "y" 'emms-stream-yank-bookmark + "d" 'emms-stream-kill-bookmark + "c" 'emms-stream-edit-bookmark + "r" 'emms-stream-edit-bookmark + "i" 'emms-stream-info-bookmark + "s" 'emms-stream-save-bookmarks-file + "x" 'emms-stream-toggle-default-action + "q" 'emms-stream-quit) + + (unless evil-collection-always-run-setup-hook-after-load + (run-hook-with-args + 'evil-collection-setup-hook 'emms + '(emms-browser-search-mode-map + emms-metaplaylist-mode-map + emms-stream-mode-map)))) + +(provide 'evil-collection-emms) +;;; evil-collection-emms.el ends here |
