From b2993138c0af38604268d7225506ab471d5398c2 Mon Sep 17 00:00:00 2001 From: pspiagicw <30765406+pspiagicw@users.noreply.github.com> Date: Sat, 18 Dec 2021 19:45:45 +0530 Subject: [PATCH] Mpc mode (#568) * Added MPC Mode Bindings * Linting Changes for MPC Mode * Added mpc-playlist command * Swaped j/k for C-j/C-k for mpc mode. --- modes/mpc/evil-collection-mpc.el | 60 ++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 modes/mpc/evil-collection-mpc.el diff --git a/modes/mpc/evil-collection-mpc.el b/modes/mpc/evil-collection-mpc.el new file mode 100644 index 0000000..a94b11d --- /dev/null +++ b/modes/mpc/evil-collection-mpc.el @@ -0,0 +1,60 @@ +;;; evil-collection-mpc.el --- Bindings for `mpc-mode' -*- lexical-binding: t -*- +;; Copyright (C) 2021 pspiagicw + +;; Author: pspiagicw +;; Maintainer: pspiagicw +;; pspiagicw +;; URL: https://github.com/emacs-evil/evil-collection +;; Version: 0.0.1 +;; Package-Requires: ((emacs "25.1")) +;; Keywords: evil, mpc, processes , mpd + +;; This program 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 of the License, or +;; (at your option) any later version. + +;; This program 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. + +;; You should have received a copy of the GNU General Public License +;; along with this program. If not, see . + +;;; Commentary: +;;; Bindings for `mpc-mode'. + +;;; Code: +(require 'mpc) +(require 'evil-collection) + +(defun evil-collection-move-mpc-down () + "Move the cursor down along with selecting the element" + (evil-next-visual-line) + (mpc-select)) +(defun evil-collection-move-mpc-up () + "Move the cursor up along with selecting the element" + (evil-previous-visual-line) + (mpc-select)) +(defconst evil-collection-mpc-mode-maps '(mpc-mode-map)) + +;;;###autoload +(defun evil-collection-mpc-mode-setup () + "Setup up 'evil' bindings for 'mpc-mode'" + (evil-collection-define-key 'normal 'mpc-mode-map + "C-j" 'evil-collection-move-mpc-down + "C-k" 'evil-collection-move-mpc-up + "t" 'mpc-toggle-play + "r" 'mpc-toggle-repeat + "s" 'mpc-toggle-shuffle + "c" 'mpc-toggle-consume + "p" 'mpc-playlist + "a" 'mpc-playlist-add + ">" 'mpc-next + "<" 'mpc-prev + "x" 'mpc-play-at-point + "RET" 'mpc-select)) + +(provide 'evil-collection-mpc-mode) +;;; evil-collection-mpc.el ends here