From 953fe16e1bdae686a8cda539413014f27fba08d9 Mon Sep 17 00:00:00 2001 From: Vonfry Date: Sun, 3 Jan 2021 09:43:14 +0800 Subject: [PATCH] add mpdel evil keybinds --- evil-collection.el | 1 + modes/mpdel/evil-collection-mpdel.el | 96 ++++++++++++++++++++++++++++ 2 files changed, 97 insertions(+) create mode 100644 modes/mpdel/evil-collection-mpdel.el diff --git a/evil-collection.el b/evil-collection.el index 57b8844..9d890f5 100644 --- a/evil-collection.el +++ b/evil-collection.el @@ -206,6 +206,7 @@ through removing their entry from `evil-collection-mode-list'." magit-todos ,@(when evil-collection-setup-minibuffer '(minibuffer)) monky + mpdel mu4e mu4e-conversation neotree diff --git a/modes/mpdel/evil-collection-mpdel.el b/modes/mpdel/evil-collection-mpdel.el new file mode 100644 index 0000000..b90c1f6 --- /dev/null +++ b/modes/mpdel/evil-collection-mpdel.el @@ -0,0 +1,96 @@ +;;; evil-collection-mpdel.el --- Evil bindings for mpdel -*- lexical-binding: t -*- + +;; Copyright (C) 2021 Ruoyu Feng + +;; Author: Ruoyu Feng +;; Maintainer: James Nguyen +;; Pierre Neidhardt +;; URL: https://github.com/emacs-evil/evil-collection +;; Version: 0.0.4 +;; Package-Requires: ((emacs "25.1")) +;; Keywords: evil, tools, mpd + +;; 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 . + +;;; Commentary: +;; Evil bindings for mpdel. + +;;; Code: + +(require 'mpdel nil t) +(require 'evil-collection) + +(defvar mpdel-core-map) + +(defconst evil-collection-mpdel-maps '(mpdel-core-map)) + +(defconst evil-collection-mpdel-modes '(mpdel-browser-mode mpdel-playlist-mode + mpdel-song-mode mpdel-browser-mode + mpdel-playlist-current-playlist-mode + mpdel-playlist-stored-playlist-mode)) + +;;;###autoload +(defun evil-collection-mpdel-setup () + "Set up `evil' bindings for `mpdel'." + + (evil-collection-set-readonly-bindings 'mpdel-core-map) + (dolist (mode evil-collection-mpdel-modes) + (evil-set-initial-state mode 'normal)) + (evil-collection-define-key 'normal 'mpdel-core-map + "p" 'libmpdel-playback-play-pause + "{" 'libmpdel-playback-next + "}" 'libmpdel-playback-previous + "a" 'mpdel-core-add-to-current-playlist + "A" 'mpdel-core-add-to-stored-playlist + "r" 'mpdel-core-replace-current-playlist + "R" 'mpdel-core-replace-stored-playlist + "i" 'mpdel-core-insert-current-playlist + "gD" 'mpdel-core-dired + "gA" 'mpdel-core-open-artists + "gL" 'mpdel-core-open-stored-playlists + "ss" 'mpdel-core-search-by-title + "sl" 'mpdel-core-search-by-album + "sr" 'mpdel-core-search-by-artist + "gp" 'navigel-open-parent + "j" 'evil-next-line + "k" 'evil-previous-line + "+" 'mpdel-core-volume-increase + "-" 'mpdel-core-volume-decrease + "C" 'libmpdel-connect-profile + + "gb" 'mpdel-browser-open + + "go" 'mpdel-song-open + "gr" 'mpdel-song-refresh + "I" 'mpdel-song-play + "q" 'mpdel-song-quit-window + + "g-s" 'mpdel-song-small-increment + "g-n" 'mpdel-song-normal-increment + "g-l" 'mpdel-song-large-increment + "g+s" 'mpdel-song-small-decrement + "g+n" 'mpdel-song-normal-decrement + "g+l" 'mpdel-song-large-decrement + + "gl" 'mpdel-playlist-open + "(" 'mpdel-playlist-move-up + ")" 'mpdel-playlist-move-down + "w" 'mpdel-playlist-save + "P" 'mpdel-playlist-play) + + (evil-collection-define-key 'normal 'mpdel-tablist-mode-map + "D" 'tablist-do-delete)) + +(provide 'evil-collection-mpdel) +;;; evil-collection-mpdel.el ends here