Fork me on GitHub
#vim
<
2018-04-05
>
dominicm06:04:36

@eraserhd I might try and integrate that idea into vim-replant, that's really nice.

snoe07:04:29

So, I figured out how to get a bunch of my clj-refactor.nvim code into clojure-lsp. It’s actually working pretty nicely with https://github.com/autozimu/LanguageClient-neovim

eraserhd14:04:12

I had no idea about lsp.

eraserhd14:04:40

Can the design support all of the refactors?

snoe14:04:36

I’ve only got a gut feeling now, but I think so. Some things like magic requires need completion plugin support Also, there are a lot of cider refactors that I think have questionable utility, but I’d be interested to know which ones people want/use the most.

eraserhd14:04:12

I know I mostly want (I don't know what they are officially called): inline definition, extract expression to let-name, extract defn, rename, inline-thread-macro, "make"-thread-macro.

eraserhd15:04:07

This is not a refactor, but I've been thinking about how often I need to do this: (thinger |foo true) ;=> (thinger (| foo) true). It's currently ysiW)<I which is painful.

dave15:04:48

@eraserhd if i'm understanding correctly what you mean, i can do that with <localleader>w

dave15:04:22

although off-hand, i'm not sure what plugin is providing that

dave15:04:48

the slurp and barf mappings are super handy

eraserhd15:04:04

Well, huh. That works for me too. Except I've set my local leader but I need to use \w.

dave15:04:15

heh, interesting

dave15:04:21

my local leader happens to be \ so i never noticed

dave15:04:49

ah, i found it

dave15:04:53

it's coming from vim-sexp

dave15:04:44

\w inserts a space before the existing first element, because why wouldn't you ever want to do that

dave15:04:59

and \W doesn't insert any spaces, interestingly

dave15:04:18

i guess that makes sense, because you might just want to wrap a symbol in parens and make it a function call

eraserhd15:04:07

Yeah. OK, that's nice 🙂

eraserhd15:04:43

I guess I remapped my global leader but never my local leader. I kind of like it this way.

snoe15:04:50

@eraserhd those are similar to my top ones - is inline-thread-macro turning (-> a b) into (b a) ?

eraserhd15:04:08

Yeah. But also working on, say ->> or as->. I suppose cond-> would be unruly.

eraserhd15:04:22

This might just be macroexpand-1, actually.

eraserhd18:04:08

Maybe... instead of just marking failed test lines, it could send the failed test values to Vim as well?

eraserhd18:04:02

I keep thinking I want like an EDN navigator. Kind of like JSONView, but for EDN.

eraserhd18:04:28

(Cause I get 8000-line exceptions regularly.)

eraserhd18:04:17

Oh, I suppose pretty printing + foldmethod=syntax works.

snoe18:04:04

I’ve seen a repl plugin that lets you use zipper commands to navigate data structures - https://github.com/eggsyntax/datawalk

schmee20:04:21

sounds really smooth

schmee20:04:14

personally, I don’t find myself spending much time on ns forms so it’s nothing I desperately need (unlike parinfer!) but it is certainly a nice-to-have 🙂

eraserhd20:04:46

Well, I definitely agree that parinfer is a bigger deal. But it's like Jerry Weinberg says, "when you solve your biggest problem, you promote your second biggest problem."

eraserhd20:04:21

Though, if I'm honest, I have to say that dealing with copious REPL output is a bigger problem for me than dealing with namespaces.

schmee20:04:40

one thing I would really like is a way to eval expressions in Vim and have the output collected in a buffer

schmee20:04:02

that would save me a lot of time jumping back and forth between the repl and vim

eraserhd21:04:06

How do you mean? Like cpp in fireplace?

eraserhd21:04:19

Cause you can open a buffer with the output using :Last.

eraserhd21:04:56

Or specifically the results of several expressions, concatenated.

snoe21:04:07

That markdown is pretty close to my views /goals for clojure-lsp

eraserhd21:04:02

I... would love to not duplicate effort. And I'm sad about the startup time of Java (hence the Rust) and needing to "boot" Vim. Even though, writing in Clojure for Clojure has quite a large number of wins. I gotta go home now, but I shall ponder.

eraserhd21:04:44

clojure-lsp isn't "realtime" though, right? It won't update the namespace as you type.

snoe21:04:44

I get it. I have no problems with rust, just bootstrapping to a point where you manipulate sexps easily is more effort than I can spend..

snoe21:04:02

It can actually, in vscode the auto completions add requires

eraserhd21:04:48

Ugh, yeah, that will be work (wrt Rust). I actually spent time on a Clojure library that is used by clj-refactor, so I have Ideas about how to do that.

snoe21:04:32

the server can also just send adhoc workspaceEdits as it wishes - so a config to keep clean namespaces would be totally doable

eraserhd21:04:14

Hmm. I better queue up the spec for this and read it, then.

snoe21:04:48

Try working with the rust rls - it’s pretty great

eraserhd21:04:04

Interesting. This format seems to specify decently stuff I made up or copied from parinfer to send and receive changes.

schmee21:04:08

> Or specifically the results of several expressions, concatenated. this ^

eraserhd21:04:43

@schmee OK, really walking out now... but can you give me an illustrative example? I'm curious.

schmee21:04:58

hmm… well, one thing is evaluating some expression in the REPL which produces a data structure, and then I want to put that in a def

schmee21:04:50

I often find that I want to manipulate the output of some expression, maybe def it, maybe put it in a fn

schmee21:04:19

stuff like that, I don’t really have a more concrete example at the moment 😛

snoe21:04:45

@eraserhd another possibility could be piggybacking on joker https://github.com/candid82/joker since I’m assuming those manipulation tools exist there.