]> git.huck.website - nvim.git/commitdiff
git fugitive integration
authorHuck Boles <huck@huck.website>
Sat, 13 May 2023 20:13:51 +0000 (15:13 -0500)
committerHuck Boles <huck@huck.website>
Sat, 13 May 2023 20:13:51 +0000 (15:13 -0500)
lua/functions.lua
lua/plugins.lua
lua/plugins/telescope.lua

index d0f2488917623acf2519b65bae159e0cc4f3399c..f90075317d211922040448df8e59887bb587b680 100644 (file)
@@ -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
 })
 
index 85039b2b8b1981fe7bcc0f92f0468b12599d4ee6..a07bc7ab92fd097b74f276716b4090a7afdeccb4 100644 (file)
@@ -14,6 +14,17 @@ return {
     { 'tpope/vim-commentary',                event = "VeryLazy" },
     { 'lukas-reineke/indent-blankline.nvim', event = 'VeryLazy' },
 
+    {
+        'tpope/vim-fugitive',
+        keys = {
+            { '<leader>G',  '<CMD>Git<CR>' },
+            { '<leader>gc', '<CMD>Git commit<CR>' },
+            { '<leader>ga', '<CMD>Git add %<CR>' },
+            { '<leader>gd', '<CMD>Gdiffsplit<CR>' },
+            { '<leader>gb', '<CMD>Git blame<CR>' },
+        },
+    },
+
     {
         'akinsho/toggleterm.nvim',
         keys = { { '<leader><space>', '<CMD>ToggleTerm<CR>' } },
index 0f57f114d3df33520cc614a19a6c076b3687da8c..fe1ef0ca87b5963df668f7738f81ca3201083baa 100644 (file)
@@ -14,7 +14,6 @@ return {
             { '<leader>b',     '<CMD>Telescope buffers<CR>' },
             { '<leader><C-r>', '<CMD>Telescope command_history<CR>' },
             { '<leader>D',     '<CMD>Telescope diagnostics<CR>' },
-            { '<leader>g',     '<CMD>Telescope git_commits<CR>' },
         },
         config = function()
             require('telescope').setup {