From 8eac473ad82a955b643d41bb7f94f3e302410c7e Mon Sep 17 00:00:00 2001 From: Maxime Pierront Date: Sat, 14 Feb 2026 10:58:42 +0100 Subject: [PATCH] feature: add vim fugitive support --- init.lua | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/init.lua b/init.lua index ab0a6b7a..e617c5a7 100644 --- a/init.lua +++ b/init.lua @@ -286,6 +286,25 @@ require('lazy').setup({ }, }, + { -- Git integration with fugitive + 'tpope/vim-fugitive', + cmd = { 'Git', 'Gvdiffsplit', 'GBrowse', 'Gwrite', 'Gread', 'Gdiffsplit' }, + dependencies = { + 'tpope/vim-rhubarb', -- GitHub support for :GBrowse + 'shumphrey/fugitive-gitlab.vim', -- GitLab support for :GBrowse + }, + keys = { + { 'gs', 'Git', desc = '[G]it [S]tatus' }, + { 'gb', 'Git blame', desc = '[G]it [B]lame' }, + { 'gd', 'Gvdiffsplit', desc = '[G]it [D]iff' }, + { 'gl', 'Git log --oneline', desc = '[G]it [L]og' }, + { 'gp', 'Git push', desc = '[G]it [P]ush' }, + { 'gP', 'Git pull', desc = '[G]it [P]ull' }, + { 'gc', 'Git commit', desc = '[G]it [C]ommit' }, + { 'gB', 'GBrowse', desc = '[G]it [B]rowse' }, + }, + }, + -- NOTE: Plugins can also be configured to run Lua code when they are loaded. -- -- This is often very useful to both group configuration, as well as handle @@ -313,6 +332,8 @@ require('lazy').setup({ { 's', group = '[S]earch', mode = { 'n', 'v' } }, { 't', group = '[T]oggle' }, { 'h', group = 'Git [H]unk', mode = { 'n', 'v' } }, + { 'g', group = '[G]it' }, + { 'gf', group = '[F]ind' }, }, }, }, @@ -469,6 +490,11 @@ require('lazy').setup({ -- Shortcut for searching your Neovim configuration files vim.keymap.set('n', 'sn', function() builtin.find_files { cwd = vim.fn.stdpath 'config' } end, { desc = '[S]earch [N]eovim files' }) + + -- Git Telescope integration + vim.keymap.set('n', 'gfb', builtin.git_branches, { desc = '[G]it [F]ind [B]ranches' }) + vim.keymap.set('n', 'gfc', builtin.git_commits, { desc = '[G]it [F]ind [C]ommits' }) + vim.keymap.set('n', 'gfs', builtin.git_stash, { desc = '[G]it [F]ind [S]tash' }) end, },