Add diffview mappings
This commit is contained in:
parent
299e3dde49
commit
76d8cc8d6e
@ -267,7 +267,10 @@ return require('packer').startup(function(use)
|
|||||||
}
|
}
|
||||||
use {
|
use {
|
||||||
'sindrets/diffview.nvim',
|
'sindrets/diffview.nvim',
|
||||||
requires = 'nvim-lua/plenary.nvim'
|
requires = 'nvim-lua/plenary.nvim',
|
||||||
|
config = function()
|
||||||
|
require('plugins.diffview')
|
||||||
|
end,
|
||||||
}
|
}
|
||||||
use 'kyazdani42/nvim-web-devicons'
|
use 'kyazdani42/nvim-web-devicons'
|
||||||
use {
|
use {
|
||||||
|
20
lua/plugins/diffview.lua
Normal file
20
lua/plugins/diffview.lua
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
local actions = require("diffview.actions")
|
||||||
|
|
||||||
|
require("diffview").setup({
|
||||||
|
keymaps = {
|
||||||
|
view = {
|
||||||
|
["gq"] = "<Cmd>DiffviewClose<CR>",
|
||||||
|
},
|
||||||
|
file_panel = {
|
||||||
|
["gq"] = "<Cmd>DiffviewClose<CR>",
|
||||||
|
},
|
||||||
|
file_history_panel = {
|
||||||
|
["gq"] = "<Cmd>DiffviewClose<CR>",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
vim.keymap.set('v', '<leader>gl', [[<Cmd>'<,'>DiffviewFileHistory<CR>]], { noremap = false, silent = true, desc = "Toggle [G]it [L]og of selected lines" })
|
||||||
|
vim.keymap.set('n', '<leader>gL', [[<Cmd>DiffviewFileHistory<CR>]], { noremap = false, silent = true, desc = "Toggle [G]it [L]og of current branch" })
|
||||||
|
vim.keymap.set('n', '<leader>gl', [[<Cmd>DiffviewFileHistory %<CR>]], { noremap = false, silent = true, desc = "Toggle [G]it [L]og of current file history" })
|
||||||
|
vim.keymap.set('n', '<leader>gd', [[<Cmd>DiffviewOpen<CR>]], { noremap = false, silent = true, desc = "[G]it [D]iff current file against index" })
|
@ -1,6 +1,6 @@
|
|||||||
vim.keymap.set('n', '<leader>gx', [[<Cmd>G<CR>]], { noremap = false, silent = true, desc = "Toggle [G]it status window" })
|
vim.keymap.set('n', '<leader>gx', [[<Cmd>G<CR>]], { noremap = false, silent = true, desc = "Toggle [G]it status window" })
|
||||||
vim.keymap.set('n', '<leader>gs', [[<Cmd>Git<CR>]], { noremap = false, silent = true, desc = "Toggle [G]it [S]tatus window" })
|
vim.keymap.set('n', '<leader>gs', [[<Cmd>Git<CR>]], { noremap = false, silent = true, desc = "Toggle [G]it [S]tatus window" })
|
||||||
vim.keymap.set('n', '<leader>gd', [[<Cmd>Gdiffsplit<CR>]], { noremap = false, silent = true, desc = "[G]it [D]iff current file against index" })
|
vim.keymap.set('n', '<leader>gfd', [[<Cmd>Gdiffsplit<CR>]], { noremap = false, silent = true, desc = "[G]it [D]iff current file against index with [F]ugitive" })
|
||||||
vim.keymap.set('n', '<leader>gc', [[<Cmd>Git commit<CR>]], { noremap = false, silent = true, desc = "[G]it [C]ommit" })
|
vim.keymap.set('n', '<leader>gc', [[<Cmd>Git commit<CR>]], { noremap = false, silent = true, desc = "[G]it [C]ommit" })
|
||||||
vim.keymap.set('n', '<leader>gb', [[<Cmd>Git blame -C<CR>]], { noremap = false, silent = true, desc = "[G]it [B]lame" })
|
vim.keymap.set('n', '<leader>gb', [[<Cmd>Git blame -C<CR>]], { noremap = false, silent = true, desc = "[G]it [B]lame" })
|
||||||
vim.keymap.set('n', '<leader>gp', [[<Cmd>Git push<CR>]], { noremap = false, silent = true, desc = "[G]it [P]ush" })
|
vim.keymap.set('n', '<leader>gp', [[<Cmd>Git push<CR>]], { noremap = false, silent = true, desc = "[G]it [P]ush" })
|
||||||
|
Loading…
Reference in New Issue
Block a user