init.lua 1.5 KB

123456789101112131415161718192021222324252627282930313233343536
  1. require'nvim-treesitter.configs'.setup {
  2. ensure_installed = O.treesitter.ensure_installed, -- one of "all", "maintained" (parsers with maintainers), or a list of languages
  3. ignore_install = O.treesitter.ignore_install,
  4. matchup = {
  5. enable = true -- mandatory, false will disable the whole extension
  6. -- disable = { "c", "ruby" }, -- optional, list of language that will be disabled
  7. },
  8. highlight = {
  9. enable = O.treesitter.highlight.enabled -- false will disable the whole extension
  10. },
  11. context_commentstring = {enable = O.plugin.ts_context_commentstring, config = {css = '// %s'}},
  12. -- indent = {enable = true, disable = {"python", "html", "javascript"}},
  13. -- TODO seems to be broken
  14. indent = {enable = {"javascriptreact"}},
  15. autotag = {enable = true},
  16. playground = {
  17. enable = O.plugin.ts_playground.active,
  18. disable = {},
  19. updatetime = 25, -- Debounced time for highlighting nodes in the playground from source code
  20. persist_queries = false, -- Whether the query persists across vim sessions
  21. keybindings = {
  22. toggle_query_editor = 'o',
  23. toggle_hl_groups = 'i',
  24. toggle_injected_languages = 't',
  25. toggle_anonymous_nodes = 'a',
  26. toggle_language_display = 'I',
  27. focus_language = 'f',
  28. unfocus_language = 'F',
  29. update = 'R',
  30. goto_node = '<cr>',
  31. show_help = '?'
  32. }
  33. }
  34. }