Why would people want to adopt and use Vim9 instead of NeoVim, which eliminates a lot of cruft and uses Lua? Interested in knowledgeable responses from Vimmers and NeoVimmers.
VimScript isn't all that bad. I think a lot of the hate it gets here is undeserved. It's a domain-specific language, sure, but scripting an editor is a domain-specific thing. I'm not sure if Lua would really give me a massive amount of benefit for the things I write in VimScript. Performance has never been too bad of an issue, and I'm not sure if I like programming plugins in Lua more (but I haven't tried it, so I'm hesitant to "knock it 'till I try it").
Note that in my experience the biggest performance hog tends to be syntax highlighting.
Neovim changed some defaults and such, and I need to frob with my vimrc and such to spend time on it. I'm at a point in my career where I just want to build "useful stuff", and not muck about with my vimrc. For example, the default colours don't work well with my light background.
Neovim also removed encryption, which I use. Yes, I'm familiar with all the arguments for removing it and I've engaged in discussions on this in the past (so won't repeat it here): it's "good enough security" for what I use it for, and a much better UX than the alternatives. Again, more effort.
And what do I get back for it? I can't really name a single thing that would give me an immediate benefit to be honest. To be fair, I'm a "simple" user, and don't use stuff like :term and whatnot.
Also, I'm put off by the Neovim developers' attitude sometimes, things like a Neovim dev condescendingly describing VimScript2 as "BramScript" earlier today on Lobsters is ... not great, and neither is describing various disagreements as "cop outs" (e.g. t_* settings).
I’m torn by the idea of replacing vimscript with lua. I honestly enjoy both languages (vimscript is not as bad as its reputation!) but they each shine in different use-cases. Lua is more ergonomic for writing programs/plugins, but vimscript is more ergonomic for interactive use (and maybe config files, more below).
For non-vimmers, a good analogy is the shell: would you want to replace sh with a more robust language like lua? Few people seem to enjoy writing larger programs in sh, and are quick to jump to perl/python/ruby once a script crosses some complexity threshold. However, I doubt many people would want to give up sh for interactive use. Mainly[0] due to omitting “cruft” like parens/quotes/commas, and also pipe syntax. Minimal example:
ls -laht | grep foo
is nicer than
grep(ls(‘laht’), ‘foo’)
especially when you’re doing thousands of commands of varying complexity every day.
Vimscript is similar, again mainly due to omitting “cruft” like parens/quotes/commas, and also some specific sugar. Minimal examples:
iabbr cosnt const
is nicer than
iabbr(‘cosnt’, ‘const’)
and
s/foo/bar/g
is nicer than
sub(‘foo’, ‘bar’, ‘g’)
especially when you’re doing hundreds (thousands?) of commands of varying complexity every day.
Besides setting options, the vast majority of the “meat” of my config file boils down to these types of commands, and is thus much more readable with the cruft omitted, even though I only have to type it once.
This could probably be addressed with some light syntax sugar on top of lua, and I think I remember seeing some comments from the Neovim folks about this very thing, but I’m not able to find anything concrete at the moment. Does anyone know where this stands?
—
[0] Of course, another issue (for both shell-scripting and vim) is the huge amount of tools built on top of the existing language, which we may be remiss to abandon. For shells, it’s probably practically impossible. For vim, I suspect it is possible, though it would be painful enough to merit a long hard think.
I you are having your editor change "cosnt" to "const", or "isntall" to "install", you are programming your fingers to be unable to type them correctly. You will regret it, but it will be too late.
I also never want to learn a language for a single environment. With Lua and the like, I can use them in many other places, making learning them much more useful.
This is true only if what you're building is big enough.
For something like vimscript, where most people are likely to script minor stuff, the marginal cost of learning the scripting language itself is non-trivial and increases the "barrier of entry" significantly.
For minor stuff you spend most time on learing ex commands (i.e. VIM API). Also, vimscript is a rather simple language. It's not haskell, we're talking about.