README.md

April 24, 2026 · View on GitHub

Neovim configuration

A minimal Neovim configuration written in lua

License Stars Neovim version Latest release


Table of contents

Important

I’m currently trying to switch to using leanpack.nvim instead of lazy.nvim. This is a Neovim plugin manager built on top of vim.pack (Neovim ≥ 0.12.0). You can try it out on the branch feat/leanpack.nvim; until leanpack.nvim is fully mature, lazy.nvim will continue to be used as the main plugin manager.

1. Introduction

Neovim is a pretty cool successor to Vim, focusing on compatibility while adding asynchronous plugin functionality and trying to clean up the code base. Having been fed up at various times with both Sublime Text (2 and 3) and Atom, and after realizing how much development I do over SSH, it seemed reasonable to check out using vim (or nvim, in this case) as my IDE. The advantages essentially boil down to:

  • Consistent IDE over SSH or locally,
  • No need to ever use the mouse while coding (takes longer to learn, but is faster; this is aided by vim-easymotion and Ctrl-Space),
  • It’s been around forever, and frankly, probably always will be.

Therefore, I decided to create this repository.

Note

  1. There are several versions, checkout CHANGELOG.
  2. This configuration is meant as a starting point, and it fits my needs only. If you want to customize it, jump to 6. Customization.

2. Screenshots

darkdark
darkdark
darkdark
darkdark

3. Installation

mv ~/.config/nvim ~/.config/nvim.bak
  • Neovim's configurations are located under the following paths, depending on your OS:
OSPATH
Linux, MacOS$XDG_CONFIG_HOME/nvim, ~/.config/nvim
Windows (cmd)%localappdata%\nvim\
Windows (powershell)$env:LOCALAPPDATA\nvim\
  • Fork this repo so that you have your own copy that you can modify, then install by cloning the fork to your machine using one of the commands below, depending on your OS.

Note

Your fork's url will be something like this: https://github.com/<your_github_username>/neovim-config.git

  • Get your configuration:

Note

If following the recommended step above (i.e., forking the repo), replace ntk148v with <your_github_username> in the commands below

Linux and Mac
git clone https://github.com/ntk148v/neovim-config.git "${XDG_CONFIG_HOME:-$HOME/.config}"/nvim
Windows

If you're using cmd.exe:

git clone https://github.com/ntk148v/neovim-config.git "%localappdata%\nvim"

If you're using powershell.exe

git clone https://github.com/ntk148v/neovim-config.git "${env:LOCALAPPDATA}\nvim"
  • Start Neovim, Lazy should be installed automatically, then it will install plugins.
nvim
  • Restart Neovim and enjoy it.
  • Keep updated: You should keep updated using git pull.

4. File structure

The files under config will be automatically loaded at the appropriate time, so you don't need to require those files manually.

tree ~/.config/nvim
├── init.lua
├── lazy-lock.json
└── lua
    ├── autocmds.lua
    ├── custom.lua
    ├── mappings.lua
    ├── options.lua
    ├── plugins
    │   ├── configs
    │   │   ├── cmp.lua
    │   │   ├── gitsigns.lua
    │   │   ├── lspconfig.lua
    │   │   ├── lualine.lua
    │   │   ├── luasnip.lua
    │   │   ├── mason.lua
    │   │   ├── mini-files.lua
    │   │   ├── null-ls.lua
    │   │   └── treesitter.lua
    │   └── init.lua
    └── sample_custom.lua

5. Plugins & LSP

5.1. Plugins

PluginDescription
lazy.nvimA modern plugin manager for Neovim
mason.nvimPortable package manager for Neovim that runs everywhere Neovim runs. Easily install and manage LSP servers, DAP servers, linters, and formatters.
nvim-lspconfigA collection of common configurations for Neovim's built-in language server client
gitsignsSuper fast git decorations implemented purely in lua/teal
nvim-treesitterNvim Treesitter configurations and abstraction layer
blink.cmpPerformant, batteries-included completion plugin
LuaSnipSnippet Engine for Neovim written in Lua
nvim-autopairsA super powerful autopairs for Neovim
nvim-web-deviconsLua fork of vim-web-devicons for neovim
lualine.nvimA blazing fast and easy to configure neovim statusline plugin written in pure lua.
norcalli/nvim-colorizer.luaThe fastest Neovim colorizer.
nvim-mini/mini.pickFast and minimal fuzzy picker.
nvim-mini/mini.extraExtra pickers for mini.pick.
rosé-pineSoho vibes for Neovim
nvimtools/none-ls.nvimnull-ls.nvim reloaded / Use Neovim as a language server to inject LSP diagnostics, code actions, and more via Lua.
folke/which-key.nvimCreate key bindings that stick. WhichKey helps you remember your Neovim keymaps, by showing available keybindings in a popup as you type.
nvim-mini/mini.filesNavigate and manipulate file system. Part of 'mini.nvim' library.
nvim-mini/mini.miscAbout Neovim Lua plugin with miscellaneous useful functions. Part of 'mini.nvim' library.

5.2. LSP

By default, the follow LSP servers are installed and configured:

Furthermore, it integrates with nvim-treesitter to provide rich syntax highlighting and other language parsing magic.

If your language is not supported, please follow this:

  • Check if LSP support is available in the lspconfig repo. To install a supported language server with mason:
:LspInstall `<your_language_server>`
  • Check if your syntax is supported in the treesitter repo. To install a language syntax highlight, run:
:TSInstall `<language_to_install>`

You can add more LSP servers and language syntax highlighting by editing the custom file.

6. Keymaps

These are the default keymaps, in the following shortcuts, the <leader>+` key is set up to `` (space) character, check: keymaps.lua.

ShortcutModeDescription
kkInsertEsc with kk
rrNormalReload configuration file
ttNormalCreate terminal
<leader>+fmNormalOpen mini.files (Directory of the current files)
<leader>+fMNormalOpen mini.files (cwd)
<leader>+shNormalOpen mini.pick to search help
<leader>+skNormalOpen mini.pick to search keymaps
<leader>+sfNormalOpen mini.pick to search files
<leader>+sgNormalOpen mini.pick to search by live grep
<leader>+sdNormalOpen mini.pick to search diagnostics
<leader>+srNormalOpen mini.pick to resume last picker
<leader>+s.NormalOpen mini.pick to search recent files
<leader>+<leader>NormalOpen mini.pick to search existing buffers
<leader>+scNormalOpen mini.pick to list git commits
<leader>+/NormalFuzzily search in current buffer
<leader>+snNormalSearch Neovim config files
<leader>+wh/j/k/lNormalMove around splits
mmNormalComment/Uncomment line

There are many default keymaps, you can check it using :map command. There are also other variants:

  • :nmap for normal mode mappings
  • :vmap for visual mode mappings
  • :imap for insert mode mappings

The above list is not complete. Typing :help map in Vim will give you more info.

7. Customization

You can customize this configuration by creating the custom module. You can choose either two ways:

  • Create ${XDG_CONFIG_HOME:-$HOME/.config}/nvim/lua/custom.lua file.
  • Create module ${XDG_CONFIG_HOME:-$HOME/.config}/nvim/lua/custom/ if your custom configuration is too long, and you want to separate it into multiple files.

Checkout the sample custom file for the starting point. The logic is taken from CyberNvim. There are a number of defined sections in the config:

  • M.setup_sources is used to add extra sources to connect to Null-ls - you can find a list of sources here. The parameter b is just short for null_ls.builtins.
  • M.treesitter_parsers is used to add extra Treesitter highlighter. Actually, you don't need this, the current config will automatically detect file type and download the treesitter parser.
  • M.plugins is where you will add your own plugin definitions.
  • M.configs is the most important section of your own configuration. This is where you can define any autocommands, require any files, or otherwise completely port your current configuration.
  • M.formatting_servers is used to setup auto formatting rules. You need to select the language server that will provide autoformatting capabilities

8. Contribution

Feel free to file an issue or open a pull request. You're welcome!

9. Guide and resources

 

Copyright © 2022-present Kien Nguyen Tuan