From f9ef230569ab58219048179ee857d11d295c6dee Mon Sep 17 00:00:00 2001 From: Brian Leung Date: Sat, 5 Dec 2020 17:07:27 -0800 Subject: [PATCH] consult: Add evil bindings --- evil-collection.el | 1 + modes/consult/evil-collection-consult.el | 47 ++++++++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 modes/consult/evil-collection-consult.el diff --git a/evil-collection.el b/evil-collection.el index 499c6f4..564a4b5 100644 --- a/evil-collection.el +++ b/evil-collection.el @@ -133,6 +133,7 @@ through removing their entry from `evil-collection-mode-list'." comint company compile + consult (custom cus-edit) cus-theme dashboard diff --git a/modes/consult/evil-collection-consult.el b/modes/consult/evil-collection-consult.el new file mode 100644 index 0000000..b7e52ca --- /dev/null +++ b/modes/consult/evil-collection-consult.el @@ -0,0 +1,47 @@ +;;; evil-collection-consult.el --- Evil bindings for consult -*- lexical-binding: t -*- + +;; Copyright (C) 2017 James Nguyen + +;; Author: James Nguyen +;; Maintainer: James Nguyen +;; Pierre Neidhardt +;; URL: https://github.com/emacs-evil/evil-collection +;; Version: 0.0.1 +;; Package-Requires: ((emacs "25.1")) +;; Keywords: evil, consult, tools + +;; 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: +;; Evil bindings for `consult'. + +;;; Code: +(require 'evil-collection) +(require 'consult nil t) + +(defun evil-collection-consult-set-bindings () + "Set the bindings." + (evil-set-command-property 'consult-outline :jump t) + (evil-set-command-property 'consult-mark :jump t) + (evil-set-command-property 'consult-line :jump t) + (evil-set-command-property 'consult-line-symbol-at-point :jump t) + (evil-set-command-property 'consult-line-from-isearch :jump t)) + +;;;###autoload +(defun evil-collection-consult-setup () + "Set up `evil' bindings for `consult'." + (evil-collection-consult-set-bindings)) + +(provide 'evil-collection-consult) +;;; evil-collection-consult.el ends here