Fork me on GitHub
#vim
<
2018-02-28
>
Hukka08:02:55

@dave Hadn't seen it, checked it, but it doesn't seem to give anything extra to my workflows, unless I start using :terminal for other things than the repl. Most likely I want to either send sexps (which the line based selection doesn't help) or have an interactive session with tab-completion, command history and so on, so I don't want to input commands via the :T

Hukka09:02:20

Is there a reasonable way to get the current namespace of the file, for running (run-tests 'your.namespace 'some.other.namespace) in the repl?

dominicm09:02:06

*ns* has the current namespace

Hukka10:02:13

It's the current namespace in the repl, but that's different from what file you are in

dominicm10:02:10

fireplace has a regex it uses.

dominicm10:02:15

I think the fn is safe to just copy.

zamaterian11:02:58

function! SendToTerm(lines)
  call jobsend(g:last_term_job_id, add(a:lines, ''))
endfunction

function! SyncRepl()
  call SendToREPL("(require '[clojure.pprint :refer [pprint]])(require '[clojure.repl :refer :all]) #_(require '[hara.reflect :refer :all]) #_(require '[hara.class :refer :all])")
  call SendToTerm([" (in-ns '" . fireplace#ns() . ") "])
endfunction
function! SendToREPL(sexp)
  call fireplace#session_eval(a:sexp)
endfunction


jebberjeb15:02:43

@tomi.hukkalainen_slac Curious to see where you end up w/ it. I usually just move to the top of the buffer, eval the ns form to switch namespace, then just run-tests, w/ no args.

Hukka15:02:14

Oh my, vimscript 😞

jebberjeb15:02:25

😞 I know

jebberjeb15:02:34

I’d been trying to avoid it.

Hukka15:02:44

And I'm one of those people who can't just stop at "it works" but has to go to "I understand it"

Hukka15:02:53

So I'm immediately stopping at things like "What's that a:0, the first argument?" and "is the s: in s:buf just a naming convention, or does it somehow change how the function works"

Hukka15:02:17

But I'll try to just copy paste enough to get it working, and leave it at that 😉

jebberjeb15:02:51

Make a keybinding that goes to the top of the file and eval’s the first form, which is almost always going to be the ns form.

Hukka15:02:54

I wonder if that requires less vimscript

Hukka15:02:01

I mean learning less

jebberjeb15:02:27

I think you’d do that with :norm, so yeah probably.

Hukka16:02:06

I saw a post in Planet Clojure today, with some statistics about clojure developers. I don't know what the target group really was, but I was quite surprised that vim was listed above 10% in IDEs/editors.

Hukka16:02:16

Maybe clojure is different from older lisps, or I'm just pessimistic since noone else around me uses vim 🙂

dominicm17:02:21

We have some users here at JUXT

jebberjeb17:02:27

I find that a lot of newcomers to Clojure from languages like Ruby & Python are vimmers. It used to have a higher marketshare, but I think Cursive eroded it a good bit over the last few years.

dominicm18:02:39

Spacemacs is the virus I see