refactor(nvim): update git nix code
All checks were successful
Discord / discord commits (push) Has been skipped

This commit is contained in:
matt1432 2024-12-22 03:20:05 -05:00
parent 157a74df47
commit b34b174c68

View file

@ -1,27 +1,41 @@
{pkgs, ...}: { {
programs.neovim.plugins = [ config,
pkgs.vimPlugins.fugitive lib,
pkgs,
...
}: let
inherit (lib) mkIf;
{ cfg = config.programs.neovim;
plugin = pkgs.vimPlugins.gitsigns-nvim; in {
type = "lua"; config = mkIf cfg.enable {
config = programs.neovim.plugins = [
# lua pkgs.vimPlugins.fugitive
''
local gitsigns = require("gitsigns");
local function visual_stage() {
local first_line = vim.fn.line('v'); plugin = pkgs.vimPlugins.gitsigns-nvim;
local last_line = vim.fn.getpos('.')[2]; type = "lua";
gitsigns.stage_hunk({ first_line, last_line }); config =
end # lua
''
local gitsigns = require("gitsigns");
vim.keymap.set("v", "gs", function() local function visual_stage()
visual_stage() local first_line = vim.fn.line('v');
end); local last_line = vim.fn.getpos('.')[2];
gitsigns.stage_hunk({ first_line, last_line });
end
gitsigns.setup(); vim.keymap.set("v", "gs", function()
''; visual_stage()
} end);
];
gitsigns.setup();
'';
}
];
};
# For accurate stack trace
_file = ./default.nix;
} }