add rest of plugins from previous config
This commit is contained in:
parent
41327778ea
commit
93027a59a2
16 changed files with 697 additions and 1 deletions
52
config/nvim_unstable/lua/aleidk/plugins/git.lua
Normal file
52
config/nvim_unstable/lua/aleidk/plugins/git.lua
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
local const = require("aleidk.constants")
|
||||
|
||||
return {
|
||||
{
|
||||
"lewis6991/gitsigns.nvim",
|
||||
event = { "BufReadPre", "BufNewFile" },
|
||||
opts = {
|
||||
-- See `:help gitsigns.txt`
|
||||
signcolumn = true, -- Toggle with `:Gitsigns toggle_signs`
|
||||
numhl = true, -- Toggle with `:Gitsigns toggle_numhl`
|
||||
linehl = false, -- Toggle with `:Gitsigns toggle_linehl`
|
||||
word_diff = false, -- Toggle with `:Gitsigns toggle_word_diff`
|
||||
signs = {
|
||||
add = { text = const.icons.git.added },
|
||||
change = { text = const.icons.git.modified },
|
||||
delete = { text = const.icons.git.removed },
|
||||
topdelete = { text = const.icons.git.removed },
|
||||
changedelete = { text = const.icons.git.removed },
|
||||
untracked = { text = "▎" },
|
||||
},
|
||||
signs_staged = {
|
||||
add = { text = const.icons.git.added },
|
||||
change = { text = const.icons.git.modified },
|
||||
delete = { text = const.icons.git.removed },
|
||||
topdelete = { text = const.icons.git.removed },
|
||||
changedelete = { text = const.icons.git.removed },
|
||||
untracked = { text = "▎" },
|
||||
},
|
||||
on_attach = function(buffer)
|
||||
local gs = package.loaded.gitsigns
|
||||
|
||||
local function map(mode, l, r, desc)
|
||||
vim.keymap.set(mode, "<leader>g" .. l, r, { buffer = buffer, desc = desc })
|
||||
end
|
||||
|
||||
-- stylua: ignore start
|
||||
map("n", "j", gs.next_hunk, "Next Hunk")
|
||||
map("n", "k", gs.prev_hunk, "Prev Hunk")
|
||||
map({ "n", "v" }, "s", ":Gitsigns stage_hunk<CR>", "Stage Hunk")
|
||||
map({ "n", "v" }, "r", ":Gitsigns reset_hunk<CR>", "Reset Hunk")
|
||||
map("n", "u", gs.undo_stage_hunk, "Undo Stage Hunk")
|
||||
map("n", "R", gs.reset_buffer, "Reset Buffer")
|
||||
map("n", "<TAB>", gs.preview_hunk, "Preview Hunk")
|
||||
map("n", "l", function() gs.blame_line({ full = true }) end, "Blame Line")
|
||||
map("n", "L", gs.toggle_current_line_blame, "Toggle current line blame")
|
||||
map("n", "d", gs.toggle_word_diff, "Toggle word diff")
|
||||
map("n", "h", "<CMD>diffget<CR>", "Diff This with last commit")
|
||||
map("n", "l", "<CMD>diffput<CR>", "Diff This with last commit")
|
||||
end,
|
||||
},
|
||||
},
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue