nvim is cool now

This commit is contained in:
2026-05-15 12:55:55 +01:00
parent 5e83cc9863
commit 74cadc4f69
2 changed files with 388 additions and 307 deletions
+94 -14
View File
@@ -4,8 +4,7 @@
lib, lib,
inputs, inputs,
... ...
}: }: {
{
# Its in its own folder for future modulizaion efforts # Its in its own folder for future modulizaion efforts
flake-file.inputs = { flake-file.inputs = {
nixvim = { nixvim = {
@@ -15,13 +14,20 @@
}; };
modules = { modules = {
nixvim = { nixvim = {
nixos = nixos = {home-manager, ...}: {
{ home-manager, ... }:
{
}; };
homeManager = homeManager = {pkgs, ...}: let
{ pkgs, ... }: tiny-code-action = pkgs.vimUtils.buildVimPlugin {
{ name = "tiny-code-action.nvim";
src = pkgs.fetchFromGitHub {
owner = "rachartier";
repo = "tiny-code-action.nvim";
rev = "main";
hash = "sha256-UF9zeO5Uujdt2MEwy2d2Lhk6JRnEN4vrEvYslv0/zaA";
};
nvimSkipModules = ["tiny-code-action.previewers.snacks"];
};
in {
imports = [ imports = [
inputs.nixvim.homeModules.nixvim inputs.nixvim.homeModules.nixvim
]; ];
@@ -56,6 +62,7 @@
lsp-status.enable = true; lsp-status.enable = true;
transparent.enable = true; transparent.enable = true;
which-key.enable = true; which-key.enable = true;
snacks.enable = true;
conform-nvim = { conform-nvim = {
enable = true; enable = true;
settings = { settings = {
@@ -138,7 +145,7 @@
"fileformat" "fileformat"
"filetype" "filetype"
]; ];
lualine_y = [ "lsp_status" ]; lualine_y = ["progress"];
lualine_z = ["location"]; lualine_z = ["location"];
}; };
inactive_sections = { inactive_sections = {
@@ -171,15 +178,30 @@
}; };
}; };
}; };
trouble.enable = true; lsp-lines.enable = true;
diaglist = {
enable = true;
settings = {
debug = false;
};
};
cmp = { cmp = {
enable = true; enable = true;
autoEnableSources = true; autoEnableSources = true;
settings = { settings = {
sources = [ sources = [
{ name = "nvim_lsp"; } {
{ name = "path"; } name = "nvim_lsp";
{ name = "buffer"; } priority = 100;
}
{
name = "buffer";
priority = 50;
}
{
name = "path";
priority = 40;
}
]; ];
mapping = { mapping = {
"<C-Space>" = "cmp.mapping.complete()"; "<C-Space>" = "cmp.mapping.complete()";
@@ -190,10 +212,21 @@
"<S-Tab>" = "cmp.mapping(function(fallback) if cmp.visible() then cmp.select_prev_item() else fallback() end end, {'i', 's'})"; "<S-Tab>" = "cmp.mapping(function(fallback) if cmp.visible() then cmp.select_prev_item() else fallback() end end, {'i', 's'})";
"<Tab>" = "cmp.mapping(function(fallback) if cmp.visible() then cmp.select_next_item() else fallback() end end, {'i', 's'})"; "<Tab>" = "cmp.mapping(function(fallback) if cmp.visible() then cmp.select_next_item() else fallback() end end, {'i', 's'})";
}; };
window = {
completion = {
border = "rounded";
winhighlight = "Normal:Pmenu,FloatBorder:Pmenu,CursorLine:PmenuSel,Search:None";
};
documentation = {
border = "rounded";
winhighlight = "Normal:Pmenu,FloatBorder:Pmenu";
};
};
}; };
}; };
lspkind.enable = true; lspkind.enable = true;
tiny-inline-diagnostic.enable = true; tiny-inline-diagnostic.enable = true;
# tiny-code-action.enable = true;
# persisted.enable = true; # persisted.enable = true;
auto-session = { auto-session = {
enable = false; enable = false;
@@ -239,6 +272,9 @@
vimPlugins.melange-nvim vimPlugins.melange-nvim
vimPlugins.telescope-file-browser-nvim vimPlugins.telescope-file-browser-nvim
vimPlugins.lsp-progress-nvim vimPlugins.lsp-progress-nvim
vimPlugins.cmp-cmdline
vimPlugins.cmp-nvim-lsp-signature-help
tiny-code-action
]; ];
opts = { opts = {
number = true; number = true;
@@ -250,6 +286,42 @@
globals = { globals = {
mapleader = " "; mapleader = " ";
}; };
extraConfigLua = ''
local cmp = require('cmp')
cmp.setup.cmdline(':', {
mapping = cmp.mapping.preset.cmdline(),
sources = cmp.config.sources(
{ { name = 'path' } },
{ { name = 'cmdline' } }
),
window = {
completion = {
border = 'rounded',
},
},
})
cmp.setup.cmdline('/', {
mapping = cmp.mapping.preset.cmdline(),
sources = {
{ name = 'buffer' }
},
window = {
completion = {
border = 'rounded',
},
},
})
require('tiny-code-action').setup({
backend = 'vim',
picker = 'snacks',
resolve_timeout = 100,
notify = {
enabled = true,
on_empty = true,
},
})
'';
keymaps = [ keymaps = [
{ {
action = "<cmd>Telescope persisted<cr>"; action = "<cmd>Telescope persisted<cr>";
@@ -294,12 +366,20 @@
}; };
} }
{ {
action = "<cmd>Trouble diagnostics toggle<cr>"; action = "<cmd>DiaglistToggle<cr>";
key = "<leader>fd"; key = "<leader>fd";
options = { options = {
silent = true; silent = true;
}; };
} }
{
action = "<cmd>lua require('tiny-code-action').code_action()<cr>";
key = "<leader>ca";
mode = ["n" "x"];
options = {
silent = true;
};
}
]; ];
}; };
}; };
+6 -5
View File
@@ -1,9 +1,10 @@
{ modules, ... }: {modules, ...}: {
{
modules.tmux = { modules.tmux = {
homeManager = homeManager = {
{ home, pkgs, ... }: home,
{ pkgs,
...
}: {
programs.tmux = { programs.tmux = {
enable = true; enable = true;
plugins = with pkgs.tmuxPlugins; [ plugins = with pkgs.tmuxPlugins; [