Lua

I’ve liked the idea of the Lua programming language since reading about it in Coding Places: Software Practice in a South American City. After reading that book, I put some effort into learning a bit of Lua syntax, but never really followed up beyond that. It seemed potentially useful but I didn’t really have the use case to pursue it much further.

Elsewhere, I’ve also posted about my enthusiasm for vim and neovim. One of the big advantages of switching from vim to neovim is that you can write your configuration files in Lua. Indeed, I’ve noticed an increasing portion the online conversation about neovim configuration has moved to Lua, and away from its predecessor, vimscript.

Anyhow, my old, vimscript-based config was not that complicated, clocking in at 30 lines. I figured that an afternoon comfortably ensconced on a west-facing deck would be enough time to make the migration from vimscript to Lua, so today I tackled the problem. It was a good exercise: the revised Lua version is more concise than its predecessor, at 18 lines. It also resolved a few (admittedly very minor) problems I was having with the vimscript version. But it’s also much more readable than vimscript, and I’m hoping that it will be easier to work with in the future.

This entry was posted in lua, vim. Bookmark the permalink. Both comments and trackbacks are currently closed.
  • Subscribe to this blog

Skip to toolbar