sua

Neovim (September 2025)

Repositories

My Neovim configuration is currently in two places: nvim and nixvim. Both of these configurations were heavily inspired by kickstart.nvim, a minimal starting point for Neovim with sensible out-of-the-box configurations and detailed documentation. The idea is that kickstart will give you the tools to build your own configuration, rather than providing everything like a distribution would (see LazyVim for example).

I have mainly been using the nixvim configuration since last year. It is powered by the nixvim project, a Neovim distribution powered by nix. It allows you to define your Neovim configurations using nix modules rather than typical lua files. This has the added advantage of build reproducibility and seamless integration into the rest of my nix system configuration.

[!TIP] If you don't know nix, it is like an extended, functional json, which is a very reductive explanation

Here is a snippet of a few configurations from the kickstart configuration written as a nix module.

{
  # ...
  opts = {
    number = true;
    relativenumber = true;
    mouse = "a";
    showmode = false;
    clipboard = {
      providers = {
        wl-copy.enable = true
      };
      # register = "unnamedplus";
    };
    breakindent = true;
  }

To build a use this configuration, it is as simple as including it as a flake and then adding to my package list.

# flake.nix
{
  inputs = {
    # ...
    nixvim-config.url = "github:suasuasuasuasua/nixvim";
    # ...
  };
}

# nixvim.nix
{
  inputs,
  config,
  pkgs,
  ...
}:
let
  inherit (pkgs.stdenv.hostPlatform) system;
  nixvim = inputs.nixvim-config.packages.${system}.default.extend {
    config.plugins = {
      # ...
    };

    config.nixvim = {
      lsp.languages = {
        # ...
      };
      plugins = {
        custom = {
          # ...
        };
      };
    };
  };
in
{
  home.packages = [
    nixvim # include it here!
  ];
}

Then finally we can rebuild the system and get our new Neovim configuration.

nh os switch .

You can find all of the possible nixvim configurations here. Currently, the stable branch is 25.05, which I try to stay on as much as possible. Sometimes, plugins will break so I'll either have to change the git revision or switch to the unstable branch.

Plugins

Here is a list of my favorite plugins.

Quirks

  1. The translation form lua to nix can be challenging. Most plugins do not specify how to configure it using nix but with lua. However, once you do use it for long enough, it comes pretty naturally. Moreover, there are some weird workarounds that you have to deal with if A) a plugin isn't available in nixpkgs, B) you want to use lazy loading, or C) a module option doesn't exist yet.
  2. My Neovim configuraiton on my MacBook is slower and less consistent than the configuration on my Linux systems. I have no idea why this would happen, especially since my MacBook is much more powerful than my $600 server. I imagine that it has something to do with the ARM chip or perhaps how macOS is not the first class citizen for nix related things. My regular nvim configuration is much faster.
    • For reference, the startup time will be a difference between 70-100ms which isn't huge but I do wonder about that inconsistency
  3. Rebuilding the neovim after each and every change sometimes tedious and time consuming, especially if you love tweaking the configuration here and there. With a regular setup, all you do is change the lua file and keep rolling
  4. To be completely honest, I have spend too much time figuring out how to wrangle this framework and would have been more productive just using Neovim as Neovim
    • if I wanted to use nix, then something like nixCats allows me to keep my lua configuration with the nix build system
    • a package manager like lazy.nvim can easily track plugin dependencies, but may not be able to track external dependencies like ripgrep, fzf, etc.