The integration of Lua as a first-class language inside Neovim is shaping up to be one of its killer features. However, the amount of teaching materia

nanotee / nvim-lua-guide

submited by
Style Pass
2021-08-16 09:30:10

The integration of Lua as a first-class language inside Neovim is shaping up to be one of its killer features. However, the amount of teaching material for learning how to write plugins in Lua is not as large as what you would find for writing them in Vimscript. This is an attempt at providing some basic information to get people started.

It should also be noted that Lua is a very clean and simple language. It is easy to learn, especially if you have experience with similar scripting languages like JavaScript. You may already know more Lua than you realise!

A few tutorials have already been written to help people write plugins in Lua. Some of them helped quite a bit when writing this guide. Many thanks to their authors.

Note: init.lua is of course completely optional. Support for init.vim is not going away and is still a valid option for configuration. Do keep in mind that some features are not 100% exposed to Lua yet.

Lua modules are found inside a lua/ folder in your 'runtimepath' (for most users, this will mean ~/.config/nvim/lua on *nix systems and ~/AppData/Local/nvim/lua on Windows). You can require() files in this folder as Lua modules.

Leave a Comment
Related Posts