editors

Discussion about all editors used for Clojure/ClojureScript
davs 2015-06-21T07:03:19.001179Z

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

english 2015-06-21T08:57:20.001180Z

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

davs 2015-06-21T08:58:23.001181Z

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

davs 2015-06-21T08:59:28.001182Z

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

davs 2015-06-21T08:59:58.001183Z

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

english 2015-06-21T09:00:45.001184Z

no worries @davs :simple_smile:

english 2015-06-21T09:01:30.001185Z

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

english 2015-06-21T09:02:54.001186Z

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

english 2015-06-21T09:03:24.001187Z

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

davs 2015-06-21T09:05:49.001188Z

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.

english 2015-06-21T09:11:41.001189Z

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

davs 2015-06-21T09:13:05.001190Z

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

english 2015-06-21T09:15:32.001191Z

@davs cool!

jcsims 2015-06-21T21:59:57.001193Z

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

jcsims 2015-06-21T22:00:16.001195Z

can write little mini-plugins in Clojure