Fork me on GitHub
#spacemacs
<
2020-12-14
>
John Oerter23:12:54

Forgive me if this is a common question, but how can I wrap an expression in [] with spacemacs and evil-lisp-state? I know that SPC + k + w wraps in parens but can't figure out how to wrap in other Clojure forms

jumar05:12:52

If it's already wrapped with () you can use , r c [ to convert it to a vector. Or you can use the y s motion (read "you surround" 🙂 ) E.g. y s $ [ surrounds everything from the current position till the end of line with []

👍 3
practicalli-johnny11:12:01

I usually do SPC v to select a word, s to surround with a character, ] to surround with square brackets without a space, or [ to include a space.

jumar11:12:54

That's nice too, thanks for sharing.

practicalli-johnny11:12:17

Hmm, v e would also work if you are at the start of the word and is the only word to be surrounded. SPC v is nice as you can keep on expanding the selection with v , eg. SPC v v v V and shift-v to shrink the selection.

thanks2 3
practicalli-johnny12:12:48

I use SPC v with ~ when I want to capitalise words, its very handy.

John Oerter14:12:58

Thanks @U06BE1L6T and @U05254DQM! That's exactly what I was looking for