Skip to content

Commit

Permalink
install diffview
Browse files Browse the repository at this point in the history
  • Loading branch information
gvolpe committed Apr 1, 2024
1 parent 84ad578 commit b5630e0
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 5 deletions.
17 changes: 17 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,11 @@
flake = false;
};

diffview = {
url = github:sindrets/diffview.nvim;
flake = false;
};

neogit = {
url = github:NeogitOrg/neogit;
flake = false;
Expand Down
11 changes: 6 additions & 5 deletions modules/git/git.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ in
options.vim.git = {
enable = mkOption {
type = types.bool;
description = "Enable git plugins (vim-fugitive by default)";
description = "Enable git plugins (diffview and vim-fugitive by default)";
};

gitsigns.enable = mkOption {
Expand All @@ -27,9 +27,10 @@ in

config =
mkIf cfg.enable {
vim.startPlugins = [ pkgs.neovimPlugins.vim-fugitive ] ++
(withPlugins cfg.gitsigns.enable [ pkgs.neovimPlugins.gitsigns-nvim ]) ++
(withPlugins cfg.neogit.enable [ pkgs.neovimPlugins.neogit ]);
vim.startPlugins =
with pkgs.neovimPlugins; [ diffview vim-fugitive ] ++
(withPlugins cfg.gitsigns.enable [ gitsigns-nvim ]) ++
(withPlugins cfg.neogit.enable [ neogit ]);

vim.nnoremap =
{
Expand Down Expand Up @@ -92,7 +93,7 @@ in
''}
-- Text object
map({'o', 'x'}, 'ih', ':<C-U>Gitsigns select_hunk<CR>')
map({'o', 'x'}, 'ih', '<cmd><C-U>Gitsigns select_hunk<CR>')
end
}
''}
Expand Down

0 comments on commit b5630e0

Please sign in to comment.