gitsigns.lua 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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. numhl = false,
  40. linehl = false,
  41. keymaps = {
  42. -- Default keymap options
  43. noremap = true,
  44. buffer = true,
  45. },
  46. signcolumn = true,
  47. word_diff = false,
  48. attach_to_untracked = true,
  49. current_line_blame = false, -- Toggle with `:Gitsigns toggle_current_line_blame`
  50. current_line_blame_opts = {
  51. virt_text = true,
  52. virt_text_pos = "eol", -- 'eol' | 'overlay' | 'right_align'
  53. delay = 1000,
  54. ignore_whitespace = false,
  55. },
  56. current_line_blame_formatter_opts = {
  57. relative_time = false,
  58. },
  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. watch_gitdir = {
  69. interval = 1000,
  70. follow_files = true,
  71. },
  72. sign_priority = 6,
  73. update_debounce = 200,
  74. status_formatter = nil, -- Use default
  75. yadm = { enable = false },
  76. },
  77. }
  78. end
  79. M.setup = function()
  80. local gitsigns = require "gitsigns"
  81. gitsigns.setup(lvim.builtin.gitsigns.opts)
  82. if lvim.builtin.gitsigns.on_config_done then
  83. lvim.builtin.gitsigns.on_config_done(gitsigns)
  84. end
  85. end
  86. return M