Let me be the first to say “finally!”. I’ve always struggled with Vimscript’s various weird quirks and all the different types of things. I’d much rather use Lua even if it’s mostly to string-concat together Vimscript snippets — at least I’ll be able to feel confident about how variables and functions work. The augroup example function delivered great inner peace. Thanks for the clear write-up. I also enjoyed the fun tone.
Thank you! You’ve described my sentiments quite precisely. Exactly why I jumped ship to Lua even though it’s kind of half-baked right now.
I absolutely agree; Lua (even in its incomplete form) has been a game changer for me in writing plugins and customizing Neovim. Yes, you can do everything that you can do in Lua in Vimscript, but the performance and ergonomics improvements make a substantial difference (in my experience).
I went step further with using Fennel for my NeoVim configuration
Oh wow I’m surprised at how well this works! Reminds me a lot about configuring emacs, I like it
Is anyone else holding off from using the new lua hotness because they’re hesitant to move their neovim config further away from what vim supports? I have no intention (right now) of moving off neovim and back to vim, but the loss of compatibility is leaving me with second thoughts about whether it’s worth it.
I moved to neovim fulltime a couple years ago, and so far have never opened plain vim except by accident. A completely seamless transition, in my anecdotal experience. I do mostly web application programming with it, YMMV.
Initially I had this same hesitation regarding many Neovim things, such as Neovim only plugins. But what’s the point of having nice things if you don’t actually use them? At this point I’ve been on Neovim for three or four years and haven’t had any regrets.
If I go back to vim, or any other editor, I’ll view that as an opportunity to rebuild my config from scratch or near scratch - I find it a good way to clean up unused plugins, settings, themes etc and also a forcing function to discover new plugins and workflows.
FWIW, you can shorten the last 2 lines in mode() to the following idiom: return mode_map[m] or m.
return mode_map[m] or m
wow, that looks great. I’m surprised by how clean and straightforward it is.
Heh, neat. Thanks.