Skip to content

Commit 1c823f8

Browse files
committed
feat: Git
- Git commands via fugitive - Blame and diffs indications via Gitsigns EXTRA: Opened a pull request tpope/vim-fugitive#2288
1 parent 44ceda6 commit 1c823f8

File tree

1 file changed

+55
-0
lines changed

1 file changed

+55
-0
lines changed

lua/plugins/git.lua

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
return {
2+
{
3+
"tpope/vim-fugitive",
4+
},
5+
{
6+
"lewis6991/gitsigns.nvim",
7+
config = function()
8+
require("gitsigns").setup({
9+
-- Keymaps
10+
vim.keymap.set("n", "<leader>gp", ":Gitsigns preview_hunk<CR>", {}),
11+
12+
signs = {
13+
add = { text = "" },
14+
change = { text = "" },
15+
delete = { text = "_" },
16+
topdelete = { text = "" },
17+
changedelete = { text = "~" },
18+
untracked = { text = "" },
19+
},
20+
21+
auto_attach = true,
22+
attach_to_untracked = false,
23+
watch_gitdir = { follow_files = true },
24+
signcolumn = true, -- Toggle with `:Gitsigns toggle_signs`
25+
numhl = false, -- Toggle with `:Gitsigns toggle_numhl`
26+
linehl = false, -- Toggle with `:Gitsigns toggle_linehl`
27+
word_diff = false, -- Toggle with `:Gitsigns toggle_word_diff`
28+
current_line_blame = true, -- Toggle with `:Gitsigns toggle_current_line_blame`
29+
current_line_blame_opts = {
30+
virt_text = true,
31+
virt_text_pos = "eol", -- 'eol' | 'overlay' | 'right_align'
32+
delay = 1000,
33+
ignore_whitespace = false,
34+
virt_text_priority = 100,
35+
},
36+
current_line_blame_formatter = "<author>, <author_time:%Y-%m-%d> - <summary>",
37+
current_line_blame_formatter_opts = {
38+
relative_time = false,
39+
},
40+
sign_priority = 6,
41+
update_debounce = 100,
42+
status_formatter = nil, -- Use default
43+
max_file_length = 40000, -- Disable if file is longer than this (in lines)
44+
preview_config = {
45+
-- Options passed to nvim_open_win
46+
border = "single",
47+
style = "minimal",
48+
relative = "cursor",
49+
row = 0,
50+
col = 1,
51+
},
52+
})
53+
end,
54+
},
55+
}

0 commit comments

Comments
 (0)