git.lua 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. return {
  2. {
  3. "NeogitOrg/neogit",
  4. dependencies = {
  5. "nvim-lua/plenary.nvim", -- required
  6. "sindrets/diffview.nvim", -- optional - Diff integration
  7. -- Only one of these is needed, not both.
  8. "nvim-telescope/telescope.nvim", -- optional
  9. "ibhagwan/fzf-lua", -- optional
  10. },
  11. config = function()
  12. -- init.lua
  13. local neogit = require("neogit")
  14. neogit.setup({})
  15. end,
  16. },
  17. {
  18. "lewis6991/gitsigns.nvim",
  19. config = function()
  20. require("gitsigns").setup({
  21. signs = {
  22. add = { text = "┃" },
  23. change = { text = "┃" },
  24. delete = { text = "_" },
  25. topdelete = { text = "‾" },
  26. changedelete = { text = "~" },
  27. untracked = { text = "┆" },
  28. },
  29. signs_staged = {
  30. add = { text = "┃" },
  31. change = { text = "┃" },
  32. delete = { text = "_" },
  33. topdelete = { text = "‾" },
  34. changedelete = { text = "~" },
  35. untracked = { text = "┆" },
  36. },
  37. signs_staged_enable = true,
  38. signcolumn = true, -- Toggle with `:Gitsigns toggle_signs`
  39. numhl = false, -- Toggle with `:Gitsigns toggle_numhl`
  40. linehl = false, -- Toggle with `:Gitsigns toggle_linehl`
  41. word_diff = false, -- Toggle with `:Gitsigns toggle_word_diff`
  42. watch_gitdir = {
  43. follow_files = true,
  44. },
  45. auto_attach = true,
  46. attach_to_untracked = false,
  47. current_line_blame = false, -- Toggle with `:Gitsigns toggle_current_line_blame`
  48. current_line_blame_opts = {
  49. virt_text = true,
  50. virt_text_pos = "eol", -- 'eol' | 'overlay' | 'right_align'
  51. delay = 1000,
  52. ignore_whitespace = false,
  53. virt_text_priority = 100,
  54. },
  55. current_line_blame_formatter = "<author>, <author_time:%R> - <summary>",
  56. sign_priority = 6,
  57. update_debounce = 100,
  58. status_formatter = nil, -- Use default
  59. max_file_length = 40000, -- Disable if file is longer than this (in lines)
  60. preview_config = {
  61. -- Options passed to nvim_open_win
  62. border = "single",
  63. style = "minimal",
  64. relative = "cursor",
  65. row = 0,
  66. col = 1,
  67. },
  68. })
  69. end,
  70. },
  71. }