Add bindings for modes that don't use insert state (#106)
This commit is contained in:
parent
b6acf98bb6
commit
2331fd54e2
|
@ -68,6 +68,7 @@
|
||||||
(evil-define-key 'normal ivy-occur-grep-mode-map
|
(evil-define-key 'normal ivy-occur-grep-mode-map
|
||||||
"d" 'ivy-occur-delete-candidate
|
"d" 'ivy-occur-delete-candidate
|
||||||
(kbd "C-x C-q") 'ivy-wgrep-change-to-wgrep-mode
|
(kbd "C-x C-q") 'ivy-wgrep-change-to-wgrep-mode
|
||||||
|
"i" 'ivy-wgrep-change-to-wgrep-mode
|
||||||
"gd" 'ivy-occur-delete-candidate
|
"gd" 'ivy-occur-delete-candidate
|
||||||
[mouse-1] 'ivy-occur-click
|
[mouse-1] 'ivy-occur-click
|
||||||
(kbd "<return>") 'ivy-occur-press-and-switch
|
(kbd "<return>") 'ivy-occur-press-and-switch
|
||||||
|
|
|
@ -0,0 +1,48 @@
|
||||||
|
;;; evil-collection-wgrep.el --- Bindings for `wgrep' -*- lexical-binding: t -*-
|
||||||
|
|
||||||
|
;; Copyright (C) 2018 James Nguyen
|
||||||
|
|
||||||
|
;; Author: James Nguyen <james@jojojames.com>
|
||||||
|
;; Maintainer: James Nguyen <james@jojojames.com>
|
||||||
|
;; Pierre Neidhardt <ambrevar@gmail.com>
|
||||||
|
;; URL: https://github.com/emacs-evil/evil-collection
|
||||||
|
;; Version: 0.0.1
|
||||||
|
;; Package-Requires: ((emacs "25.1"))
|
||||||
|
;; Keywords: evil, emacs, 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 <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
;;; Commentary:
|
||||||
|
;;; Bindings for `wgrep'
|
||||||
|
|
||||||
|
;;; Code:
|
||||||
|
(require 'evil)
|
||||||
|
(require 'wgrep nil t)
|
||||||
|
|
||||||
|
(defvar wgrep-mode-map)
|
||||||
|
|
||||||
|
(defconst evil-colletion-wgrep-maps '(wgrep-mode-map))
|
||||||
|
|
||||||
|
(defun evil-collection-wgrep-setup ()
|
||||||
|
"Set up `evil' bindings for `wgrep'."
|
||||||
|
(evil-define-key nil wgrep-mode-map
|
||||||
|
[remap evil-write] 'wgrep-finish-edit)
|
||||||
|
|
||||||
|
(evil-define-key 'normal wgrep-mode-map
|
||||||
|
"ZQ" 'wgrep-abort-changes
|
||||||
|
"ZZ" 'wgrep-finish-edit
|
||||||
|
(kbd "<escape>") 'wgrep-exit))
|
||||||
|
|
||||||
|
(provide 'evil-collection-wgrep)
|
||||||
|
;;; evil-collection-wgrep.el ends here
|
|
@ -147,6 +147,7 @@ or evil-collection.")
|
||||||
view
|
view
|
||||||
vlf
|
vlf
|
||||||
which-key
|
which-key
|
||||||
|
wgrep
|
||||||
woman
|
woman
|
||||||
xref
|
xref
|
||||||
(ztree ztree-diff))
|
(ztree ztree-diff))
|
||||||
|
|
|
@ -385,6 +385,15 @@ definition".
|
||||||
- ~f10~ Step Over
|
- ~f10~ Step Over
|
||||||
- ~f11~ Step Into
|
- ~f11~ Step Into
|
||||||
- ~S-f11~ Step Out
|
- ~S-f11~ Step Out
|
||||||
|
*** Editable Buffers
|
||||||
|
For buffers where insert-state doesn't make sense but buffer can be edited,
|
||||||
|
(e.g. wdired or wgrep), pressing ~i~ will change into editable state.
|
||||||
|
|
||||||
|
When this editable state is turned on,
|
||||||
|
|
||||||
|
~ZQ~ will abort and clear any changes.
|
||||||
|
~ZZ~ will finish and save any changes.
|
||||||
|
~ESC~ will exit editable state.
|
||||||
|
|
||||||
** Key Translation
|
** Key Translation
|
||||||
~evil-collection-translate-key~ allows binding a key to the definition of
|
~evil-collection-translate-key~ allows binding a key to the definition of
|
||||||
|
|
Loading…
Reference in New Issue