require'nvim-treesitter.configs'.setup {
  ensure_installed = { "bash", "c", "clojure", "cpp", "fennel", "fish", "haskell", "java", "javascript", "jsdoc", "json", "lua", "nix", "python", "query", "rust", "toml" },
  highlight   = { enable = true, },
  textobjects = {
    select = {
      enable  = true,
      keymaps = {
	["<Leader><Leader>ab"] = "@block.outer"      ,
	["<Leader><Leader>ib"] = "@block.inner"      ,
	["<Leader><Leader>aC"] = "@call.outer"       ,
	["<Leader><Leader>iC"] = "@call.inner"       ,
	["<Leader><Leader>ao"] = "@class.outer"      ,
	["<Leader><Leader>io"] = "@class.inner"      ,
	["<Leader><Leader>at"] = "@comment.outer"    ,
	["<Leader><Leader>ac"] = "@conditional.outer",
	["<Leader><Leader>ic"] = "@conditional.inner",
	["<Leader><Leader>af"] = "@function.outer"   ,
	["<Leader><Leader>if"] = "@function.inner"   ,
	["<Leader><Leader>al"] = "@loop.outer"       ,
	["<Leader><Leader>il"] = "@loop.inner"       ,
	["<Leader><Leader>ap"] = "@parameter.outer"  ,
	["<Leader><Leader>ip"] = "@parameter.inner"  ,
	["<Leader><Leader>is"] = "@scopename.inner"  ,
	["<Leader><Leader>as"] = "@statement.outer"  ,
      },
    },
  },
  query_linter = {
    enable           = true,
    use_virtual_text = true,
    lint_events      = { "BufWrite", "CursorHold" },
  },
}

require'nvim-treesitter.install'.compilers = { "gcc" }

require "nvim-treesitter.configs".setup {
  playground = {
    enable          = true,
    disable         = {},
    updatetime      = 25,
    persist_queries = false,
    keybindings = {
      toggle_query_editor       = 'o',
      toggle_hl_groups          = 'i',
      toggle_injected_languages = 't',
      toggle_anonymous_nodes    = 'a',
      toggle_language_display   = 'I',
      focus_language            = 'f',
      unfocus_language          = 'F',
      update                    = 'R',
      goto_node                 = '<CR>',
      show_help                 = '?',
    },
  }
}
