|
|
@ -229,7 +229,7 @@ M.lspconfig = {
|
|
|
|
|
|
|
|
|
|
|
|
["<leader>fm"] = {
|
|
|
|
["<leader>fm"] = {
|
|
|
|
function()
|
|
|
|
function()
|
|
|
|
vim.lsp.buf.formatting {}
|
|
|
|
vim.lsp.buf.format { async = true }
|
|
|
|
end,
|
|
|
|
end,
|
|
|
|
"lsp formatting",
|
|
|
|
"lsp formatting",
|
|
|
|
},
|
|
|
|
},
|
|
|
@ -408,7 +408,7 @@ M.gitsigns = {
|
|
|
|
plugin = true,
|
|
|
|
plugin = true,
|
|
|
|
|
|
|
|
|
|
|
|
n = {
|
|
|
|
n = {
|
|
|
|
-- Navigation
|
|
|
|
-- Navigation through hunks
|
|
|
|
["]c"] = {
|
|
|
|
["]c"] = {
|
|
|
|
function()
|
|
|
|
function()
|
|
|
|
if vim.wo.diff then
|
|
|
|
if vim.wo.diff then
|
|
|
@ -422,6 +422,7 @@ M.gitsigns = {
|
|
|
|
"Jump to next hunk",
|
|
|
|
"Jump to next hunk",
|
|
|
|
opts = { expr = true },
|
|
|
|
opts = { expr = true },
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
["[c"] = {
|
|
|
|
["[c"] = {
|
|
|
|
function()
|
|
|
|
function()
|
|
|
|
if vim.wo.diff then
|
|
|
|
if vim.wo.diff then
|
|
|
@ -437,103 +438,33 @@ M.gitsigns = {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
-- Actions
|
|
|
|
-- Actions
|
|
|
|
["<leader>hs"] = {
|
|
|
|
["<leader>rh"] = {
|
|
|
|
function()
|
|
|
|
|
|
|
|
require("gitsigns").stage_hunk()
|
|
|
|
|
|
|
|
end,
|
|
|
|
|
|
|
|
"Stage hunk",
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
["<leader>hr"] = {
|
|
|
|
|
|
|
|
function()
|
|
|
|
function()
|
|
|
|
require("gitsigns").reset_hunk()
|
|
|
|
require("gitsigns").reset_hunk()
|
|
|
|
end,
|
|
|
|
end,
|
|
|
|
"Reset hunk",
|
|
|
|
"Reset hunk",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
["<leader>hS"] = {
|
|
|
|
|
|
|
|
function()
|
|
|
|
["<leader>ph"] = {
|
|
|
|
require("gitsigns").stage_buffer()
|
|
|
|
|
|
|
|
end,
|
|
|
|
|
|
|
|
"Stage buffer",
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
["<leader>hu"] = {
|
|
|
|
|
|
|
|
function()
|
|
|
|
|
|
|
|
require("gitsigns").undo_stage_hunk()
|
|
|
|
|
|
|
|
end,
|
|
|
|
|
|
|
|
"Undo stage hunk",
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
["<leader>hR"] = {
|
|
|
|
|
|
|
|
function()
|
|
|
|
|
|
|
|
require("gitsigns").reset_buffer()
|
|
|
|
|
|
|
|
end,
|
|
|
|
|
|
|
|
"Reset buffer",
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
["<leader>hp"] = {
|
|
|
|
|
|
|
|
function()
|
|
|
|
function()
|
|
|
|
require("gitsigns").preview_hunk()
|
|
|
|
require("gitsigns").preview_hunk()
|
|
|
|
end,
|
|
|
|
end,
|
|
|
|
"Preview hunk",
|
|
|
|
"Preview hunk",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
["<leader>hb"] = {
|
|
|
|
|
|
|
|
|
|
|
|
["<leader>gb"] = {
|
|
|
|
function()
|
|
|
|
function()
|
|
|
|
package.loaded.gitsigns.blame_line { full = true }
|
|
|
|
package.loaded.gitsigns.blame_line()
|
|
|
|
end,
|
|
|
|
end,
|
|
|
|
"Blame line",
|
|
|
|
"Blame line",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
["<leader>tb"] = {
|
|
|
|
|
|
|
|
function()
|
|
|
|
|
|
|
|
require("gitsigns").toggle_current_line_blame()
|
|
|
|
|
|
|
|
end,
|
|
|
|
|
|
|
|
"Toggle current line blame",
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
["<leader>td"] = {
|
|
|
|
["<leader>td"] = {
|
|
|
|
function()
|
|
|
|
function()
|
|
|
|
require("gitsigns").toggle_deleted()
|
|
|
|
require("gitsigns").toggle_deleted()
|
|
|
|
end,
|
|
|
|
end,
|
|
|
|
"Toggle deleted",
|
|
|
|
"Toggle deleted",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
["<leader>hd"] = {
|
|
|
|
|
|
|
|
function()
|
|
|
|
|
|
|
|
require("gitsigns").diffthis()
|
|
|
|
|
|
|
|
end,
|
|
|
|
|
|
|
|
"Diff against the index",
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
["<leader>hD"] = {
|
|
|
|
|
|
|
|
function()
|
|
|
|
|
|
|
|
require("gitsigns").diffthis "~"
|
|
|
|
|
|
|
|
end,
|
|
|
|
|
|
|
|
"Diff against the last commit",
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
v = {
|
|
|
|
|
|
|
|
-- Actions
|
|
|
|
|
|
|
|
["<leader>hs"] = {
|
|
|
|
|
|
|
|
function()
|
|
|
|
|
|
|
|
require("gitsigns").stage_hunk()
|
|
|
|
|
|
|
|
end,
|
|
|
|
|
|
|
|
"Stage hunk",
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
["<leader>hr"] = {
|
|
|
|
|
|
|
|
function ()
|
|
|
|
|
|
|
|
require("gitsigns").reset_hunk()
|
|
|
|
|
|
|
|
end,
|
|
|
|
|
|
|
|
"Reset hunk",
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
x = {
|
|
|
|
|
|
|
|
["ih"] = {
|
|
|
|
|
|
|
|
function ()
|
|
|
|
|
|
|
|
require("gitsigns").select_hunk()
|
|
|
|
|
|
|
|
end,
|
|
|
|
|
|
|
|
"Reset hunk",
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
o = {
|
|
|
|
|
|
|
|
["ih"] = {
|
|
|
|
|
|
|
|
function ()
|
|
|
|
|
|
|
|
require("gitsigns").select_hunk()
|
|
|
|
|
|
|
|
end,
|
|
|
|
|
|
|
|
"Reset hunk",
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|