I'm getting started using spacemacs with vim bindings for editing and one thing I would like to do sometimes is replace some text with some other text. For example I might have
k x = (1 + 1) * x
and I want to select replace (1 + 1)
with 2
. Normally in vim I would just type f(v%s2<Esc>
.
However in spacemacs s
doesn't work on selections like it does in vim, this instead puts 2
around the selection
k x = 2(1 + 1)2 * x
Which is not what I wanted. (Strangely s
seems to work perfectly in normal mode)
Now obviously in this case I can just do di
to delete and enter insert mode separately but in general di
has some important drawbacks:
- It cannot be repeated across several lines using visual selection mode (a very common use case)
- It cannot be repeated with
.
since it is two actions.
Is there another option that I could use to achieve the functionality of my old s
? Or do I have to modify my configs somehow?