feat(nvim): migrate nvim-treesitter
This commit is contained in:
@@ -81,12 +81,15 @@ local plugins = {
|
||||
},
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
branch = "main",
|
||||
dependencies = {
|
||||
"nvim-treesitter/nvim-treesitter-textobjects",
|
||||
"nushell/tree-sitter-nu",
|
||||
{
|
||||
branch = "main",
|
||||
"nvim-treesitter/nvim-treesitter-textobjects",
|
||||
},
|
||||
},
|
||||
config = function()
|
||||
require("nvim-treesitter.configs").setup(require("plugins.treesitter"))
|
||||
require("nvim-treesitter").setup(require("plugins.treesitter"))
|
||||
end,
|
||||
build = ":TSUpdate",
|
||||
},
|
||||
@@ -277,7 +280,10 @@ local plugins = {
|
||||
},
|
||||
{
|
||||
"MeanderingProgrammer/render-markdown.nvim",
|
||||
dependencies = { "nvim-treesitter/nvim-treesitter", "nvim-tree/nvim-web-devicons" },
|
||||
dependencies = {
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
"nvim-tree/nvim-web-devicons",
|
||||
},
|
||||
event = "BufEnter *.md",
|
||||
--- @type render.md.UserConfig
|
||||
opts = {
|
||||
|
||||
@@ -1,21 +1,15 @@
|
||||
--- @type TSConfig
|
||||
M = {
|
||||
auto_install = true,
|
||||
parser_install_dir = "$HOME/.local/share/nvim/lazy/nvim-treesitter",
|
||||
sync_install = true,
|
||||
modules = {},
|
||||
ignore_install = {},
|
||||
ensure_installed = {},
|
||||
|
||||
highlight = { enable = true },
|
||||
indent = { enable = true },
|
||||
install_dir = vim.fn.stdpath('data') .. '/site',
|
||||
}
|
||||
|
||||
vim.filetype.add({
|
||||
pattern = {
|
||||
[".*/hypr/.*%.conf"] = "hyprlang",
|
||||
[".*%.hl"] = "hyprlang",
|
||||
},
|
||||
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,
|
||||
})
|
||||
|
||||
return M
|
||||
|
||||
Reference in New Issue
Block a user