Hi! Right now I'm using vim for editing clojure code and I find myself having a problem with copying chunks code because of tha parens and I end up writing everything by hand again. How do you copy something to the end of an s-exp, where there are additional N closing parens of the main form? If I were to do line-wise copying, I would end up trying to match closing parens all the time
@davs are you using vim-sexp
? It gives you yaf
(yank all form) yif
(yank inner form) etc.
oh god..thanks for making me feel stupid..why did I not think of that 😄
btw do you have (or know of) a vim mapping, that moves 1 char forward or backward (to the closest one) the char being '(', '[', '{' ? So I could step inside forms, map, vector and list declarations
I know how to do it for one of the chars, but it would be great if there were an universal mapping, that would jump to the closest of any of those chars
no worries @davs :simple_smile:
Hmmm. All I can think of is f(
, but thats specific to each char.
From the vim-sexp
readme:
> The ( and ) motions move the cursor to the nearest paired structural bracket.
@davs That applies for [
s and {
too. Maybe close to what you’re looking for?
yes, vim-sexp ( ) works kinda that way, but it moves only to the outer bracketes. so for example if I have code: (+ (+1 2) (+ 3 4)) and I'm inside the (+ 3 4+ form, then it jumps over the (+ 1 2) form. I guess I'll check it's source code.
@davs: Ah I see. For those cases I just use B
or b
.
/[[({] does the trick. Again, so simple. Got the idea on #vim
@davs cool!
any Cursive users played around with LivePlugin? https://github.com/dkandalov/live-plugin
can write little mini-plugins in Clojure