pretty-fold.lua 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. --type conform.options
  2. local options = {
  3. ft_ignore = { "neorg", "markdown", "json" },
  4. sections = {
  5. left = {
  6. --function() return string.rep('+', vim.v.foldlevel) end,
  7. function()
  8. return "level: " .. tonumber(vim.v.foldlevel)
  9. end,
  10. ", ",
  11. "number_of_folded_lines",
  12. ": ",
  13. "percentage",
  14. " ",
  15. "content",
  16. },
  17. right = {
  18. --' ', 'number_of_folded_lines', ': ', 'percentage', ' ',
  19. --function(config) return config.fill_char:rep(3) end
  20. --function(global_pretty_config) return global_pretty_config.fill_char:rep(5) end
  21. },
  22. },
  23. --fill_char = '•',
  24. -- more chars: '┣', '┫'
  25. fill_char = "━",
  26. remove_fold_markers = true,
  27. -- keep the indentation of the content of the fold string.
  28. keep_indentation = true,
  29. -- possible values:
  30. -- "delete" : delete all comment signs from the fold string.
  31. -- "spaces" : replace all comment signs with equal number of spaces.
  32. -- false : do nothing with comment signs.
  33. process_comment_signs = "spaces",
  34. --process_comment_signs = false,
  35. -- comment signs additional to the value of `&commentstring` option.
  36. --comment_signs = {},
  37. comment_signs = {
  38. '"""', -- python docstring
  39. "#", -- python and bash comments
  40. "--", -- lua comment
  41. "//", -- c languages comment
  42. },
  43. -- list of patterns that will be removed from content foldtext section.
  44. stop_words = {
  45. "@brief%s*", -- (for c++) remove '@brief' and all spaces after.
  46. },
  47. add_close_pattern = true, -- true, 'last_line' or false
  48. -- this patterns will not shown in folded line desc
  49. matchup_patterns = {
  50. { "{", "}" },
  51. { "%(", ")" }, -- % to escape lua pattern char
  52. { "%[", "]" }, -- % to escape lua pattern char
  53. },
  54. }
  55. require("pretty-fold").setup(options)