Settings

Theme

The influence of Neovim on Vim development

old.reddit.com

7 points by imran0 3 years ago · 2 comments

Reader

Normille 3 years ago

I've been using Neovim for several years now. Not for any real reason, other than "Let's try 'new & shiny'" when it first emerged.

Last week I thought I'd finally get round to converting my existing Neovim init.vim config [which had itself been inherited and developed from my earlier Vim .vimrc one] to Lua [not a language I'd ever used before. But the syntax looked fairly straightforward].

What a waste of time! The easy stuff [enabling/disabling various options] was easy. But then it's easy in Vimscript too. The difficult stuff [defining autocmds, managing my plugins] was either completely ignored in every single "convert your init.vim to to init.lua" tutorial I read... or required wrapping the existing Vimscript block in

  vim.cmd[[ ... ]]
in Lua because Neovim's Lua support can't yet do a lot of this stuff natively. Oh, and this also had the brilliant side-effect of removing syntax highlighting from great swathes of my config file as everything inside vim.cmd[[ ... ]] is rendered as a comment.

I spent the best part of a day wrestling with converting to init.lua, left it overnight and then, in the morning thought Why the fuck am I wasting time trying to beat this into shape, when my existing vim.init is already set up exactly how I want it?" and I reverted back to good ol' crusty ol' unfashionable Vimscript.

YMMV if you're actively developing plugins and want to use a more widely utilised language to write them in. But for configuring Neovim itself, Lua is more hassle than it's worth.

  • imran0OP 3 years ago

    > Neovim's Lua support can't yet do a lot of this stuff natively

    That's the reason a DSL is usually better in these cases; I've used lua for scripting game engines before but I don't think it's a good choice for a text editor, especially an established one like vim.

    If you use anything more complicated than toggling settings and autocmd's in your vimrc, I suggest you take a look at `vim9script`, it really is an enormous improvement.

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection