gitsigns.lua 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. local M = {}
  2. M.config = function()
  3. lvim.builtin.gitsigns = {
  4. active = true,
  5. on_config_done = nil,
  6. opts = {
  7. signs = {
  8. add = {
  9. hl = "GitSignsAdd",
  10. text = lvim.icons.ui.BoldLineLeft,
  11. numhl = "GitSignsAddNr",
  12. linehl = "GitSignsAddLn",
  13. },
  14. change = {
  15. hl = "GitSignsChange",
  16. text = lvim.icons.ui.BoldLineLeft,
  17. numhl = "GitSignsChangeNr",
  18. linehl = "GitSignsChangeLn",
  19. },
  20. delete = {
  21. hl = "GitSignsDelete",
  22. text = lvim.icons.ui.Triangle,
  23. numhl = "GitSignsDeleteNr",
  24. linehl = "GitSignsDeleteLn",
  25. },
  26. topdelete = {
  27. hl = "GitSignsDelete",
  28. text = lvim.icons.ui.Triangle,
  29. numhl = "GitSignsDeleteNr",
  30. linehl = "GitSignsDeleteLn",
  31. },
  32. changedelete = {
  33. hl = "GitSignsChange",
  34. text = lvim.icons.ui.BoldLineLeft,
  35. numhl = "GitSignsChangeNr",
  36. linehl = "GitSignsChangeLn",
  37. },
  38. },
  39. signcolumn = true,
  40. numhl = false,
  41. linehl = false,
  42. word_diff = false,
  43. watch_gitdir = {
  44. interval = 1000,
  45. follow_files = true,
  46. },
  47. attach_to_untracked = true,
  48. current_line_blame = false, -- Toggle with `:Gitsigns toggle_current_line_blame`
  49. current_line_blame_opts = {
  50. virt_text = true,
  51. virt_text_pos = "eol", -- 'eol' | 'overlay' | 'right_align'
  52. delay = 1000,
  53. ignore_whitespace = false,
  54. },
  55. current_line_blame_formatter = "<author>, <author_time:%Y-%m-%d> - <summary>",
  56. sign_priority = 6,
  57. status_formatter = nil, -- Use default
  58. update_debounce = 200,
  59. max_file_length = 40000,
  60. preview_config = {
  61. -- Options passed to nvim_open_win
  62. border = "rounded",
  63. style = "minimal",
  64. relative = "cursor",
  65. row = 0,
  66. col = 1,
  67. },
  68. yadm = { enable = false },
  69. },
  70. }
  71. end
  72. M.setup = function()
  73. local gitsigns = reload "gitsigns"
  74. gitsigns.setup(lvim.builtin.gitsigns.opts)
  75. if lvim.builtin.gitsigns.on_config_done then
  76. lvim.builtin.gitsigns.on_config_done(gitsigns)
  77. end
  78. end
  79. return M