This is my config for Neovim 0.11. It uses lazy.nvim to manage plugins.
nvim
├── init.lua // Entry point for the configuration. Automatically sourced by Neovim.
├── lazy-lock.json // Lockfile of lazy.nvim plugins.
└── lua // Not automatically sourced, but require()'d by `init.lua`.
└── peter // All of my config is namespaced under `peter` to prevent potential name clashes.
├── config // Configuration of built-in Neovim functionality.
├── lib // Contains functions/modules that are used throughout the config.
└── plugins // Plugin configuration, loaded by lazy.nvim.
When running nvim for the first time after applying this configuration, it will bootstrap lazy.nvim using git clone, then it will proceed to install all the plugins in the configuration. You should make sure all the plugin requirements have been installed before using them.
At the root of this repository, there is a justfile containing tasks for managing Neovim's plugins and configuration. You can install just to run these tasks. Running just without any arguments will print a list of tasks in the justfile.
Running just restore will install/update all the plugins so that they match the lazy-lock.json lockfile. Running just clean will remove any plugins that are no longer in the configuration. You can also manage plugins using the lazy.nvim GUI (:Lazy) within Neovim.
When editing files in the chezmoi source directory (~/.local/share/chezmoi/), I have configured Neovim to automatically run chezmoi apply on save (See peter/config/chezmoi.lua). However, to apply the Neovim configuration from the command line, use just apply, which applies the Neovim configuration to ~/.config/nvim/ ensuring that files that have been deleted from the chezmoi source directory also get deleted (which chezmoi apply doesn't do by default).
Below are the requirements for the plugins in my config. Running :checkhealth can also show you what is needed by the plugins.
| Name | Reason |
|---|---|
git, tar, and curl |
Used by lazy.nvim and others for fetching and installing plugins and binaries. |
| A Nerd Font | Required so we can draw fancy icons and shapes. (I like the Nerd Font of Commit Mono) |
A C Compiler (e.g. gcc) and tree-sitter |
Needed by nvim-treesitter to install the parsers. See their README for more. |
fzf, rg, and fd |
Used by fzf-lua and others for fast file searching. |
LSPs and other tools must be installed before using them with Neovim. In general, to install tools for a language, you will need a package manager for that language (e.g. cargo, uv, pnpm). However, you can use a holistic solution like mise or nix to do tool installation across multiple languages consistently.
Each language is configured to use the LSPs/Tools listed below, and these should be installed in order to get the full editor functionality. At a minimum, you should install the tools for Lua to make editing Neovim's configuration easier.
| Language | Tools |
|---|---|
| Lua | lua-language-server and stylua |
| Rust | rust-analyzer and rustfmt |
| Python | basedpyright and ruff |
| TypeScript (and JavaScript) | prettier (Note that the typescript binary comes with the tsserver 'LSP') |
| Typst | tinymist |
Other useful tools to install are: