In vim, I frequently used the "." shortcut for repeating the last command. I found this extremely useful especially when working with clojure tools to do things like slurp-ing and barf-ing to refactor code.
In Spacemacs, the clojure layer provides a special state called lisp-state
that allows for things like slurp and barf. See here.
What I'm trying to do is find a key, like .
, that I can bind to some command that would allow me to repeat an action like a slurp
.
By default, in evil-mode
the .
is bound to evil-repeat
. However, doing that creates odd behavior. For example, a common scenario in which I use the repeat is when editing lisp files. Let's say I slurp a text like so using Ctrl + k, s:
() + a b => (+) a b
In vim, I would hit the "." key to continue moving the paren to the right. With the setting above in Emacs (Spacemacs), I got a behavior I did not understand. If I hit .
, the slurp is not repeated. Instead, I see the following at the bottom of the screen:
state: lisp -> normal
I also tried to remap the .
key to the repeat
command instead of evil-repeat
, but I get the same behavior.
It appears that the repeat key somehow first interacts with the lisp-state
, perhaps returning the browser to normal state. So my question is what is the right way to repeat an action like slurp in lisp-state
, and can this method be bound to a key?