|
||
---|---|---|
.. | ||
extensions/evil-iedit-state | ||
extensions.el | ||
packages.el | ||
README.md |
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
To iedit state
:
- SPC s e initiates the
iedit state
in normal mode. - e initiates the
iedit state
while expanding region. - ESC in
iedit-insert state
returns toiedit state
.
To iedit-insert state
- evil commands which switch to
insert state
will switch iniedit-insert state
.
To normal state
- ESC in
iedit state
returns tonormal state
. - ESC in
iedit-insert state
returns toiedit state
. - C-g returns to normal mode
- fd returns to normal mode (if
evil-escape
is enabled)
To sum-up, in iedit-insert state
you have to press ESC twice to
go back to the normal state
. You can also at any time press C-g
or fd to return to normal state
.
In iedit state
iedit state
inherits from normal state
, the following key bindings are
specific to iedit state
.
Key Binding | Description
------------------|------------------------------------------------------------
ESC | go back to normal state
# | prefix all occurrences with an increasing number (SPC u to choose the starting number).
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 | toggle case-sensitivity
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
S | (substitute) delete the occurrences and switch to iedit-insert state
V | toggle visibility of lines with no occurrence
U | Up-case the occurrences
In iedit-insert state
Key Binding | Description
---------------------------|------------------------------------------------------------
ESC | go back to iedit state
C-g | go back to normal state
Examples
- manual selection of several words then replace: v w w SPC s e S "toto" ESC ESC
- append text to a word on two lines: v i w SPC s e J i "toto" ESC ESC
- substitute symbol with expand-region: SPC v v e S "toto" ESC ESC
- replace symbol with yanked (copied) text with expand region: SPC v e p ESC ESC
Todo
- Make
A
append to the end of the edited region. - Make
I
insert to the beginning of the edited region. - Make
0
go to the beginning of the edited region. - Make
$
go to the end of the edited region.