Fork me on GitHub
#vim
<
2018-07-12
>
Hukka10:07:42

@fedreg Perhaps you can tell what your workflow is in emacs, so we can hint at the corresponding plugins on vim side

👍 4
fedreg16:07:15

@tomi.hukkalainen_slac Good point!! …Very straightforward workflow. About 95% of the time working with clj. 5% cljs. In emacs I just open up a project, start up and connect to a new repl, set up some sample data and feed it to my functions in the namespace. I rarely send the namespace to the repl itself. I also usually run the tests by hand in their namespace. Don’t use parinfer or paredit, just rainblow delimeters. I do use the cider REPL extensively though so if anything like that exists in the vim world, that would be great. Aside from that… I try to run fairly lean so just looking for a vim setup that will let me quickly start up, connect to a repl, and start coding. Thx!

dominicm17:07:07

You probably just want vim-sexp and fireplace

dominicm18:07:04

however, no repl buffer really. I tend to use (comment) sections in the buffer mostly, with :Eval being a close second.

nate18:07:32

I concur, and I add vim-sexp-mappings-for-regular-people

👍 8
nate18:07:30

I've found that using #_(...) style reader comments makes :Eval more useful, I even mapped it to ,cpt

dominicm18:07:46

I don't understand the reader comments, how does that work?

Hukka19:07:42

#_ makes the reader skip the whole next form, while (comment) returns a nil

Hukka19:07:52

You can also write a bunch of #_ s to skip as many next forms

dominicm19:07:22

Sure, but how does it make :Eval more useful?

nate20:07:00

because :Eval evaluates the top level form

nate20:07:07

so if you have several things in a comment block

nate20:07:34

(comment
    (test code 1)
    (test code 2)
 )

nate20:07:07

then you have to move the cursor to one or the other to evaluate it

nate20:07:13

but if you organize it this way:

nate20:07:38

#_(test code 1)
#_(test code 2)

nate20:07:58

then you can evaluate either one with :Eval

nate20:07:20

it makes more sense when the (test code 1) is a more complex form

nate20:07:45

like for instance this bit:

#_(-> (cache/lru-cache-factory {})
      (assoc :a 1)
      (assoc :b 2)
      (cache/hit :a)
      (assoc :c 3)
      pr-str)

nate20:07:11

if my cursor is on the :a in the cache/hit line

nate20:07:16

and I do cpp

nate20:07:40

it'll evaluate just (cache/hit :a), which generates an error

nate20:07:11

so in order to have the top form be evaluated, I need to move my cursor to the threading operator at the top

nate20:07:38

or, since this is the top level form, I just run cpt (or :Eval) and it runs without me having to move my cursor

dominicm20:07:25

ah! I didn't know that behaviour of :Eval

dominicm20:07:31

I've been using marks

dominicm20:07:42

cider just added a feature where the :Eval equivalent ignores (comment)

dominicm20:07:47

maybe we should do the same :thinking_face:

nate20:07:41

that would be nice