Many things are working
This commit is contained in:
parent
c42f197307
commit
4582bd5469
20 changed files with 715 additions and 300 deletions
56
lua/plugins/treesitter.lua
Normal file
56
lua/plugins/treesitter.lua
Normal file
|
@ -0,0 +1,56 @@
|
|||
return {
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
dependencies = { "windwp/nvim-ts-autotag", "JoosepAlviste/nvim-ts-context-commentstring" },
|
||||
init = function()
|
||||
U.cmd_executable("tree-sitter", {
|
||||
[false] = function()
|
||||
vim.notify("tree-sitter not installed, code syntax will be broken.", 2)
|
||||
end,
|
||||
})
|
||||
end,
|
||||
event = "BufRead",
|
||||
cmd = {
|
||||
"TSBufDisable",
|
||||
"TSBufEnable",
|
||||
"TSBufToggle",
|
||||
"TSDisable",
|
||||
"TSEnable",
|
||||
"TSToggle",
|
||||
"TSInstall",
|
||||
"TSInstallInfo",
|
||||
"TSInstallSync",
|
||||
"TSModuleInfo",
|
||||
"TSUninstall",
|
||||
"TSUpdate",
|
||||
"TSUpdateSync",
|
||||
},
|
||||
opts = function()
|
||||
local nonNixOpts = {}
|
||||
if not NIX then
|
||||
nonNixOpts = {
|
||||
ensure_installed = "all",
|
||||
}
|
||||
end
|
||||
return U.assign({
|
||||
highlight = {
|
||||
enable = true,
|
||||
use_languagetree = true,
|
||||
disable = function(_, bufnr)
|
||||
return vim.api.nvim_buf_line_count(bufnr) > 10000
|
||||
end,
|
||||
-- additional_vim_regex_highlighting = false,
|
||||
},
|
||||
incremental_selection = { enable = true },
|
||||
ident = { enable = true },
|
||||
autotag = { enable = true },
|
||||
rainbow = {
|
||||
enable = true,
|
||||
extended_mode = true,
|
||||
max_file_lines = nil,
|
||||
},
|
||||
}, nonNixOpts)
|
||||
end,
|
||||
config = function(_, opts)
|
||||
require("nvim-treesitter.configs").setup(opts)
|
||||
end,
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue