Fork me on GitHub
#editors
<
2016-01-31
>
snoe08:01:53

If anyone's using neovim I've been working on a port of clj-refactor.el. Feedback, suggestions, contributions welcome here: https://github.com/snoe/clj-refactor.nvim

juhoteperi08:01:28

@snoe: Interesting. I have implemented few features here using pure Vimscript: https://github.com/Deraen/vim-cider

juhoteperi08:01:39

Looks like using Cljs/Node on neovim allows implementing threading nicely

snoe08:01:13

@juhoteperi: yeah I think the ability to script vim with cljs is pretty huge (as in, it could end up being a better story than writing clojure plugins with emacs lisp) . I had actually looked at your project before starting but the thought of doing the transformations in vimscript put me off. On the other hand, I also really like the direction that the emacs project is taking and I figured I might be able get vim to catch up.

juhoteperi08:01:43

Yeah using Cljs is definitely good idea. Will have to test to see how well it works.

juhoteperi08:01:56

Is your plugin async?

snoe08:01:00

yeah - although I'm using a weird mix of maintaining my own nrepl connection and using fireplace ... I'll have to clean that up while keeping it async

juhoteperi08:01:55

Would be great to add async support to Fireplace or to provide alternative plugin

snoe08:01:15

heh I was about to link to the fireplace issue but I see you raised it. I've tried diving into the problem a few times but I haven't had much luck grokking what tpope was saying there. https://github.com/tpope/vim-fireplace/issues/202

juhoteperi08:01:00

Yeah I think the easiest way would be to test how it should work in a new plugin, and then to see how or if it can be added to fireplace

juhoteperi08:01:49

Quite hard to refactor existing plugin to add async support, even though the architecture should support it

juhoteperi08:01:17

Wohoo! I got it working!

juhoteperi08:01:31

Maybe this will finally convince me to use Nvim

snoe08:01:20

haha great, I've been using it for about a year now, and I've noticed very few differences or problems

juhoteperi08:01:35

Hm, clean-ns is compaining about repl connection

snoe08:01:05

yeah it looks up the dir tree for a .nrepl-port file

snoe08:01:27

goes back to my fireplace comment

juhoteperi08:01:52

Strange, the file should exist

snoe08:01:54

hrm darn maybe lein npm install inside the plugin dir

juhoteperi09:01:51

Ah, I was trying on cljc file and connect is only running on clj files

juhoteperi09:01:18

Works great on clj file

benedek13:01:12

Ha nice one @snoe. Perhaps the lighttable plugin can be useful example too (light-refactor by @rundis )

benedek13:01:50

Basically a client for refactor-nrepl in cljs too afaik

dominicm14:01:27

@snoe: I have async Fireplace working, I think. Or some stuff working anyway.

dominicm14:01:46

I wish Neovim had async omnicomplete, I've had to switch my omnicomplete to manual for Clojure.

dominicm14:01:45

Fireplace uses Dispatch to execute commands. I do appreciate having my repl be launched in a tab.

dominicm14:01:34

Fugitive can use that too, which is nice when I notice it.

dominicm14:01:46

You might be interested in my push to here last night btw https://github.com/SevereOverfl0w/vim-cljrefactor

juhoteperi14:01:04

Afaik async omnicomplete can be achieved with some autocommands and calling complete from plugin when results are ready

dominicm14:01:39

deraen: Deoplete has got async omnicomplete, but not with omnifunc sources.

dominicm14:01:29

So yeah, the problem is perhaps more about being able to call omnifunc asynchronously.

juhoteperi14:01:56

@dominicm: What stuff does vim-dispatch-neovim affect in fireplace?

dominicm14:01:52

@juhoteperi: The most obvious one is ":Console" which will spawn in a neovim terminal, instead of a new window.

juhoteperi14:01:54

When I evaluate Thread/sleep it''s not async 😞

juhoteperi14:01:15

Hmh, I don't care about that, I always open repl manually on separate terminal

dominicm14:01:44

I almost always do also

dominicm14:01:57

But for a while I wasn't, and it was super useful.

dominicm14:01:41

I'm not sure if fireplace spawns out to dispatch for anything else.