Fork me on GitHub
#vim
<
2021-03-10
>
grazfather01:03:16

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

dharrigan08:03:14

Yes, if you have installed

dharrigan08:03:32

There is a fork of that project, which makes it faster and extends the limit to 300 lines

thanks3 3
orestis08:03:42

And you can extend the limit to whatever you want BTW

Aleksander09:03:40

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

dharrigan09:03:17

Only if you're lucky...

😅 3
juhoteperi09:03:14

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.)

juhoteperi09:03:26

And the indentation code is written in vimscript.

juhoteperi09:03:23

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.

grazfather13:03:51

Damn. Maybe they should add Fennel support, for us :)

Olical15:03:30

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

grazfather15:03:55

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

grazfather13:03:46

Thank you 🙂

orestis12:03:53

@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.

orestis12:03:16

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

juhoteperi12:03:40

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

juhoteperi12:03:04

How is the treesitter impl for Clojure implemented?

orestis12:03:15

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

juhoteperi12:03:44

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

orestis12:03:29

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.

Aleksander13:03:03

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

Aleksander13:03:41

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