neovim-config/lua/plugins/diffview.lua
Tyler Hallada d23c57c5d0 Switch to new lazy-based config
Still a bit WIP. Gradually adding back old plugins and config from old config.
2023-11-27 01:31:45 -05:00

25 lines
840 B
Lua

return {
"sindrets/diffview.nvim",
cmd = { "DiffviewOpen", "DiffviewClose", "DiffviewToggleFiles", "DiffviewFocusFiles" },
opts = {
enhanced_diff_hl = true,
keymaps = {
view = {
["gq"] = "<Cmd>DiffviewClose<CR>",
},
file_panel = {
["gq"] = "<Cmd>DiffviewClose<CR>",
},
file_history_panel = {
["gq"] = "<Cmd>DiffviewClose<CR>",
},
},
},
keys = {
{ "v", "<leader>gl", "<cmd>'<,'>DiffviewFileHistory<cr>", desc = "Toggle git log of selected lines" },
{ "<leader>gL", "<cmd>DiffviewFileHistory<cr>", desc = "Toggle git log of current branch" },
{ "<leader>gl", "<cmd>DiffviewFileHistory %<cr>", desc = "Toggle git log of current file history" },
{ "<leader>gd", "<cmd>DiffviewOpen<cr>", desc = "Git diff current file against the index" },
},
}