Neovim for Beginners — init.lua

Let’s start our journey to customize Neovim.

5 min readDec 27, 2021


Neovim for Beginners — init.lua

Let’s configure Neovim using aninit.lua file.

This article is part of the Neovim for Beginners series.

We are going to

  • Create an isolated configuration environment for Neovim by leveraging the XDC_CONFIG_HOME and XDG_DATA_HOME variables (:h xdg).
  • Using packer.nvim as the plugin manager to install plugins.
  • Configure a color scheme, startup screen, and Git.
  • Configure basic default values by using the runtimepath (:h rtp).
  • Configure a ftplugin for Lua files (:h ftplugin).

Check out the Modern Neovim series to configure a modern personalized development environment (PDE) with Neovim using the lazy.nvim plugin manager.

Table of Content

· Isolated Neovim Configuration Environment
Folder Structure
· init.lua
· plugins.lua
· Lua-based Configuration
Startup Screen
· Default Settings
· File Type Plugin for Lua
· Uninstallation
· Start nvb in a New Terminal
· References

Isolated Neovim Configuration Environment

Let’s start by creating an isolated environment for our Neovim configuration so it does not mess up any current configuration.

You can find the Neovim configuration in this repository.

  • git clone the repository to any folder.
  • Check out to “01-init.lua” branch.
  • Source the script by running source ./ (Note: DO NOT run the script directly. The script needs to create an alias in the current shell).
  • Run nvb to start Neovim.
  • All the plugins, including packer.nvim, should get installed automatically.
  • Quit Neovim, and restart it using thenvb




Software engineer, Data Science and ML practitioner.