

With our little introduction to the optional Lua runtime taken care of, lets check out the how to configure Neovim keybindings with Lua. And my fellow Windows users out there, you should check for the Lua files at %LOCALAPPDATA%\nvim\lua.įor more info on where to place the config files, check out the “ Where to put Lua files” section of the Neovim-Lua Guide on GitHub.

So, for Linux users out there, check if your OS follows the XDG Base Directory specification, then the Lua files should be usually available at: $HOME/.config/nvim/lua. And Neovim will source everything inside that directory when invoked.ĭo note, the location to the Neovim runtimepath varies depending on the choice of your OS. lua extensions) are placed inside a directory aptly named lua. The programmatic access to the API & the Lua runtime means you can let your imaginations go wild if you so desire.Īnd just so you know, like any other config files used to hack Neovim/Vim, the Lua code also needs to be placed in the runtimepath ( see “ :h rtp ” for more info). One such feature that makes Neovim stand out is it’s builtin API. That said, Neovim was released with a set of some useful features. Having some idea of it will help better understand the how’s & what’s possible to create. Introducing the Optional Lua Runtimeīefore we proceed further into the article, let’s briefly introduce the Lua runtime in Neovim. And towards the end of it all, we’ll suggest further resources you might want to take a look at to learn about Neovim’s Lua runtime better. The rest of the article starts with a brief intro to the optional Lua runtime, followed by creating a Lua function for mapping the custom keybinds. If that piqued your interests & you would like continue learning about how creating custom keybinds in Neovim is a much pleasant experience, then read ahead. But feel free to refer to this amazing Neovim-Lua Guide on GitHub for a quick reference.

We’ll not discuss how to write Lua code within Vimscript since it’s beyond the scope of this article. The optional Lua runtime also backwards compatible meaning you could still try out the optional runtime right from within Vimscript.
#LUA MAXSNAP UPDATE#
Fortunately, Neovim v0.5+ gave the community a significant update to play around with & that’s the inbuilt Lua runtime. Also for many of you, the time investment & efforts required to pickup a redundant programming language mightn’t be productive either. It’s not the most elegant language out there & neither has it any use outside of Vim. Vim users are also required to have working knowledge of Vimscript ( which is a scripting language built for Vim configuration). As such, only your imagination is the limit to what you could possibly create using custom keybindings. And if you’ve used Vim before, you should be aware of what’s possible through custom Vim keybindings as well.įor the uninitiated, Vim’s openness towards creating custom keybindings has pretty much no competition out there. The ability to create custom keybindings & do pretty much anything is testament to Vim’s popularity.
#LUA MAXSNAP SOFTWARE#
Neovim ( or even Vim) is an excellent piece of software for any developers out there. Start using Lua to configure Neovim & protect your sanity as well (image credit: Somraj Saha)
