Fork me on GitHub
#editors
<
2015-06-21
>
davs07:06:19

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

english08:06:20

@davs are you using vim-sexp? It gives you yaf (yank all form) yif (yank inner form) etc.

davs08:06:23

oh god..thanks for making me feel stupid..why did I not think of that 😄

davs08:06:28

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

davs08:06:58

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

english09:06:30

Hmmm. All I can think of is f(, but thats specific to each char.

english09:06:54

From the vim-sexp readme: > The ( and ) motions move the cursor to the nearest paired structural bracket.

english09:06:24

@davs That applies for [s and { too. Maybe close to what you’re looking for?

davs09:06:49

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.

english09:06:41

@davs: Ah I see. For those cases I just use B or b.

davs09:06:05

/[[({] does the trick. Again, so simple. Got the idea on #vim

jcsims21:06:57

any Cursive users played around with LivePlugin? https://github.com/dkandalov/live-plugin

jcsims22:06:16

can write little mini-plugins in Clojure