init.lua 1.5 KB

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