2022-11-01 14:52:38 +00:00
|
|
|
require('gitsigns').setup{
|
|
|
|
signcolumn = true,
|
|
|
|
numhl = true,
|
|
|
|
linehl = true,
|
|
|
|
current_line_blame = true,
|
|
|
|
on_attach = function(bufnr)
|
|
|
|
-- Setup keymaps
|
|
|
|
vim.api.nvim_buf_set_keymap(bufnr, 'n', '[g', '<cmd>Gitsigns prev_hunk<CR>', {})
|
|
|
|
vim.api.nvim_buf_set_keymap(bufnr, 'n', ']g', '<cmd>Gitsigns next_hunk<CR>', {})
|
|
|
|
vim.api.nvim_buf_set_keymap(bufnr, 'n', '<leader>hp', '<cmd>Gitsigns preview_hunk<CR>', {})
|
2022-11-01 15:59:45 +00:00
|
|
|
vim.api.nvim_buf_set_keymap(bufnr, 'n', '<leader>hs', '<cmd>Gitsigns stage_hunk<CR>', {})
|
2022-11-01 16:21:00 +00:00
|
|
|
vim.api.nvim_buf_set_keymap(bufnr, 'n', '<leader>hr', '<cmd>Gitsigns reset_hunk<CR>', {})
|
2022-11-01 15:59:45 +00:00
|
|
|
vim.api.nvim_buf_set_keymap(bufnr, 'n', '<leader>bs', '<cmd>Gitsigns stage_buffer<CR>', {})
|
2022-11-01 16:21:00 +00:00
|
|
|
vim.api.nvim_buf_set_keymap(bufnr, 'n', '<leader>br', '<cmd>Gitsigns reset_buffer<CR>', {})
|
2022-11-01 14:52:38 +00:00
|
|
|
vim.api.nvim_buf_set_keymap(bufnr, 'n', '<leader>bl', '<cmd>Gitsigns blame_line<CR>', {})
|
|
|
|
vim.api.nvim_buf_set_keymap(bufnr, 'n', '<leader>bt', '<cmd>Gitsigns toggle_current_line_blame<CR>', {})
|
|
|
|
end,
|
|
|
|
}
|