- Blazing fast startup time with lazy.nvim
- Language Server Protocol with nvim-lspconfig
- Resolving plugins installed by nix
- Resolving lsp servers and formatters from nix or mason.nvim
- Autocompletion with nvim-cmp
- Formatting with conform.nvim
- Treesitter related snippets with LuaSnip and luasnip-snipepts
- Fuzzy find with telescope.nvim and fzf-lua
Caution
Please use my configuration with care and understand what will happen before using it. If you are looking for a more general configuration, see dora.nvim
- Neovim 0.9+ (nightly is better)
- Nerd Fonts
- Node
- Needed by copilot.lua
- Terminal with true color and graphic protocol support, recommand Kitty
- (Optional) rime_ls: RIME as LSP
- Optional Requirements
$ ln -s /path/to/dotvim ~/.dotvim
$ mkdir -p ~/.config/nvim
$ cp ~/.dotvim/init.lua ~/.config/nvim/init.lua
{
config,
lib,
pkgs,
pkgs-unstable,
nur-hawtian,
...
}: let
user-dotpath = "${config.home.homeDirectory}/.dotvim";
plugins = {
inherit (nur-hawtian.packages.${pkgs.system}.vimPlugins) gh-actions-nvim;
inherit (pkgs-unstable.vimPlugins) telescope-fzf-native-nvim;
inherit (pkgs-unstable.vimPlugins) markdown-preview-nvim;
};
bins = with pkgs-unstable; {
inherit fzf stylua lua-language-server statix;
clangd = llvmPackages_17.clang-unwrapped;
clang-format = llvmPackages_17.clang-unwrapped;
inherit (python312Packages) black;
inherit (pkgs) rust-analyzer rustfmt;
};
nixAwareNvimConfig = pkgs.stdenv.mkDerivation {
name = "nix-aware-nvim-config";
buildInputs =
(lib.mapAttrsToList (_: pkg: pkg) plugins)
++ (lib.mapAttrsToList (_: pkg: pkg) bins);
phases = ["installPhase"];
nixAwareNvimConfigJson =
pkgs.writeText
"nixAwareNvimConfig.json"
(builtins.toJSON {
pkgs = plugins;
bin = lib.mapAttrs (name: pkg: "${pkg}/bin/${name}") bins;
try_nix_only = true;
});
installPhase = ''
mkdir -p $out
cp $nixAwareNvimConfigJson $out/nix-aware.json
'';
};
init-dora = ''
vim.loader.enable()
local dotpath = "${user-dotpath}"
vim.opt.rtp:prepend(dotpath)
require("dotvim").setup()
'';
in {
home.packages = with pkgs; [
python3.pkgs.pynvim
nodePackages.neovim
tree-sitter
nixAwareNvimConfig
];
programs.neovim = {
enable = true;
package = pkgs.neovim-nightly;
plugins = builtins.attrValues plugins;
};
xdg.configFile = {
"nvim/init.lua" = {
text = init-dora;
force = true;
};
"nvim/nix-aware.json" = {
source = "${nixAwareNvimConfig}/nix-aware.json";
force = true;
};
};
}