Enable gitsigns word_diff, add keymaps to toggle
This commit is contained in:
parent
3903e1486f
commit
0e4e29ce0e
|
@ -3,6 +3,7 @@ require('gitsigns').setup {
|
||||||
numhl = true,
|
numhl = true,
|
||||||
linehl = true,
|
linehl = true,
|
||||||
current_line_blame = true,
|
current_line_blame = true,
|
||||||
|
word_diff = true,
|
||||||
on_attach = function(bufnr)
|
on_attach = function(bufnr)
|
||||||
-- Setup keymaps
|
-- 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 prev_hunk<CR>', {})
|
||||||
|
@ -16,6 +17,9 @@ require('gitsigns').setup {
|
||||||
vim.api.nvim_buf_set_keymap(bufnr, 'n', '<leader>bs', '<cmd>Gitsigns stage_buffer<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>br', '<cmd>Gitsigns reset_buffer<CR>', {})
|
||||||
vim.api.nvim_buf_set_keymap(bufnr, 'n', '<leader>bl', '<cmd>Gitsigns blame_line<CR>', {})
|
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>', {})
|
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>', {})
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue