From c920a1609ed1a369202c098fbadf381bc904b642 Mon Sep 17 00:00:00 2001 From: Huck Boles Date: Sat, 13 May 2023 15:13:51 -0500 Subject: [PATCH] git fugitive integration --- lua/functions.lua | 6 ++++-- lua/plugins.lua | 11 +++++++++++ lua/plugins/telescope.lua | 1 - 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/lua/functions.lua b/lua/functions.lua index d0f2488..f900753 100644 --- a/lua/functions.lua +++ b/lua/functions.lua @@ -1,8 +1,10 @@ -- open help windows in a vertical split vim.api.nvim_create_autocmd("BufWinEnter", { - pattern = { "*.txt" }, + pattern = { "*" }, callback = function() - if vim.o.filetype == 'help' then vim.cmd.wincmd("L") end + if vim.o.filetype == 'help' or 'fugitive' or 'gitcommit' then + vim.cmd.wincmd("L") + end end }) diff --git a/lua/plugins.lua b/lua/plugins.lua index 85039b2..a07bc7a 100644 --- a/lua/plugins.lua +++ b/lua/plugins.lua @@ -14,6 +14,17 @@ return { { 'tpope/vim-commentary', event = "VeryLazy" }, { 'lukas-reineke/indent-blankline.nvim', event = 'VeryLazy' }, + { + 'tpope/vim-fugitive', + keys = { + { 'G', 'Git' }, + { 'gc', 'Git commit' }, + { 'ga', 'Git add %' }, + { 'gd', 'Gdiffsplit' }, + { 'gb', 'Git blame' }, + }, + }, + { 'akinsho/toggleterm.nvim', keys = { { '', 'ToggleTerm' } }, diff --git a/lua/plugins/telescope.lua b/lua/plugins/telescope.lua index 0f57f11..fe1ef0c 100644 --- a/lua/plugins/telescope.lua +++ b/lua/plugins/telescope.lua @@ -14,7 +14,6 @@ return { { 'b', 'Telescope buffers' }, { '', 'Telescope command_history' }, { 'D', 'Telescope diagnostics' }, - { 'g', 'Telescope git_commits' }, }, config = function() require('telescope').setup { -- 2.45.2