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
+105 -25
View File
@@ -4,8 +4,7 @@
lib,
inputs,
...
}:
{
}: {
# Its in its own folder for future modulizaion efforts
flake-file.inputs = {
nixvim = {
@@ -15,13 +14,20 @@
};
modules = {
nixvim = {
nixos =
{ home-manager, ... }:
{
nixos = {home-manager, ...}: {
};
homeManager =
{ pkgs, ... }:
{
homeManager = {pkgs, ...}: let
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 = [
inputs.nixvim.homeModules.nixvim
];
@@ -56,12 +62,13 @@
lsp-status.enable = true;
transparent.enable = true;
which-key.enable = true;
snacks.enable = true;
conform-nvim = {
enable = true;
settings = {
formatters_by_ft = {
nix = [ "alejandra" ];
rust = [ "rustfmt" ];
nix = ["alejandra"];
rust = ["rustfmt"];
"_" = [
"squeeze_blanks"
"trim_whitespace"
@@ -126,28 +133,28 @@
enable = true;
settings = {
sections = {
lualine_a = [ "mode" ];
lualine_a = ["mode"];
lualine_b = [
"branch"
"diff"
"diagnostics"
];
lualine_c = [ "filename" ];
lualine_c = ["filename"];
lualine_x = [
"encoding"
"fileformat"
"filetype"
];
lualine_y = [ "lsp_status" ];
lualine_z = [ "location" ];
lualine_y = ["progress"];
lualine_z = ["location"];
};
inactive_sections = {
lualine_a = [ ];
lualine_b = [ ];
lualine_c = [ "filename" ];
lualine_x = [ "location" ];
lualine_y = [ ];
lualine_z = [ ];
lualine_a = [];
lualine_b = [];
lualine_c = ["filename"];
lualine_x = ["location"];
lualine_y = [];
lualine_z = [];
};
};
};
@@ -171,15 +178,30 @@
};
};
};
trouble.enable = true;
lsp-lines.enable = true;
diaglist = {
enable = true;
settings = {
debug = false;
};
};
cmp = {
enable = true;
autoEnableSources = true;
settings = {
sources = [
{ name = "nvim_lsp"; }
{ name = "path"; }
{ name = "buffer"; }
{
name = "nvim_lsp";
priority = 100;
}
{
name = "buffer";
priority = 50;
}
{
name = "path";
priority = 40;
}
];
mapping = {
"<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'})";
"<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;
tiny-inline-diagnostic.enable = true;
# tiny-code-action.enable = true;
# persisted.enable = true;
auto-session = {
enable = false;
@@ -239,6 +272,9 @@
vimPlugins.melange-nvim
vimPlugins.telescope-file-browser-nvim
vimPlugins.lsp-progress-nvim
vimPlugins.cmp-cmdline
vimPlugins.cmp-nvim-lsp-signature-help
tiny-code-action
];
opts = {
number = true;
@@ -250,6 +286,42 @@
globals = {
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 = [
{
action = "<cmd>Telescope persisted<cr>";
@@ -294,12 +366,20 @@
};
}
{
action = "<cmd>Trouble diagnostics toggle<cr>";
action = "<cmd>DiaglistToggle<cr>";
key = "<leader>fd";
options = {
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 = {
homeManager =
{ home, pkgs, ... }:
{
homeManager = {
home,
pkgs,
...
}: {
programs.tmux = {
enable = true;
plugins = with pkgs.tmuxPlugins; [