nixos-configs/common/home/neovim/git.nix

34 lines
741 B
Nix
Raw Normal View History

{pkgs, ...}: let
inherit (pkgs) vimPlugins;
in {
programs = {
neovim = {
plugins = [
vimPlugins.fugitive
{
plugin = vimPlugins.gitsigns-nvim;
type = "lua";
config =
2024-06-09 22:49:30 -04:00
# lua
''
local gitsigns = require("gitsigns");
local function visual_stage()
local first_line = vim.fn.line('v');
local last_line = vim.fn.getpos('.')[2];
gitsigns.stage_hunk({ first_line, last_line });
end
vim.keymap.set("v", "gs", function()
visual_stage()
end);
gitsigns.setup();
'';
}
];
};
};
}