2022-11-07 16:41:35 +00:00
|
|
|
require('gitsigns').setup {
|
2022-11-02 13:40:30 +00:00
|
|
|
signcolumn = true,
|
|
|
|
numhl = true,
|
2022-11-09 09:25:23 +00:00
|
|
|
linehl = false,
|
2022-11-02 13:40:30 +00:00
|
|
|
current_line_blame = true,
|
2022-11-09 09:19:12 +00:00
|
|
|
word_diff = false,
|
2022-11-02 13:40:30 +00:00
|
|
|
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>', {})
|
2023-01-04 10:58:34 +00:00
|
|
|
vim.api.nvim_buf_set_keymap(bufnr, 'n', '<leader>d', '<cmd>Gitsigns diffthis<CR>', {})
|
2022-11-02 13:40:30 +00:00
|
|
|
vim.api.nvim_buf_set_keymap(bufnr, 'n', '<leader>gq', '<cmd>Gitsigns setqflist<CR>', {})
|
|
|
|
vim.api.nvim_buf_set_keymap(bufnr, 'n', '<leader>gl', '<cmd>Gitsigns setloclist<CR>', {})
|
|
|
|
vim.api.nvim_buf_set_keymap(bufnr, 'n', '<leader>hp', '<cmd>Gitsigns preview_hunk<CR>', {})
|
|
|
|
vim.api.nvim_buf_set_keymap(bufnr, 'n', '<leader>hs', '<cmd>Gitsigns stage_hunk<CR>', {})
|
|
|
|
vim.api.nvim_buf_set_keymap(bufnr, 'n', '<leader>hr', '<cmd>Gitsigns reset_hunk<CR>', {})
|
|
|
|
vim.api.nvim_buf_set_keymap(bufnr, 'n', '<leader>bs', '<cmd>Gitsigns stage_buffer<CR>', {})
|
|
|
|
vim.api.nvim_buf_set_keymap(bufnr, 'n', '<leader>br', '<cmd>Gitsigns reset_buffer<CR>', {})
|
|
|
|
vim.api.nvim_buf_set_keymap(bufnr, 'n', '<leader>bl', '<cmd>Gitsigns blame_line<CR>', {})
|
2022-11-08 13:54:33 +00:00
|
|
|
vim.api.nvim_buf_set_keymap(bufnr, 'n', '<leader>btn', '<cmd>Gitsigns toggle_numhl<CR>', {})
|
|
|
|
vim.api.nvim_buf_set_keymap(bufnr, 'n', '<leader>btl', '<cmd>Gitsigns toggle_linehl<CR>', {})
|
|
|
|
vim.api.nvim_buf_set_keymap(bufnr, 'n', '<leader>btc', '<cmd>Gitsigns toggle_current_line_blame<CR>', {})
|
|
|
|
vim.api.nvim_buf_set_keymap(bufnr, 'n', '<leader>btw', '<cmd>Gitsigns toggle_word_diff<CR>', {})
|
2022-11-02 13:40:30 +00:00
|
|
|
end,
|
2022-11-01 14:52:38 +00:00
|
|
|
}
|