feat(neovim): migrate to nixvim with minimal plugins (#260)

Replace bare programs.neovim with programs.nixvim. Only 3 plugins:
neo-tree (file explorer), catppuccin (colorscheme), treesitter.

Add core editor opts matching helix defaults: clipboard, cursorline,
scrolloff, wrap, mouse, undofile, smart search, split direction.
Enable 5 LSP servers: nixd, rust-analyzer, gopls, pyright, bashls.

Signed-off-by: Ryan Yin <xiaoyin_c@qq.com>
This commit is contained in:
Ryan Yin
2026-05-09 18:12:17 +08:00
committed by GitHub
parent 3d4a2d4879
commit ce49423247
3 changed files with 154 additions and 8 deletions

61
flake.lock generated
View File

@@ -343,9 +343,30 @@
"type": "github"
}
},
"flake-parts_4": {
"inputs": {
"nixpkgs-lib": [
"nixvim",
"nixpkgs"
]
},
"locked": {
"lastModified": 1777932387,
"narHash": "sha256-nUYVPiqrzr36ThiQOAr5MKeGHDBSDM3OFWkz0uDjOvc=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "71a3a77326609675e9f8b51084cf23d5d1945899",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "flake-parts",
"type": "github"
}
},
"flake-utils": {
"inputs": {
"systems": "systems_3"
"systems": "systems_4"
},
"locked": {
"lastModified": 1681202837,
@@ -898,6 +919,28 @@
"type": "github"
}
},
"nixvim": {
"inputs": {
"flake-parts": "flake-parts_4",
"nixpkgs": [
"nixpkgs"
],
"systems": "systems_3"
},
"locked": {
"lastModified": 1777991353,
"narHash": "sha256-DFwjggMV+nzCZpwK6Obxj9F+P59rbLVowGqHETfctBk=",
"owner": "nix-community",
"repo": "nixvim",
"rev": "7986a276960b4dfaed9bb2c3c438b5ba71ae08f1",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "nixvim",
"type": "github"
}
},
"nu_scripts": {
"flake": false,
"locked": {
@@ -1039,6 +1082,7 @@
"nixpkgs-master": "nixpkgs-master",
"nixpkgs-patched": "nixpkgs-patched",
"nixpkgs-stable": "nixpkgs-stable",
"nixvim": "nixvim",
"nu_scripts": "nu_scripts",
"nuenv": "nuenv",
"nur-ryan4yin": "nur-ryan4yin",
@@ -1153,6 +1197,21 @@
"type": "github"
}
},
"systems_4": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"treefmt-nix": {
"inputs": {
"nixpkgs": [

View File

@@ -67,6 +67,11 @@
inputs.nixpkgs.follows = "nixpkgs";
};
nixvim = {
url = "github:nix-community/nixvim";
inputs.nixpkgs.follows = "nixpkgs";
};
# https://github.com/catppuccin/nix
catppuccin = {
url = "github:catppuccin/nix";

View File

@@ -1,14 +1,96 @@
{ pkgs, ... }:
{ config, nixvim, ... }:
{
programs = {
neovim = {
imports = [ nixvim.homeModules.nixvim ];
home.shellAliases = {
vi = "nvim";
vim = "nvim";
};
programs.nixvim = {
enable = true;
clipboard.providers.wl-copy.enable = true;
opts = {
number = true;
relativenumber = true;
cursorline = true;
signcolumn = "auto";
clipboard = "unnamedplus";
scrolloff = 8;
swapfile = false;
title = true;
titlelen = 20;
smartindent = false;
mouse = "a";
undofile = true;
ignorecase = true;
smartcase = true;
splitbelow = true;
splitright = true;
updatetime = 300;
wrap = true;
linebreak = true;
};
colorschemes.catppuccin = {
enable = true;
settings = {
transparent_background = true;
};
};
viAlias = true;
vimAlias = true;
plugins.lsp.servers = {
nixd.enable = true;
"rust_analyzer" = {
enable = true;
installCargo = false;
installRustc = false;
};
gopls.enable = true;
pyright.enable = true;
bashls.enable = true;
};
withRuby = false;
withPython3 = false;
plugins.treesitter = {
enable = true;
grammarPackages = with config.programs.nixvim.plugins.treesitter.package.builtGrammars; [
bash
json
lua
make
markdown
nix
regex
rust
go
python
toml
vim
vimdoc
xml
yaml
nu
];
};
plugins.neo-tree = {
enable = true;
settings = {
filesystem = {
filtered_items = {
visible = true;
hide_dotfiles = false;
hide_gitignored = false;
};
follow_current_file = {
enabled = true;
leave_dirs_open = false;
};
};
};
};
};
}