comment.lua 813 B

12345678910111213141516171819202122232425262728293031
  1. local M = {}
  2. function M.config()
  3. lvim.builtin.comment = {
  4. active = true,
  5. on_config_done = nil,
  6. -- Linters prefer comment and line to have a space in between markers
  7. marker_padding = true,
  8. -- should comment out empty or whitespace only lines
  9. comment_empty = false,
  10. -- Should key mappings be created
  11. create_mappings = true,
  12. -- Normal mode mapping left hand side
  13. line_mapping = "gcc",
  14. -- Visual/Operator mapping left hand side
  15. operator_mapping = "gc",
  16. -- Hook function to call before commenting takes place
  17. hook = nil,
  18. }
  19. end
  20. function M.setup()
  21. local nvim_comment = require "nvim_comment"
  22. nvim_comment.setup(lvim.builtin.comment)
  23. if lvim.builtin.comment.on_config_done then
  24. lvim.builtin.comment.on_config_done(nvim_comment)
  25. end
  26. end
  27. return M