Skip to content

Commit

Permalink
nvim: add blame.nvim
Browse files Browse the repository at this point in the history
  • Loading branch information
knpwrs committed Jan 31, 2024
1 parent 9759657 commit 601d1e6
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 14 deletions.
2 changes: 1 addition & 1 deletion home/config/nvim/lazy-lock.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"Dockerfile.vim": { "branch": "master", "commit": "2a31e6bcea5977209c05c728c4253d82fd873c82" },
"LazyVim": { "branch": "main", "commit": "c433ea7aa842c446edc2b1570998bf5440c68188" },
"LuaSnip": { "branch": "master", "commit": "2dbef19461198630b3d7c39f414d09fb07d1fdd2" },
"SchemaStore.nvim": { "branch": "main", "commit": "11d661ae5e08f19b5256661a6491a66fa26cdcfc" },
"blame.nvim": { "branch": "main", "commit": "562661972085a273914c8f702b11924f8aa573ea" },
"bufferline.nvim": { "branch": "main", "commit": "b15c6daf5a64426c69732b31a951f4e438cb6590" },
"catppuccin": { "branch": "main", "commit": "c2e6f8e7eb8d0ebf55700c89bdf842809aeecf09" },
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
return {
"lewis6991/gitsigns.nvim",
opts = {
current_line_blame = true,
current_line_blame_opts = {
delay = 250,
},
current_line_blame_formatter = " <author>, <author_time:%Y-%m-%d> - <summary>",
on_attach = function(buffer)
local gs = package.loaded.gitsigns
{
"lewis6991/gitsigns.nvim",
opts = {
current_line_blame = true,
current_line_blame_opts = {
delay = 250,
},
current_line_blame_formatter = " <author>, <author_time:%Y-%m-%d> - <summary>",
on_attach = function(buffer)
local gs = package.loaded.gitsigns

local function map(mode, l, r, desc)
vim.keymap.set(mode, l, r, { buffer = buffer, desc = desc })
end
local function map(mode, l, r, desc)
vim.keymap.set(mode, l, r, { buffer = buffer, desc = desc })
end

-- stylua: ignore start
map("n", "]h", gs.next_hunk, "Next Hunk")
Expand All @@ -26,6 +27,13 @@ return {
map("n", "<leader>hd", gs.diffthis, "Diff This")
map("n", "<leader>hD", function() gs.diffthis("~") end, "Diff This ~")
map({ "o", "x" }, "ih", ":<C-U>Gitsigns select_hunk<cr>", "GitSigns Select Hunk")
end,
end,
},
},
{
"FabijanZulj/blame.nvim",
keys = {
{ "<leader>gb", "<cmd>ToggleBlame<cr>", desc = "Toggle Git Blame" },
},
},
}

0 comments on commit 601d1e6

Please sign in to comment.