DEV Community

SpaceVim
SpaceVim

Posted on

3 1

Multiple cursor support in SpaceVim

SpaceVim is a preconfigured configuration for Vim and Neovim. It provides multiple cursor supportting via iedit plugin which just same as iedit-mode of emacs.

iedit-mode

The default key binding of iedit is SPC s e, SPC is <Space>. There are two mode of iedit, iedit-normal mode and iedit-insert mode. Here are the key bindings of these two modes.

iedit states key bindings

State transitions:

Key Bindings From to
SPC s e normal or visual iedit-Normal

In iedit-Normal mode:

iedit-Normal mode inherits from Normal mode, the following key bindings are specific to iedit-Normal mode.

Key Binding Descriptions
<Esc> go back to Normal mode
i switch to iedit-Insert mode, same as i in Normal model
a switch to iedit-Insert mode, same as a in Normal model
I go to the beginning of the current occurrence and switch to iedit-Insert mode, same as I in Normal model
A go to the end of the current occurrence and switch to iedit-Insert mode, same as A in Normal model
<Left>/h Move cursor to left, same as h in Normal model
<Right>/l Move cursor to right, same as l in Normal model
0/<Home> go to the beginning of the current occurrence, same as 0 in Normal model
$/<End> go to the end of the current occurrence, same as $ in Normal model
C delete the characters from the cursor to the end in all occurrences and switch to iedit-Insert mode, same as C in Normal model
D delete the occurrences, same as D in Normal model
s delete the character under cursor and switch to iedit-Insert mode, same as s in Normal model
S delete the occurrences and switch to iedit-Insert mode, same as S in Normal model
x delete the character under cursor in all the occurrences, same as x in Normal model
X delete the character before cursor in all the occurrences, same as X in Normal model
gg go to first occurrence, same as gg in Normal model
G go to last occurrence, same as G in Normal model
f{char} Move the cursor to the right where the {char} first appears in all the occurrences
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:

Key Bindings Descriptions
Ctrl-g / <Esc> go back to iedit-Normal mode
Ctrl-b / <Left> move cursor to left
Ctrl-f / <Right> move cursor to right
Ctrl-a / <Home> moves the cursor to the beginning of the current occurrence
Ctrl-e / <End> moves the cursor to the end of the current occurrence
Ctrl-w delete word before cursor
Ctrl-k delete all words after cursor
Ctrl-u delete all characters before cursor
Ctrl-h / <Backspace> delete character before cursor
<Delete> delete character after cursor

The SPC s e will select all matchs by default, if you want to select the matchs one by one, you can use SPC s E key binding and Ctrl-n to select next one.

Heroku

Simplify your DevOps and maximize your time.

Since 2007, Heroku has been the go-to platform for developers as it monitors uptime, performance, and infrastructure concerns, allowing you to focus on writing code.

Learn More

Top comments (0)

AWS Security LIVE!

Tune in for AWS Security LIVE!

Join AWS Security LIVE! for expert insights and actionable tips to protect your organization and keep security teams prepared.

Learn More

👋 Kindness is contagious

Discover a treasure trove of wisdom within this insightful piece, highly respected in the nurturing DEV Community enviroment. Developers, whether novice or expert, are encouraged to participate and add to our shared knowledge basin.

A simple "thank you" can illuminate someone's day. Express your appreciation in the comments section!

On DEV, sharing ideas smoothens our journey and strengthens our community ties. Learn something useful? Offering a quick thanks to the author is deeply appreciated.

Okay