I get the impression that the Elixir community at large is using nvim, though it occurred to me that I don’t actually know this so I thought I would ask here to get some sort of better idea. I’m thinking of offering to take over as maintainer of elixir.vim so it’s useful info for me—though I still haven’t decided if learning that lots of people still use Vim means I’d want to or not want to do this
I’m also on a bit of a Vim config kick right now (happens about once per year) and fixing some long-standing grievances I’ve had with elixir.vim, so let me know if there is anything you’d like me to look at. I’d even be up for pairing if anyone is into that.
Just to provide a data point: I’m all in on Neovim. I’m not even sure when I removed elixir.vim, but it’s not in my list of plugins anymore and everything is working great.
I recently switched from VSCode to nvim + nvchad. Honestly, I have no idea what is the difference between vi/vim/nvim, I would guess some breaking changes configuration wise?
I guess the question would be: why someone would use vim instead of newer nvim?
I really like my setup in vim and I haven’t been able to recreate it in neovim(I’m sure it’s possible but I find the configuration for nvim really confusing and I’m not willing to invest days in learning it) so I haven’t switched. Neovim has a lot of cool stuff I’d like to use but I’m just so comfortable that I can’t be bothered.
That’s a legit question but off topic from what I’m looking for. Lots of people still use Vim and I’m just wondering how many in the Elixir community still do.
In very short (though not the whole story), Vim has been my sole editor for the past 15 years. I’ve tried to switch to nvim a couple of times (once recently) but felt no huge advantage to it over Vim. If you’re coming in fresh, nvim is quicker (from what I understand) to get up to speed if you’re looking for an IDE-like experience.
So that is without a doubt been the biggest thorn in my side and what I’ve been working on. I have a draft PR open and is mostly there but I want to use keep using it for a few days. It would be great if you could try it out and give me feedback!
Ya, I tried disabling but I couldn’t deal with that, so I did some forced little syntax things to make it more bearable. It was fine so long as I was working alone but now that I’m working on a team in a LiveView-heavy codebase that has some monster render functions, I can’t do those things. So I that pushed me over the edge to fix it as it was pretty much affecting job performance.
I’m going to sit with it for a couple of days then un-draft the PR. The only thing I’m currently aware of is that tuple delimiters get highlighted as heex attribute delimiters. Also, the end in <% end %> doesn’t get highlighted. This are hardly issues compared to what’s there now but I’m still going to try and fix it. Let me know if you run into anything!
The other thing that is driving me nuts is that indentation gets messed up if you are under a render function that has some <%= %> in with do/end constructs, but that’s a different fix.
The reason I never tried nvim is because when it was launched I was already deep in vim, and there was nothing I missed from vim. I love lua though, it was written by a former teacher and the guy is cool…I might give it a try just because of lua.
I will try the fixes later. Thanks a lot for the work.
Happy Vim user. Have thought about changing to Neovim or Helix a few times but I’ve never been convinced the payoff for the time investment to relearn and reimplement workflows would be worth it for me.
I love Roberto’s talks—very cool he was your teacher! I’ve never met him myself but he has this super personal and unassuming vibe and yet his clarity of thought behind Lua’s design is so on point. Hearing him talk about it made me see the language in a whole new light.
For me I already know vimscript very well so Lua itself isn’t enough to jump ship. I generally like DSLs so there is no interoping with vimscript needed if you’re already using it. Vim9script also solves a lot of the speed issues (when they matter). And of course there are still more reasons I don’t switch. The only reason I tried recently was that it seems the bulk of the Elixir community uses nvim, but I’ve decided to stay put and try and fix what’s bugging me.
If anyone’s on a Mac you might want to check out MacVim, it can look quite nice with some tweaks (scroll to bottom of this blog post for details, and this old post might also be of interest).
As mentioned my biggest problem has been embedded HEEx highlighting which I’ve mostly gotten fixed pending merge! Do you have another solution to that or just live with it or use nvim? There are also weird indentation things as well that drive me a little nuts but have been livable since I (usually) always format on commit. I’d like to fix them, though.
I’d also love to see a new phoenix.vim that has extensions to projectionist like rails.vim does. I really miss context-aware :R to jump from controller action to template especially now that I’m working on some non-LiveViews a bit more often.
I don’t… but it’s nice to see you working on it! I’d love to see a (std) Vim distribution like Janus put together by the Elixir/Erlang community - is there one?
None exists that I know of, but I also an unaware of a lot. It would certainly be nice
to have a such a thing. One problem I have with elixir.vim is that it contains a bit too much that reaches outside of what a vim language file should. For example, it has integration with dadbod and technically it shouldn’t even be aware of Surface. While these things are useful to a lot of people, they aren’t useful for everyone using Elixir and would like do better in something like what you’re describing.
My contrarian theory is that at this point it seems that anyone who wants an out-of-the-box Vim experience just goes with nvim. There is such an Elixir plugin there in elixirtools.nvim. Perhaps the elixir.vim repo could just host a good wiki on common configurations for Elixir?
I haven’t given this a ton of thought or anything. An elixir-tools.vim would certainly not be a bad thing.
Another data point: I switched from Vim to Neovim a few years ago. I’ve become a big fan of Lua - it’s a nice language and it’s good to learn tech that can be used in other contexts. Incidentally there is a nice implementation of Lua for Erlang called Luerl.
Ha, hey Andy! Oddly enough I was just looking at what it would take to extend this.
I certainly don’t discount this, but Lua doesn’t shield you from much of the quirkiness of scripting Vim. You still need to make plenty of vim.api/vim.cmd/etc calls, etc and in the end you are still learning the non-transferable skill of scripting one specific editor. I was totally happy to learn a language tailor-made for that purpose. It’s kind of like how JavaScript is a super powerful DOM manipulation DSL, but no one in their right mind would want it on the server Don’t get me wrong, I would never call VimL a “good” language, but I don’t get fussed about its oddness, and I like that you’re literally programming in Vim commands.
Now, having done a bunch of work on syntax highlighting and indentation would I prefer treesitter? Yes, yes I probably would.