vim

Chase 2025-01-22T20:21:12.134829Z

As an old neovim convert I had still been avoiding converting my little 300 line init.vim to init.lua out of laziness but finally just asked claude to do it. Pretty darn painless including updating to some of the more shiny things like lazy.nvim over vim-plug as the main reason I finally did this is some of the newer plugins were not working well when trying to convert their lazy.nvim lua configs over to viml It didn't quite get everything converted over immediately but then I asked o1 to find the gaps between the two configs and got it all sorted out.

🎉 2
practicalli-johnny 2025-01-23T11:04:53.143049Z

In basic terms, It makes parsing text highly efficient, enabling very fast manipulation of text programmatically. So Treesitter can be used by neovim plugins for the same benefit. Accuracy should also be far greater than more general text parsing tools also.

Chase 2025-01-23T14:51:19.446389Z

Fair enough. Now is as good a time as ever I suppose to give it a shot. The last time I looked you had to patch together a few different plugins to get the same functionality as coc.nvim so we shall see how it goes

Chase 2025-01-23T15:57:18.111819Z

Ok yeah, another easy transition with claude . I think I'm liking this. my init.lua has ballooned up to over 500 lines but even if it's just a placebo it all feels more modern lol

practicalli-johnny 2025-01-24T01:06:54.483499Z

My init.lua has 19 lines as the https://github.com/practicalli/astro is organised logically into files & directories (approach borrowed from AstroNvim and other shared configs I experimented with).

Chase 2025-01-24T01:47:40.340649Z

Yep, I get that. Since it's just for me I actually prefer just rolling with the one file. This is working nice so far. I had to update some plugins like a new rainbow parens one to work well with treesitter but I think I have feature parity overall and even improved a couple things

Chase 2025-01-22T20:22:08.139609Z

We shall see if it was really worth it but I was able to try things like avante.nvim (not sold on it yet but cool nonetheless) much more easily

Chase 2025-01-22T20:22:42.644979Z

Now the debate on whether to go full treesitter, internal lsp client, etc. versus just sticking with coc.nvim

practicalli-johnny 2025-01-23T02:07:11.843529Z

There was no debate for me as Treesitter and the native LSP client were the main features that convinced me to adopt Neovim,

Chase 2025-01-23T03:07:14.795959Z

Interesting. So what exactly does treesitter get you?

martinklepsch 2025-01-27T13:15:32.014179Z

I've gone through a similar process now and it was relatively painless. I tried https://cline.bot/ (a VS Code extension that needs an API key) as a Cursor alternative to do it and it made a plan which we then executed step by step, testing if things are working along the way. It told me a few nice keybindings along the way and overall did a pretty good job. The code organization doesn't feel great yet, but I think if I had a well-organized sample repo it could probably replicate that. Overall the config ballooned from ~90 lines to 300 but I'm ok with that, probably some of it could be removed as well. Ah, one thing that was interesting with Cline is that it counts tokens so now I can tell you that it cost me 1.34$ to modernize my nvim config 😄

Chase 2025-01-27T18:55:50.844459Z

Very nice. Just another warning, throughout the week as I've been doing actual development work, I keep finding small little differences that need tweaking. Not a big deal and the LLMs still pinpoint the necessary changes quite easily. Plus maybe I just have an eccentric, nitpicky setup, but I wouldn't consider yourself quite "finished" yet but are our configs ever truly so anyways hahaha

martinklepsch 2025-01-24T11:00:04.203649Z

I was just about to do this as well, did you put any effort into the prompt? Please share 🙂

Chase 2025-01-24T14:32:04.572459Z

Nope, no effort into it, literally just said I want to convert my old init.vim to a modern init.lua version and gave it the vim file. Here is a gist showing the two and you should be able to see the general pattern of conversion: https://gist.github.com/chase-lambert/36feeaf0a43721a40932f390d627d4b9 It is the one that took it upon itself to switch to lazy.nvim (probably the modernizing part). The caveat being I should have put more effort at first because it did involve a conversation but what doesn't with these things. Mostly it didn't copy over everything for some reason. What helped there was asking another llm (o1 vs claude which was doing the actual conversion) to look over the two and find the gaps. Also it skipped over anything I had commented out (but still like to keep in my config in case I change my mind some day and don't want to redo setting things up). The other issues were that it hadn't quite captured some of the nuances of my setup, like how to handle and display warnings and errors, how to handle autocomplete, and other little configurable items. These were all able to be sorted out fairly easily though. And as I mentioned, when going even further and switching to the built in lsp/treesitter, etc. I had to switch a couple of other plugins for more appropriate ones also using those newer things.

Chase 2025-01-24T14:33:37.209169Z

So build a prompt preempting some of those issues and it should be even easier for ya

❤️ 1