vim

For discussion on all things (neo)vim.
grazfather 2021-03-10T01:58:16.019600Z

I saw somewhere that some formatter has a limit of 100 lines before it gives up trying to format a function

dharrigan 2021-03-10T08:30:14.020300Z

Yes, if you have <https://github.com/guns/vim-clojure-static> installed

dharrigan 2021-03-10T08:30:32.020700Z

There is a fork of that project, <https://github.com/clojure-vim/clojure.vim> which makes it faster and extends the limit to 300 lines

1
orestis 2021-03-10T08:37:42.021100Z

And you can extend the limit to whatever you want BTW

dharrigan 2021-03-10T08:46:01.021300Z

:thumbsup:

2021-03-10T09:16:40.022100Z

All those latest gen CPUs and GB of RAM now allow highlighting more than 300 of lines of code? 😱

dharrigan 2021-03-10T09:26:17.022300Z

Only if you're lucky...

😅 1
juhoteperi 2021-03-10T09:36:14.023700Z

Vim syntax parsing is using regexes and doesn't know about s-expressions so it is not the most efficient way to handle clojure code. (Indent code uses syntax rules to find out the form and element types etc.)

juhoteperi 2021-03-10T09:36:26.023900Z

And the indentation code is written in vimscript.

juhoteperi 2021-03-10T09:39:23.025400Z

We could perhaps implement indentation for Neovim in Lua, but might have to reimplement quite many parts to be able to move indentation logic there. But in some microbenchmarks Lua is 2000 times faster than Vimscript so it could be worth it.

Olical 2021-03-13T15:02:30.037600Z

I've been compiling fennel into Lua for all my nvim work for ages now, can recommend 😄

grazfather 2021-03-14T15:42:55.040800Z

Do you have your workflow documented? Or do you compile to lua and then just provide that to nvim

Olical 2021-03-23T09:22:24.010100Z

https://github.com/Olical/aniseed all here

grazfather 2021-03-23T13:37:46.010400Z

Thank you 🙂

grazfather 2021-03-23T13:37:56.010600Z

clever name

orestis 2021-03-10T12:21:53.026300Z

@juhoteperi I think NeoVim 0.5 brings treesitter precisely for this, right? In the sense that the treesitter parser will expose a low-level AST (even for malformed code, apparently) that you can them manipulate for indentation etc.

orestis 2021-03-10T12:22:16.026700Z

@dev964 highlighting is still wonky, but formattingindenting is possible 🙂

juhoteperi 2021-03-10T12:22:40.027300Z

I guess so. I haven't yet looked how well that will work with Clojure.

juhoteperi 2021-03-10T12:23:04.027900Z

How is the treesitter impl for Clojure implemented?

orestis 2021-03-10T12:23:15.028200Z

I have clojure-treesitter running here but haven't bothered to use it for anything (even highlighting) because I ran out of steam 😉

orestis 2021-03-10T12:23:38.028400Z

Here's what used: https://github.com/sogaiu/tree-sitter-clojure

juhoteperi 2021-03-10T12:24:44.028900Z

Some JS, some C and JS is compiled to WebAssembly? Seems really complicated.

orestis 2021-03-10T12:25:29.029700Z

That's a treesitter requirement. It's targeting C. NeoVim bundles all this internally somehow, or at least can auto-install the binaries for you.

2021-03-10T13:34:03.030400Z

tbh, sorry for a snarky comment - it wasn’t meant to target speciffically clojure highlighting or even vim - just computing in general

2021-03-10T13:34:41.030900Z

and yes, from what I understand tree-sitter is just around the corner 🙂