Note: This site is currently "Under construction". I'm migrating to a new version of my site building software. Lots of things are in a state of disrepair as a result (for example, footnote links aren't working). It's all part of the process of building in public. Most things should still be readable though.

Save A Neovim File Buffer With Lua

I've got a Lua process that makes updates to note files that I want saved as soon as it's done. I haven't a found much out there that answers how to do that. After a little experimentaiton I starte using:

Code

vim.cmd("w")

Bascially just punting out to the vim command.

Seems weird, but it's working.