Added: Nixvim modules

This commit is contained in:
2026-01-27 00:48:01 +01:00
parent de5c0feaa3
commit 3ce95ebe41
12 changed files with 231 additions and 56 deletions

View File

@@ -12,6 +12,9 @@
./alpha.nix
./avante.nix
./openscad.nix
./jupytext.nix
./live-server.nix
./which-key.nix
];
programs.nixvim = {

18
home/neovim/jupytext.nix Normal file
View File

@@ -0,0 +1,18 @@
{ ... }: {
# Jupytext: Execute Jupyter notebooks directly in Neovim
programs.nixvim.jupytext = {
enable = true;
settings = {
custom_language_formatting = {
python = {
extension = "md";
force_ft = "markdown";
style = "markdown";
};
};
force_ft = null;
output_extension = "auto";
style = "light";
};
};
}

View File

@@ -0,0 +1,15 @@
{ pkgs, ... }: {
# Live Server: Auto-reload browser for web development
# Uses browser-sync for live reload functionality
programs.nixvim = {
keymaps = [{
mode = "n";
key = "<leader>ls";
action =
"<cmd>terminal browser-sync start --server --files '*.html, *.css, *.js' --no-notify<cr>";
options.desc = "Start live server (browser-sync)";
}];
extraPackages = with pkgs; [ nodePackages.browser-sync ];
};
}

94
home/neovim/which-key.nix Normal file
View File

@@ -0,0 +1,94 @@
{ pkgs, ... }: {
# Which-key: Display available keybindings in popup
# Shows all possible key combinations after pressing leader or other prefix keys
programs.nixvim.plugins.which-key = {
enable = true;
settings = {
delay = 500; # Time in ms before popup shows
icons = {
breadcrumb = "»";
separator = "";
group = "+";
};
# Organize keymaps into named groups
spec = [
# Leader key groups
{
__unkeyed-1 = "<leader>a";
group = "Avante AI";
icon = "🤖";
}
{
__unkeyed-1 = "<leader>f";
group = "Find/Files/Terminal";
icon = "🔍";
}
{
__unkeyed-1 = "<leader>m";
group = "Molten (Jupyter)";
icon = "📓";
}
{
__unkeyed-1 = "<leader>o";
group = "OpenSCAD";
icon = "🔧";
}
# Bracket navigation groups
{
__unkeyed-1 = "[";
group = "Previous";
icon = "";
}
{
__unkeyed-1 = "]";
group = "Next";
icon = "";
}
# g prefix groups
{
__unkeyed-1 = "g";
group = "Go/LSP";
icon = "🎯";
}
{
__unkeyed-1 = "gr";
group = "LSP References/Rename";
icon = "🔗";
}
{
__unkeyed-1 = "gc";
group = "Comments";
icon = "💬";
}
# l prefix
{
__unkeyed-1 = "<leader>l";
group = "Live Server";
icon = "🌐";
}
# z prefix
{
__unkeyed-1 = "z";
group = "Folds/Spell";
icon = "📋";
}
];
# Hide specific mappings to reduce clutter
disable = {
builtin_keys = {
# Hide these default vim keys from which-key
i = [ "<C-R>" "<C-W>" ];
n = [ "<C-W>" ];
};
};
};
};
}