aboutsummaryrefslogtreecommitdiffstats
path: root/neovim/.config/nvim/lua/plugins/treesitter.lua
blob: 875500fb3adf696304d2cc8a503dc55d75e185da (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
return {
  "nvim-treesitter/nvim-treesitter",
  branch = "main",
  build = ":TSUpdate",
  config = function()
    require("nvim-treesitter").install({
      "lua",
      "vim",
      "vimdoc",
      "query",
      "python",
      "bash",
      "yaml",
      "hcl",
      "terraform",
      "html",
      "css",
      "javascript",
      "typescript",
      "tsx",
      "json",
      "markdown",
      "markdown_inline",
    })

    -- Enable highlighting for any buffer whose filetype has an installed
    -- parser; vim.treesitter.start() is a no-op (caught by pcall) otherwise.
    vim.api.nvim_create_autocmd("FileType", {
      pattern = "*",
      callback = function()
        pcall(vim.treesitter.start)
      end,
    })
  end,
}