Skip to content

Commit

Permalink
feat(<leader>g): open :Git
Browse files Browse the repository at this point in the history
  • Loading branch information
xav-ie committed Dec 28, 2024
1 parent 58f0987 commit 08cae13
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 5 deletions.
7 changes: 2 additions & 5 deletions config/plugins/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
./coq
./conform-nvim.nix
./flash.nix

./firenvim.nix
./fugitive.nix
./gitsigns.nix
./lsp
./lspkind.nix
Expand Down Expand Up @@ -57,11 +59,6 @@
# https://nix-community.github.io/nixvim/plugins/friendly-snippets
friendly-snippets.enable = true;

# unstoppable git plugin
# https://github.com/tpope/vim-fugitive/
# https://nix-community.github.io/nixvim/plugins/fugitive
fugitive.enable = true;

# adds syntax highlighting and special helpers for nix files
# https://github.com/LnL7/vim-nix/
# https://nix-community.github.io/nixvim/plugins/nix
Expand Down
19 changes: 19 additions & 0 deletions config/plugins/fugitive.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{ ... }:
{
config = {
extraConfigLua = # lua
''
vim.keymap.set('n', '<leader>g', function()
if vim.fn.exists(':Git') > 0 then -- Ensure :Git command is available
vim.cmd('Git') -- Call :Git command
else
vim.notify('vim-fugitive is not loaded', vim.log.levels.ERROR)
end
end, { desc = "Git" })
'';
# unstoppable git plugin
# https://github.com/tpope/vim-fugitive/
# https://nix-community.github.io/nixvim/plugins/fugitive
plugins.fugitive.enable = true;
};
}

0 comments on commit 08cae13

Please sign in to comment.