20 lines
721 B
Lua
20 lines
721 B
Lua
vim.pack.add ({
|
|
'https://github.com/nvim-treesitter/nvim-treesitter'
|
|
})
|
|
|
|
require('nvim-treesitter').setup {
|
|
-- Directory to install parsers and queries to (prepended to `runtimepath` to have priority)
|
|
install_dir = vim.fn.stdpath('data') .. '/site'
|
|
}
|
|
-- Required parsers and queries
|
|
require('nvim-treesitter').install { 'lua', 'nix', 'javascript', 'html', 'css', 'c', 'cpp', 'python', 'kdl', 'markdown' }
|
|
|
|
-- Syntax highlighting
|
|
vim.api.nvim_create_autocmd('FileType', {
|
|
pattern = { 'lua', 'nix', 'javascript', 'html', 'css', 'c', 'cpp', 'python', 'kdl', 'markdown' },
|
|
callback = function() vim.treesitter.start() end,
|
|
})
|
|
|
|
-- Auto indentation
|
|
vim.bo.indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()"
|