Skip to content

Instantly share code, notes, and snippets.

@saiashirwad
Created February 4, 2024 20:32
Show Gist options
  • Save saiashirwad/ee4e78c13589d887cc69dfe1c87cff64 to your computer and use it in GitHub Desktop.
Save saiashirwad/ee4e78c13589d887cc69dfe1c87cff64 to your computer and use it in GitHub Desktop.
treesitter.lua
local utils = require("utils")
return {
{
"nvim-treesitter/nvim-treesitter",
init = function()
utils.lazy_load("nvim-treesitter")
end,
cmd = { "TSInstall", "TSBufEnable", "TSBufDisable", "TSModuleInfo" },
build = ":TSUpdate",
opts = function()
return {
ensure_installed = { "lua" },
highlight = {
enable = true,
use_languagetree = true,
},
indent = {
enable = false,
},
incremental_selection = {
enable = true,
keymaps = {
init_selection = "<CR>",
node_incremental = "<CR>",
scope_incremental = false,
node_decremental = "<S-CR>",
},
},
}
end,
config = function(_, opts)
require("nvim-treesitter.configs").setup(opts)
end,
},
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment