home: vim: git: map keys on start

Instead of mapping those keys when `gitsigns` attaches to a buffer...
This commit is contained in:
Bruno BELANYI 2022-04-20 14:01:00 +02:00
parent 80c2c415fb
commit e073cc900c

View file

@ -1,5 +1,6 @@
lua << EOF lua << EOF
local gitsigns = require('gitsigns') local gitsigns = require('gitsigns')
local wk = require("which-key")
gitsigns.setup({ gitsigns.setup({
-- I dislike the full-green sign column when this happens -- I dislike the full-green sign column when this happens
@ -9,9 +10,7 @@ gitsigns.setup({
-- Show the blame quickly -- Show the blame quickly
delay = 100, delay = 100,
}, },
})
on_attach = function(bufnr)
local wk = require("which-key")
local keys = { local keys = {
-- Navigation -- Navigation
@ -61,6 +60,4 @@ gitsigns.setup({
wk.register(keys, { buffer = bufnr }) wk.register(keys, { buffer = bufnr })
wk.register(objects, { buffer = bufnr, mode = "o" }) wk.register(objects, { buffer = bufnr, mode = "o" })
wk.register(visual, { buffer = bufnr, mode = "x" }) wk.register(visual, { buffer = bufnr, mode = "x" })
end,
})
EOF EOF