Fork me on GitHub
#vim
<
2016-09-27
>
biscuitpants07:09:43

neovim vs vim?

biscuitpants07:09:07

to me there doesn’t seem to be much of a functional difference, other than code being better maintained, and a better plugin api

zamaterian07:09:04

I really like the term in neovim, it gives me a much better interaction than using tmux

markwoodhall07:09:23

@biscuitpants: I've been asking myself the same question. Using vim at the moment, I'm a bit worried about fragmentation between the two, for instance, some Clojure related plugins are appearing for neovim only. Right now I'd go with neovim but I'm having to use vim for some compatibility issues with other plugins so swapping between them for now.

biscuitpants07:09:43

oh, wow, if there are plugins specific for Clojure then i will have to go for neovim

biscuitpants07:09:53

i want to setup a vim environment for clojure development, that works as well as my emacs one

biscuitpants07:09:08

currently in emacs i have clj-refactor, cider (ofc), paredit, and rainbow parenthesis

biscuitpants07:09:14

are there plugins that mimic this?

biscuitpants07:09:26

i know there is fireplace, and paredit

biscuitpants08:09:25

oh sweet! clj refactor

biscuitpants08:09:31

thank you @dominicm taking a look now

dominicm08:09:11

The other great plugin is nvim parinfer.js,

dominicm08:09:10

That rainbow package is by far the best. The others break syntax folding with clojure.

markwoodhall08:09:18

@dominicm: I really like the layout of your nvim dotfiles. Is that something you came up with? Or a convention documented somewhere?

dominicm08:09:34

@markwoodhall I use an overly complex init.vim 😁 I think gh user Jayes came up with it.

dominicm08:09:49

It's pretty cool though. I do miss the ease of editing a single file, but I love that when I run EditLayer clojure I can really focus on what I'm fixing. I need to figure out dependencies a little bit though I think. Like, how to have my clojure layer insert autocompletion for itself. I think I'm going to have to come up with a pseudo dependency system.

dominicm08:09:47

To be fair, the completion does work though. I should add

markwoodhall08:09:47

It does look pretty cool, I've struggled with an unmanageable .vimrc and wanted to take advantage of moving to nvim and clean it up a little, something like this looks like it might be nice though!

dominicm08:09:22

Feel free to steal it 😊

dominicm08:09:45

It should work with plain vim. Except my plugins.

biscuitpants08:09:18

thank you @dominicm, i’m definitely going to use your nvim as a base to start on. seems really nicely organized

dominicm08:09:53

I saw you guys mention your worries about neovim vs vim. I'd be interested to hear more.

dominicm08:09:35

@markwoodhall what plugins do you need to switch back to vim for? That's very interesting. Everything works for me. :s

markwoodhall08:09:29

I guess I could get by without it but I'm using a plugin for C# and .net stuff, last time I tried I had issues with it. One of which was python version related. I am using it alongside neocomplete and I also couldn't get it to work with deoplete.

dominicm08:09:33

Ah, might be okay now. Depending on when you used it, neovim's python support is better than it was. Things like if_python work again.

markwoodhall08:09:01

Cool. I'll give it a try again. I'd rather ditch the C# stuff altogether if I'm honest!

biscuitpants09:09:00

man i’m stoked to setup a vim environment now

biscuitpants09:09:09

i also want to setup archlinux, just never have time to get to it

dominicm09:09:41

I use arch linux at work exclusively. It's the bomb.

biscuitpants09:09:23

yeah. i’ve played with it a lot, but never had time to fully set it up to my liking

biscuitpants09:09:30

its a wonderful distro, though

biscuitpants09:09:34

how do you find it for Clojure dev?

biscuitpants09:09:39

i guess not that different from say OSX?

zamaterian09:09:12

@biscuitpants you can see my setup here https://github.com/zamaterian/dotfiles/blob/master/.vimrc as inspiration (its only for neovim)

biscuitpants09:09:28

ah amazing! thank you πŸ˜„

zamaterian09:09:50

Nice to see some activity in here πŸ™‚

biscuitpants10:09:32

it will probably become more active as i hit my head on vim πŸ˜›

dominicm10:09:23

@biscuitpants I've used Arch since I was ~14, never used OSX. So not much of a comparison I can make.

dominicm10:09:16

@zamaterian That plug_doc is pretty neat.

zamaterian10:09:51

Grabed that from vim-plug FAQ

dominicm10:09:14

Hadn't seen the grimoire plugin before either. Someone should put together a big index at some point.

zamaterian10:09:38

I didnot get it to work, mainly because of outdated dependencies

dominicm10:09:32

Are their docs significantly better than those of the default?

dominicm10:09:16

I could fork to vim-clojure and fix it up if you think it would be useful to others.

dominicm10:09:58

I can't see any real difference based on a cursory look.

dominicm11:09:34

@zamaterian I'm stealing your SendToREPL, SendToTerm stuff. That's the bomb.

dominicm11:09:13

@zamaterian https://github.com/zamaterian/dotfiles/blob/master/.vimrc#L495-L502 I don't understand how this is different from cpaF in vim-fireplace with vim-sexp though. Am I missing something?

zamaterian12:09:29

@dominicm its an old left over.. πŸ™‚

zamaterian12:09:48

@dominicm regarding grimoire its kind of usefull since it contains user commited examples. It popped up when clojuredocs was not maintained.

dominicm12:09:27

@zamaterian Ah. That's okay then. I didn't see a mapping to (reset) anywhere? Do you not use component, or does it not work?

zamaterian12:09:58

No dont really use component.

dominicm12:09:12

Makes sense then. I've done a lot of fiddling, and had to settle on using thinca/vim-localrc so I can have a per-project namespace which (reset) runs in, it's been a bit of a pain. reloaded.repl makes this somewhat easier, but not everything uses that (yet 😈)

markwoodhall13:09:20

I didn't realise until joining this channel that there are so many vim loving clojurists. I'd kind of felt an internal pressure to start moving to emacs (spacemacs) but I've been resisting.

dominicm13:09:51

@markwoodhall Me too. We should stick together! πŸ˜›

dominicm13:09:33

It might be worth putting together some "how I use vim" with clojure guides.

markwoodhall13:09:39

Yeah. That would be cool. Didn't expect vim to be so high on that graph.

markwoodhall13:09:32

Are you using tmux or the neovim term like @zamaterian ?

dominicm13:09:16

@zamaterian I use neovim terminal sometimes. Most of the time I just open a new terminal and start my repl there. I do all evaluation through :Eval, cqp and cpp from there.

dominicm13:09:06

But I'll probably have a go at stealing some of @zamaterian's stuff to see if it changes my workflow much

dominicm13:09:01

Maybe that should be renamed to just Clojure with Vim, I think it's a bigger picture now.

dominicm13:09:26

@zamaterian Do you use that in place of :Eval and cqp?

zamaterian13:09:22

No, for sync'in the repl ns to the namespace in the active buffer..

dominicm13:09:59

Sorry, I mean - do you use the REPL in the terminal, in place of :Eval and cqp, or do they serve different purposes?

zamaterian13:09:03

I prototype a lot in the repl, testing things out - mainly I just eval the entire ns (buffer) Eval% or using nmap <Leader>e <Plug>FireplacePrint<Plug>(sexp_outer_top_list) for eval a function

dominicm14:09:48

I use cqp for testing things out. And <localleader>rs to reset via t.n.s. Interesting how people come to such different solutions to same/similar problems. This is why I love vim though πŸ˜„

zamaterian14:09:45

I really like that I can navigate to a function in a zip file (a dependency) and then change the definition and using <Leader>e to hotload it into the jvm. Its a great way of debugging.

dominicm14:09:30

I do that all the time, it's so much fun. Except I've noticed that if I don't change it back, it seems like the jar gets cached or something, and it includes my println in other projects.

zamaterian14:09:50

It because you can inplace modify a zipfile

dominicm14:09:17

It always throws when I hit :w though? I thought that meant it wasn't saving?

zamaterian14:09:18

the only 'shared state' between different projects is your ~/.m2/repository

markwoodhall14:09:31

Do you both not use :Require and :Require! very much?

dominicm14:09:07

@zamaterian I'll have to pay more attention in future!

dominicm14:09:34

@markwoodhall I don't, because the (require 'blah :reload) is a little dated in wake of clojure.tools.namespace.

markwoodhall14:09:19

Ah, ok. More reading up to do!

zamaterian14:09:26

I mainly uses this function `function! RefreshNS() call SendToREPL("(require '[clojure.tools.namespace.repl :refer [refresh]])(refresh)") endfunction`

dominicm14:09:03

@zamaterian Hmm, my call is very direct. Do you use (refresh) directly in the repl?

zamaterian14:09:24

I'm always using it in a context of a buffer (eg. when renaming vars, changing multimethods stuff like that)

dominicm14:09:58

@zamaterian You can skip the require then πŸ™‚

zamaterian14:09:23

πŸ™‚ Are you going to euro clojure ?

dominicm14:09:15

I am, are you?

zamaterian14:09:04

yes πŸ™‚ then we could probably drinks some 🍻

dominicm14:09:20

Absolutely! I'm really looking forward to meeting people I've met online over the last year.

juhoteperi15:09:37

I use cpR to run reloaded.repl reload/ctn refresh!

juhoteperi15:09:56

cpr reload ns, cpR reload project

dominicm15:09:09

I like that mapping, makes a lot of sense.

w1ng16:09:22

i use vim-slime (https://github.com/jpalardy/vim-slime) to send a clojure form to a neovim terminal

w1ng16:09:27

in the terminal buffer i set :set ft=clojure to get syntax highlighting for free

dominicm16:09:14

@w1ng Do you find that better than using vim-fireplace with cpp for any reason?

w1ng16:09:00

i dont have to wait for the evaluation and i got syntax highlighting

dominicm16:09:15

Waiting for evaluation definitely sucks. πŸ˜›

w1ng16:09:26

πŸ™‚

dominicm16:09:45

It should be possible to use async with fireplace, I just need to spend some time figuring it out

dominicm16:09:05

Worst case scenario is a partial implementation of fireplace built on nrepl-python-client

w1ng16:09:10

y i thought about that too

snoe16:09:15

I tried doing the eval to a terminal window but I found that with very large forms (like evaling a whole file) the pasting would cut off.

snoe16:09:23

maybe slime helps

dominicm16:09:45

@snoe How does nvim-parinfer.js do the async? I never quite understood it.

snoe16:09:23

basically node-host allows async commands/functions etc that return immediately. however calling fireplace from those async things will still lock up the editor

dominicm16:09:55

Oh, is most of the heavy lifting in the clojurescript then, and the evaluation is quick?

w1ng16:09:09

the cool thing about node-host is that u can write your plugin in clojurescript

snoe16:09:33

well, parinfer is all cljs. refactor tries to keep the heavy lifting in cljs like you say

snoe16:09:02

@w1ng I think it's a great thing. clojure tools in clojure.

snoe16:09:16

if only neovim took node-host breakage more seriously

snoe16:09:48

I think i'm the only one who gets bug reports when it breaks, and my time has been super curtailed lately

dominicm16:09:52

@snoe oops, yeah. Refactor. I didn't realise it would lock up the editor if it's slow.

dominicm16:09:18

@snoe Yeah, I've been meaning to report an RPC breakage in neovim 1.6. I'm kinda hoping it'll fix itself.

jebberjeb16:09:29

@w1ng working on it furiously! πŸ™‚

jebberjeb16:09:58

I'm about one evening of development from being able to use it in my daily development

jebberjeb16:09:49

Still quite rough, but once the dependency on lein goes away things will improve

dominicm16:09:02

Would be handy to have a clojure-host for that neovim-client.

w1ng16:09:13

y thats what @jebberjeb is doing

jebberjeb16:09:33

That's (one of) the goals of it. It works, but it's not integrated very tightly.

jebberjeb16:09:29

It's still basically a proof of concept.

jebberjeb16:09:16

But, I am focusing on it with all of my after hours time, and 20% time at my day job.

jebberjeb16:09:40

Using it to build a socket-repl client, sort of a replacement to vim-fireplace.

dominicm16:09:37

It would be nice to have a replacement. @jebberjeb is there much of a startup hit?

jebberjeb16:09:24

@dominicm it's horrendous now, but that's only because it's a proof of concept built on lein. The end product will be cljs + node, so startup time should be negligible.

jebberjeb16:09:49

At least, that's my current thinking. Even just removing lein should bring the startup cost down to about a second.

dominicm16:09:08

an AOT'd jar would be decent, yeah.

dominicm16:09:28

But cljs+node is better, and @snoe has shown it to work really well

dominicm16:09:49

I think unless you're crunching numbers in cljs, node is faster

dominicm16:09:30

I think I speak on behalf of us all, that I'd love to see a cljs client to replace fireplace, supporting async and such

jebberjeb16:09:54

That's definitely the goal. Creating the neovim clojure host is really only a means to that end, but it is a nice side effect.

jebberjeb16:09:45

I'd at least like to create some gravity around an alternative, even if it's not feature rich at first. Then, see where it goes.

jebberjeb16:09:51

Maybe a bit more controversial question would be whether to use the built in socket server / repl, or to use nRepl.

biscuitpants17:09:18

Plug or vundle?

biscuitpants17:09:42

after reading the differences, i can’t really decide why i’d chose one over the other

zamaterian17:09:45

I like Plug, have not used vundle

biscuitpants17:09:51

yeah plug seems simple, and straightforward

juhoteperi17:09:15

pathogen is less lines πŸ™‚

dominicm17:09:18

@jebberjeb nrepl. No doubt. Simply because of op codes and sessions.

dominicm17:09:00

Pathogen is less declarative. Neither pro nor con, just difference of interface.

juhoteperi17:09:25

It it declarative, but it is declared on Git level instead of Vim config.

juhoteperi17:09:16

And when dealing with git submodules, you have to specify the commit to use, maybe even more declarative?

dominicm17:09:23

Or maybe even on file system level, but I agree :). I like it being a line in my config, preference thing.

biscuitpants17:09:45

yeah pathogen seems super nice, but i like the thought of having my vimrc with my plugins, instead of submodules

juhoteperi17:09:01

The biggest benefit for me is that I am certain to run the same version both on desktop and laptop. Other reason is that I anyway use lots og submodules on my dotfiles repo.

juhoteperi17:09:56

But yeah, plug or such is probably better choice for many.

dominicm17:09:20

Plug can pin version to a commit, I usually just want to run master and update regularly.

dominicm17:09:02

In other news, the next version of figwheel will have native fireplace support :D

biscuitpants17:09:53

okay tonight i’m gonna start on my init.vim πŸ˜„ i’m super stoked

biscuitpants17:09:00

thank you everyone for the help / repos / gists

dominicm18:09:15

@biscuitpants feel free to ask questions 😁

markwoodhall20:09:31

@biscuitpants I’m jealous. That was my plan for tonight also, it’s been derailed by a production issue. Booo!