start treesitter highlighting

ts-hglt
Miroito 2 months ago
parent 6131006a3e
commit 099ab02b37

@ -11,10 +11,19 @@ vim.api.nvim_create_autocmd('PackChanged', {
end end
}) })
vim.api.nvim_create_autocmd('FileType', {
callback = function()
-- Enable treesitter highlighting and disable regex syntax
pcall(vim.treesitter.start)
-- Enable treesitter-based indentation
vim.bo.indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()"
end,
})
vim.pack.add({ vim.pack.add({
{ src = 'https://github.com/nvim-treesitter/nvim-treesitter', name = 'treesitter', branch = 'main' }, { src = 'https://github.com/nvim-treesitter/nvim-treesitter', name = 'treesitter', branch = 'main' },
{ src = 'https://github.com/nvim-treesitter/nvim-treesitter-context', name = 'treesitter-context' }, { src = 'https://github.com/nvim-treesitter/nvim-treesitter-context', name = 'treesitter-context' },
{ src = 'https://github.com/nvim-treesitter/nvim-treesitter-textobjects', name = 'treesitter-textobjects' }, { src = 'https://github.com/nvim-treesitter/nvim-treesitter-textobjects', name = 'treesitter-textobjects', branch = 'main' },
}) })
require("nvim-treesitter").setup() require("nvim-treesitter").setup()

@ -14,7 +14,7 @@
"version": "1.0.0 - 2.0.0" "version": "1.0.0 - 2.0.0"
}, },
"conform.nvim": { "conform.nvim": {
"rev": "086a40dc7ed8242c03be9f47fbcee68699cc2395", "rev": "dca1a190aa85f9065979ef35802fb77131911106",
"src": "https://github.com/stevearc/conform.nvim" "src": "https://github.com/stevearc/conform.nvim"
}, },
"friendly-snippets": { "friendly-snippets": {
@ -26,11 +26,11 @@
"src": "https://github.com/tpope/vim-fugitive" "src": "https://github.com/tpope/vim-fugitive"
}, },
"gitsigns": { "gitsigns": {
"rev": "8d82c240f190fc33723d48c308ccc1ed8baad69d", "rev": "6d808f99bd63303646794406e270bd553ad7792e",
"src": "https://github.com/lewis6991/gitsigns.nvim" "src": "https://github.com/lewis6991/gitsigns.nvim"
}, },
"nvim-lspconfig": { "nvim-lspconfig": {
"rev": "4b7fbaa239c5db6b36f424a4521ca9f1a401be33", "rev": "31026a13eefb20681124706a79fc1df6bf11ab27",
"src": "https://github.com/neovim/nvim-lspconfig" "src": "https://github.com/neovim/nvim-lspconfig"
}, },
"plenary": { "plenary": {
@ -38,7 +38,7 @@
"src": "https://github.com/nvim-lua/plenary.nvim" "src": "https://github.com/nvim-lua/plenary.nvim"
}, },
"telescope": { "telescope": {
"rev": "471eebb1037899fd942cc0f52c012f8773505da1", "rev": "506338434fec5ad19cb1f8d45bf92d66c4917393",
"src": "https://github.com/nvim-telescope/telescope.nvim" "src": "https://github.com/nvim-telescope/telescope.nvim"
}, },
"tokyonight": { "tokyonight": {

Loading…
Cancel
Save