summaryrefslogtreecommitdiff
path: root/modes/shortdoc
diff options
context:
space:
mode:
authorcondy <condy0919@gmail.com>2020-11-15 04:03:47 +0800
committerPierre Neidhardt <mail@ambrevar.xyz>2020-11-15 18:46:12 +0100
commitfaab70d5dce8d62311d06f0964bb88d6b85d36c6 (patch)
treef60f7871e7de3f52e273a862bf62851cf140ccda /modes/shortdoc
parent2f10de5f6d6bd785e89a2f4acf41b4eb9fcdd938 (diff)
shortdoc: add evil bindings
Diffstat (limited to 'modes/shortdoc')
-rw-r--r--modes/shortdoc/evil-collection-shortdoc.el47
1 files changed, 47 insertions, 0 deletions
diff --git a/modes/shortdoc/evil-collection-shortdoc.el b/modes/shortdoc/evil-collection-shortdoc.el
new file mode 100644
index 0000000..4f12818
--- /dev/null
+++ b/modes/shortdoc/evil-collection-shortdoc.el
@@ -0,0 +1,47 @@
+;;; evil-collection-shortdoc.el --- Evil bindings for shortdoc -*- lexical-binding: t -*-
+
+;; Copyright (C) 2020 Zhiwei Chen
+
+;; Author: Zhiwei Chen <condy0919@gmail.com>
+;; Maintainer: James Nguyen <james@jojojames.com>
+;; Pierre Neidhardt <mail@ambrevar.xyz>
+;; URL: https://github.com/emacs-evil/evil-collection
+;; Version: 0.0.1
+;; TODO: Update to emacs 28.1 when it's out
+;; Package-Requires: ((emacs "27.1"))
+;; Keywords: evil, lisp, help
+
+;; 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 <http://www.gnu.org/licenses/>.
+
+;;; Commentary:
+;; Evil bindings for shortdoc.
+
+;;; Code:
+(require 'evil-collection)
+(require 'shortdoc nil t)
+
+(defconst evil-collection-shortdoc-maps '(shortdoc-mode-map))
+
+;;;###autoload
+(defun evil-collection-shortdoc-setup ()
+ "Set up `evil' bindings for `shortdoc'."
+ (evil-set-initial-state 'shortdoc-mode 'normal)
+ (evil-collection-define-key 'normal 'shortdoc-mode-map
+ (kbd "C-k") 'shortdoc-previous
+ (kbd "C-j") 'shortdoc-next
+ "[[" 'shortdoc-previous-section
+ "]]" 'shortdoc-next-section))
+
+(provide 'evil-collection-shortdoc)
+;;; evil-collection-shortdoc.el ends here