initial commit
This commit is contained in:
commit
6491e91ec5
37 changed files with 1116 additions and 0 deletions
27
nvim/lua/plugins/treesitter.lua
Normal file
27
nvim/lua/plugins/treesitter.lua
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
return {
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
lazy = false,
|
||||
build = ":TSUpdate",
|
||||
opts = {
|
||||
install_dir = vim.fn.stdpath("data") .. "/site",
|
||||
},
|
||||
config = function()
|
||||
-- Install specified languages for Treesitter
|
||||
require("nvim-treesitter").install({ "rust", "javascript", "python", "fish", "ssh_config" }):wait(300000)
|
||||
|
||||
-- Enable Treesitter highlighting for specified file types
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
pattern = { "javascript", "rust", "python", "lua" },
|
||||
callback = function()
|
||||
vim.treesitter.start() -- Start Treesitter highlighting
|
||||
end,
|
||||
})
|
||||
|
||||
-- Set up Treesitter-based folding
|
||||
vim.wo.foldexpr = "v:lua.vim.treesitter.foldexpr()"
|
||||
vim.wo.foldmethod = "expr"
|
||||
|
||||
-- Enable Treesitter-based indentation
|
||||
vim.bo.indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()"
|
||||
end,
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue