fix(nvim): set gitsigns mappings in opts table

This commit is contained in:
João Paulo Dubas 2024-03-03 23:25:15 +00:00
parent ed04d14a9a
commit f9e86a4dac
Signed by: joao.dubas
SSH Key Fingerprint: SHA256:V1mixgOGRc/YMhGx/DNkOSmJxgA2vHNrDZEk3wt/kOA

View File

@ -1,5 +1,5 @@
diff --git a/init.lua b/init.lua
index 292ec07..19075db 100644
index 292ec07..284e1dc 100644
--- a/init.lua
+++ b/init.lua
@@ -101,8 +101,12 @@ vim.opt.number = true
@ -31,10 +31,10 @@ index 292ec07..19075db 100644
-- [[ Basic Keymaps ]]
-- See `:help vim.keymap.set()`
@@ -250,6 +262,66 @@ require('lazy').setup {
@@ -249,6 +261,66 @@ require('lazy').setup {
topdelete = { text = '‾' },
changedelete = { text = '~' },
},
},
+ on_attach = function(bufnr)
+ local gs = package.loaded.gitsigns
+
@ -96,8 +96,8 @@ index 292ec07..19075db 100644
+ map({ 'o', 'x' }, 'ih', ':<C-U>Gitsigns select_hunk<CR>', { desc = 'select git hunk' })
+ end,
},
},
-- NOTE: Plugins can also be configured to run lua code when they are loaded.
@@ -544,6 +616,18 @@ require('lazy').setup {
-- tsserver = {},
--