Skip to content

Commit

Permalink
tune git settings
Browse files Browse the repository at this point in the history
not conflict with original diff mappings
  • Loading branch information
Blithe-Chiang committed May 25, 2023
1 parent 21695bb commit 0c3d5eb
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,9 @@ require('lazy').setup({
changedelete = { text = '~' },
},
on_attach = function(bufnr)
vim.keymap.set('n', '[c', require('gitsigns').prev_hunk, { buffer = bufnr, desc = 'Go to Previous Hunk' })
vim.keymap.set('n', ']c', require('gitsigns').next_hunk, { buffer = bufnr, desc = 'Go to Next Hunk' })
-- for not conflict with original diff mapping
vim.keymap.set('n', '[g', require('gitsigns').prev_hunk, { buffer = bufnr, desc = 'Go to Previous Hunk' })
vim.keymap.set('n', ']g', require('gitsigns').next_hunk, { buffer = bufnr, desc = 'Go to Next Hunk' })
vim.keymap.set('n', "gl", require("gitsigns").blame_line, { desc = "View Git blame" })
vim.keymap.set('n', "<leader>gd", require("gitsigns").diffthis, { desc = "View Git diff" })
vim.keymap.set('n', "<leader>gD", function() require("gitsigns").diffthis('~') end, { desc = "View Git diff last commit" })
Expand Down

0 comments on commit 0c3d5eb

Please sign in to comment.