Paste text
Auto-indent pasted text
Text manipulation commands
Text insertion commands
Text insertion commands (start with i
):
Key binding | Description |
---|---|
SPC i l l |
insert lorem-ipsum list |
SPC i l p |
insert lorem-ipsum paragraph |
SPC i l s |
insert lorem-ipsum sentence |
SPC i p 1 |
insert simple password |
SPC i p 2 |
insert stronger password |
SPC i p 3 |
insert password for paranoids |
SPC i p p |
insert a phonetically easy password |
SPC i p n |
insert a numerical password |
SPC i u |
Search for Unicode characters and insert them into the active buffer. |
SPC i U 1 |
insert UUIDv1 (use universal argument to insert with CID format) |
SPC i U 4 |
insert UUIDv4 (use universal argument to insert with CID format) |
SPC i U U |
insert UUIDv4 (use universal argument to insert with CID format) |
Increase/Decrease numbers
In transient state:
Key Binding | Description |
---|---|
+ |
increase the number under point by one |
- |
decrease the number under point by one |
Any other key | leave the transient state |
Tips: you can increase or decrease a value by more that once by using a prefix argument (i.e. 10 SPC n +
will add 10 to the number under point).
Replace text with iedit
Two new modes: iedit-Normal
/iedit-Insert
The default color for iedit is red
/green
which is based on the current colorscheme.
iedit states key bindings
State transitions:
iedit-Normal
mode inherits from Normal
mode, the following key bindings are specific to iedit-Normal
mode.
Key Binding | Description |
---|---|
Esc |
go back to mode |
i |
switch to iedit-Insert mode, same as i |
a |
switch to iedit-Insert mode, same as a |
I |
go to the beginning of the current occurrence and switch to iedit-Insert mode |
A |
go to the end of the current occurrence and switch to iedit-Insert mode |
<Left> /h |
Move cursor to left |
<Right> /l |
Move cursor to right |
0 /<Home> |
go to the beginning of the current occurrence |
$ /<End> |
go to the end of the current occurrence |
D |
delete the occurrences |
S |
delete the occurrences and switch to iedit-Insert mode |
gg |
go to first occurrence |
G |
go to last occurrence |
n |
go to next occurrence |
N |
go to previous occurrence |
p |
replace occurrences with last yanked (copied) text |
<Tab> |
toggle current occurrence |
In iedit-Insert mode:
Examples
Commenting
Comments are handled by nerdcommenter, it’s bound to the following keys.
Key Binding | Description |
---|---|
SPC ; |
comment operator |
SPC c h |
hide/show comments |
SPC c l |
comment lines |
SPC c L |
invert comment lines |
SPC c p |
comment paragraphs |
SPC c P |
invert comment paragraphs |
SPC c t |
comment to line |
SPC c T |
invert comment to line |
SPC c y |
comment and yank |
SPC c Y |
invert comment and yank |
Multi-Encodings
SpaceVim use utf-8 as default encoding. there are four options for these case:
- fileencodings (fencs): ucs-bom,utf-8,default,latin1
- fileencoding (fenc): utf-8
- encoding (enc): utf-8
- termencoding (tenc): utf-8 (only supported in vim)
to fix messy display:SPC e a
is the mapping for auto detect the file encoding. after detecting file encoding, you can run the command below to fix the encoding: