in gitsigns: no word diff by default and add a bind to toggle
This commit is contained in:
parent
e7ab2a9252
commit
31c8088db2
1 changed files with 7 additions and 2 deletions
|
|
@ -253,7 +253,7 @@ local plugins = {
|
||||||
"lewis6991/gitsigns.nvim",
|
"lewis6991/gitsigns.nvim",
|
||||||
config = function()
|
config = function()
|
||||||
require('gitsigns').setup({
|
require('gitsigns').setup({
|
||||||
word_diff = true,
|
numhl = true,
|
||||||
on_attach = function(bufnr)
|
on_attach = function(bufnr)
|
||||||
local gs = package.loaded.gitsigns
|
local gs = package.loaded.gitsigns
|
||||||
|
|
||||||
|
|
@ -310,7 +310,12 @@ local plugins = {
|
||||||
)
|
)
|
||||||
map('n', '<leader>hd', gs.diffthis, { desc = "Diff this" })
|
map('n', '<leader>hd', gs.diffthis, { desc = "Diff this" })
|
||||||
map('n', '<leader>hD', function() gs.diffthis('~') end, { desc = "Diff this (ignore whitespace)" })
|
map('n', '<leader>hD', function() gs.diffthis('~') end, { desc = "Diff this (ignore whitespace)" })
|
||||||
map('n', '<leader>td', gs.toggle_deleted, { desc = "Toggle deleted" })
|
map(
|
||||||
|
"n",
|
||||||
|
"<leader>td",
|
||||||
|
function () gs.toggle_linehl() gs.toggle_word_diff() gs.toggle_deleted() end,
|
||||||
|
{ desc = "toggle diff highlight" }
|
||||||
|
)
|
||||||
|
|
||||||
-- Text object
|
-- Text object
|
||||||
map({ 'o', 'x' }, 'ih', ':<C-U>Gitsigns select_hunk<CR>', { desc = "Select hunk" })
|
map({ 'o', 'x' }, 'ih', ':<C-U>Gitsigns select_hunk<CR>', { desc = "Select hunk" })
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue