local ts_langs = { "bash", "c", "cpp", "diff", "fennel", "fish", "go", "haskell", "html", "java", "javascript", "jsdoc", "json", "lua", "markdown", "nix", "python", "query", "racket", "rust", "scheme", "toml", "tsx", "typescript", "verilog", "vim", "vimdoc" }

require'nvim-treesitter.install'.compilers = { "gcc" }
require'nvim-treesitter.configs'.setup {
  ensure_installed = ts_langs,
  highlight        = {
    enable = true,
    additional_vim_regex_highlighting = false,
  },
  query_linter = {
    enable           = true,
    use_virtual_text = true,
    lint_events      = { "BufWrite", "CursorHold" },
  },
  matchup = {
    enable = true,
  },
}

require "nvim-treesitter.parsers".get_parser_configs().lean = {
  filetype     = "lean",
  install_info = {
    url   = "~/GitSources/tree-sitter-lean",
    files = {"src/parser.c", "src/scanner.cc"},
  },
}

vim.keymap.set('o', '<Leader>m', ':<C-U>lua require(\'tsht\').nodes()<CR>', { noremap=false, unique=true, silent=true })
vim.keymap.set('x', '<Leader>m', ':lua require(\'tsht\').nodes()<CR>' , { noremap=true , unique=true, silent=true })
