vim

2024-02-10T16:09:10.244509Z

I converted my neovim config from lua to fennel and it’s very slick 🧵

🎉 3
Adam Helins 2024-02-21T10:25:09.622589Z

Very slick indeed! Kudos to @olical who is turning Nvim into an editor that can surpass Emacs in terms of extensibility. That's a pretty high bar to cross!

☝️ 1
Sigve 2024-02-12T09:03:21.364169Z

Cool, i am in the process of trying to convert my config to fennel as well. I really like the concept, but i have ~10 years of accumulated config i want to port and i am finding it a bit of a pain. Especially tracing errors on startup from the lua files back to the fennel source can be very annoying

Oliver Marshall 2024-02-12T13:40:02.997179Z

@nbtheduke Do you have a link to your config? I've considered it myself, but it didn't seem worth it just to have more lisp in my life 😅

2024-02-12T14:25:20.100469Z

lol they're messy but here they are: https://github.com/noahtheduke/dotfiles

Sigve 2024-02-12T14:28:18.301659Z

Can also recommend https://github.com/rafaeldelboni/cajus-nfnl/ as a good starting point

❤️ 1
👆 2
2024-02-12T14:30:31.857789Z

that's got a lot of the same stuff i use. i find it hard to recommend pre-built configurations as i like to know how all of the pieces fit together and make informed decisions about each one

➕ 1
2024-02-12T14:30:48.969659Z

nfnl is really really nice. i liked aniseed but nfnl is just better

Sigve 2024-02-12T14:32:01.502839Z

I agree 🙂 What i meant to say is that it is a good good starting point for understanding how to setup a config in fennel using nfnl, as the documentation in nfnl itself is lacking

👍 1
emilaasa 2024-02-13T15:09:46.177519Z

I ended up liking having most of the configuration in Lua, and then some user defined functions in Fennel. Copy pasting Lua snippets from github repos was too convenient 🙂

👍 4
2024-02-13T15:15:51.544469Z

Yeah, that's a really nice positive. Using nfnl makes writing them side by side really easy.

Oliver Marshall 2024-02-19T09:29:17.593259Z

I ended up spending some time converting my config to fennel too, I have to say I like it. Much easier for me to hack on somehow 🤔

Oliver Marshall 2024-02-19T09:31:03.735179Z

There's also this tool which you can convert lua <-> fennel: https://fennel-lang.org/see It might need a refactor, but it's an easy way to get something working quickly 😄

👍 2
2024-02-10T16:09:43.517249Z

However, the primary tree-sitter grammar for fennel doesn’t just parse the forms (list, number, table, symbol, etc), it parses the special forms too, so the ast isn’t (list (symbol “fn”) (symbol “plus”) (seq_table …)), it’s (fn name: (symbol “foo”) (parameters (binding …)))

2024-02-10T16:09:51.361739Z

That’s cool for taking lexical scope from TS, but it makes it impossible to do s-expression manipulation with paredit-like tools

fuad 2024-02-10T16:43:30.456499Z

Could you give an example of a problem you had with s-expressions? I've been using the vim-sexp lua implementation and don't recall facing any challenges with fennel.

2024-02-10T17:14:46.768929Z

I use nvim-paredit which is treesitter based, vs vim-sexp which uses syntax highlighting to determine stuff

fuad 2024-02-10T17:18:03.110549Z

Interesting! The one I use has a similar name and it's also implemented using tree sitter. Perhaps they're doing something different https://github.com/PaterJason/nvim-treesitter-sexp

2024-02-10T17:20:27.152879Z

Hmmm! I’ll look at that

2024-02-10T17:56:44.528009Z

Oh i see, they’re relying on custom queries for each language, that’s clever. I’m pretty tied to nvim-paredit (I have a bunch of custom mappings and functions), but maybe using custom queries is an easier path than forking tree-sitter-fennel lol

💡 1
markx 2024-02-17T01:08:03.463769Z

Yeah I thought about doing it but eventually gave up, because I don't see enough benefit from it - most of my config is just copied from github anyway.

Pagoda 5B 2024-02-20T18:18:46.267499Z

Seems like a joke but nowadays chatgpt can help you converting from lua to fennel if you guide it a bit