feat: initial commit
- basic config according to spec
This commit is contained in:
commit
9b0446c5f6
36 files changed
+1114
No files matched your search
@@ -0,0 +1,57 @@
|
||||
-- nvim-treesitter (main branch) only installs parsers. Highlighting, folds and
|
||||
-- indent are started natively per buffer.
|
||||
local parsers = {
|
||||
slim = { "lua", "nix", "bash", "yaml", "json", "markdown" },
|
||||
full = {
|
||||
"lua",
|
||||
"vim",
|
||||
"vimdoc",
|
||||
"query",
|
||||
"nix",
|
||||
"bash",
|
||||
"yaml",
|
||||
"json",
|
||||
"toml",
|
||||
"markdown",
|
||||
"markdown_inline",
|
||||
"rust",
|
||||
"go",
|
||||
"gomod",
|
||||
"typescript",
|
||||
"tsx",
|
||||
"javascript",
|
||||
"python",
|
||||
"php",
|
||||
"html",
|
||||
"css",
|
||||
"dockerfile",
|
||||
"gitcommit",
|
||||
"diff",
|
||||
},
|
||||
}
|
||||
|
||||
return {
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
branch = "main",
|
||||
lazy = false, -- main branch does not support lazy loading
|
||||
build = ":TSUpdate",
|
||||
config = function()
|
||||
require("nvim-treesitter").install(parsers[vim.g.profile])
|
||||
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
group = vim.api.nvim_create_augroup("plugins.treesitter", { clear = true }),
|
||||
callback = function(ev)
|
||||
if vim.b[ev.buf].bigfile or not pcall(vim.treesitter.start, ev.buf) then
|
||||
return
|
||||
end
|
||||
vim.bo[ev.buf].indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()"
|
||||
vim.wo.foldmethod = "expr"
|
||||
vim.wo.foldexpr = "v:lua.vim.treesitter.foldexpr()"
|
||||
end,
|
||||
})
|
||||
end,
|
||||
},
|
||||
-- Supplies @function/@class queries; mini.ai builds the text objects.
|
||||
{ "nvim-treesitter/nvim-treesitter-textobjects", branch = "main", lazy = true },
|
||||
}
|
||||
Reference in new issue
Block a user