Skip to content

Commit

Permalink
feat: Git
Browse files Browse the repository at this point in the history
- Git commands via fugitive
- Blame and diffs indications via Gitsigns

EXTRA:

Opened a pull request tpope/vim-fugitive#2288
  • Loading branch information
paulopatto committed Apr 8, 2024
1 parent cf07688 commit ce942bf
Showing 1 changed file with 55 additions and 0 deletions.
55 changes: 55 additions & 0 deletions lua/plugins/git.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
return {
{
"tpope/vim-fugitive",
},
{
"lewis6991/gitsigns.nvim",
config = function()
require("gitsigns").setup({
-- Keymaps
vim.keymap.set("n", "<leader>gp", ":Gitsigns preview_hunk<CR>", {}),

signs = {
add = { text = "" },
change = { text = "" },
delete = { text = "_" },
topdelete = { text = "" },
changedelete = { text = "~" },
untracked = { text = "" },
},

auto_attach = true,
attach_to_untracked = false,
watch_gitdir = { follow_files = true },
signcolumn = true, -- Toggle with `:Gitsigns toggle_signs`
numhl = false, -- Toggle with `:Gitsigns toggle_numhl`
linehl = false, -- Toggle with `:Gitsigns toggle_linehl`
word_diff = false, -- Toggle with `:Gitsigns toggle_word_diff`
current_line_blame = true, -- Toggle with `:Gitsigns toggle_current_line_blame`
current_line_blame_opts = {
virt_text = true,
virt_text_pos = "eol", -- 'eol' | 'overlay' | 'right_align'
delay = 1000,
ignore_whitespace = false,
virt_text_priority = 100,
},
current_line_blame_formatter = "<author>, <author_time:%Y-%m-%d> - <summary>",
current_line_blame_formatter_opts = {
relative_time = false,
},
sign_priority = 6,
update_debounce = 100,
status_formatter = nil, -- Use default
max_file_length = 40000, -- Disable if file is longer than this (in lines)
preview_config = {
-- Options passed to nvim_open_win
border = "single",
style = "minimal",
relative = "cursor",
row = 0,
col = 1,
},
})
end,
},
}

0 comments on commit ce942bf

Please sign in to comment.