spacemacs/contrib/iedit
2014-12-05 15:32:41 -05:00
..
extensions/evil-iedit-state Add p to iedit state to replace occurrence with last yanked (copied) text 2014-12-05 15:32:41 -05:00
extensions.el Fix lazy loading of iedit 2014-12-05 10:21:52 -05:00
packages.el Add iedit layer 2014-12-05 00:59:35 -05:00
README.md Add p to iedit state to replace occurrence with last yanked (copied) text 2014-12-05 15:32:41 -05:00

iedit contribution layer for Spacemacs

Table of Contents

This layer replaces auto-highlight-symbol back end by iedit.

It comes with two new evil states:

  • iedit state
  • iedit-insert state

These states color code is red.

It has also a nice integration with expand-region for quick edit of the current selected text by pressing e.

Install

To use this contribution add it to your ~/.spacemacs

(defvar dotspacemacs-configuration-layers '(iedit)
  "List of contribution to load."
)

Key bindings

State transitions

  • SPC s e initiates the iedit state in normal mode.
  • e initiates the iedit state while expanding region.
  • i in iedit state triggers the iedit-insert state.
  • ESC in iedit state returns to normal state.
  • ESC in iedit-insert state returns to iedit state.
  • Shift-Return in iedit-insert state ends the edition and returns to normal state.

In iedit state

Key Binding                 |                 Description

--------------------------------|------------------------------------------------------------ # | prefix all occurrences with an increasing number b | make all occurrences blank B | toggle buffering (use it for large buffers with a lof of occurrences) c | evil-change (for convenience) d | delete the occurrences D | down-case the occurrences f | restrict the scope to the function "gg" | go to first occurrence G | go to last occurrence i | switch to iedit-insert state I | toggle case-sensitivity h | evil-backward-char j | evil-next-visual-line k | evil-previous-visual-line l | evil-forward-char J | increase the edition scope by one line below K | increase the edition scope by one line above L | restrict the scope to the current line n | go to next occurrence N | go to previous occurrence p | replace occurrences with last yanked (copied) text r | (replace) delete the occurrences and switch to iedit-insert state v | toggle visibility of lines with no occurrence u | undo (for convenience) U | Up-case the occurrences

In iedit-insert state

Key Binding            |                 Description

---------------------------|------------------------------------------------------------ Shift Return | end edition ESC | go back to iedit state

Examples

  • manual selection of several words then replace: v w w SPC s e r "toto" Shift-Return
  • append text to a word on two lines: SPC v i w SPC s e j i "toto" Shift-Return
  • replace symbol with expand-region: SPC v v e r "toto" Shift-Return
  • replace symbol with yanked (copied) text with expand region: v e p Shift-Return

Tips

The first N put the cursor at the beginning of the edited selection.