{...}: {
  programs.nixvim.opts = {
    # Expand tabs to 4 spaces
    shiftwidth = 4;
    softtabstop = 4;
    expandtab = true;

    signcolumn = "yes:3";

    # automatically indent and try to be smart about it
    autoindent = true;
    smartindent = true;

    # Relative line numbers
    number = true;
    relativenumber = true;

    # See search result as you type
    inccommand = "split";

    # Visualize whitespace
    list = true;
    listchars = {
      tab = "» ";
      trail = "·";
      nbsp = "␣";
    };

    # Show which line the cursor is on
    cursorline = true;

    # Keep the cursor somewhat centered on the screen
    scrolloff = 25;

    # Ask if operations would fail due to unsaved buffers
    confirm = true;

    # ignore case in search unless multiple capital case letter have been typed
    smartcase = true;
    ignorecase = true;

    completeopt = "menu,menuone,noselect";

    # Persistent undos :)
    undofile = true;

    # enable resize by mouse
    mouse = "n";
  };
}
