diff --git a/evil-collection-ivy.el b/evil-collection-ivy.el index 9ac2aa6..3a8a651 100644 --- a/evil-collection-ivy.el +++ b/evil-collection-ivy.el @@ -68,6 +68,7 @@ (evil-define-key 'normal ivy-occur-grep-mode-map "d" 'ivy-occur-delete-candidate (kbd "C-x C-q") 'ivy-wgrep-change-to-wgrep-mode + "i" 'ivy-wgrep-change-to-wgrep-mode "gd" 'ivy-occur-delete-candidate [mouse-1] 'ivy-occur-click (kbd "") 'ivy-occur-press-and-switch diff --git a/evil-collection-wgrep.el b/evil-collection-wgrep.el new file mode 100644 index 0000000..83ac24a --- /dev/null +++ b/evil-collection-wgrep.el @@ -0,0 +1,48 @@ +;;; evil-collection-wgrep.el --- Bindings for `wgrep' -*- lexical-binding: t -*- + +;; Copyright (C) 2018 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, 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 . + +;;; 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 "") 'wgrep-exit)) + +(provide 'evil-collection-wgrep) +;;; evil-collection-wgrep.el ends here diff --git a/evil-collection.el b/evil-collection.el index 1489f59..41ab8eb 100644 --- a/evil-collection.el +++ b/evil-collection.el @@ -147,6 +147,7 @@ or evil-collection.") view vlf which-key + wgrep woman xref (ztree ztree-diff)) diff --git a/readme.org b/readme.org index 9e885db..214cf7f 100644 --- a/readme.org +++ b/readme.org @@ -385,6 +385,15 @@ definition". - ~f10~ Step Over - ~f11~ Step Into - ~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 ~evil-collection-translate-key~ allows binding a key to the definition of