diff --git a/config/nvim/lua/config/options.lua b/config/nvim/lua/config/options.lua index d8584c0..cde62a7 100644 --- a/config/nvim/lua/config/options.lua +++ b/config/nvim/lua/config/options.lua @@ -2,6 +2,8 @@ require("onedark").load() local indent = 2 +vim.opt.updatetime = 100 + -- Tabstops vim.opt.expandtab = true vim.opt.shiftwidth = indent diff --git a/config/nvim/lua/config/plugins/tree-sitter.lua b/config/nvim/lua/config/plugins/tree-sitter.lua index d5f70f5..baac91f 100644 --- a/config/nvim/lua/config/plugins/tree-sitter.lua +++ b/config/nvim/lua/config/plugins/tree-sitter.lua @@ -1,36 +1,39 @@ -return { - highlight = { enable = true }, - indent = { enable = true }, - context_commentstring = { enable = true, enable_autocmd = false }, - ensure_installed = { - "bash", - "c", - "css", - "dockerfile", - "eex", - "elixir", - "help", - "html", - "javascript", - "json", - "lua", - "luadoc", - "luap", - "markdown", - "markdown_inline", - "python", - "query", - "regex", - "ruby", - "rust", - "scss", - "sql", - "swift", - "toml", - "tsx", - "typescript", - "vim", - "vue", - "yaml", - }, -} +return function() + require("nvim-treesitter.configs").setup({ + highlight = { enable = true }, + indent = { enable = true }, + context_commentstring = { enable = true }, + auto_install = true, + sync_install = false, + ensure_installed = { + "bash", + "c", + "css", + "dockerfile", + "eex", + "elixir", + "html", + "javascript", + "json", + "lua", + "luadoc", + "luap", + "markdown", + "markdown_inline", + "python", + "query", + "regex", + "ruby", + "rust", + "scss", + "sql", + "swift", + "toml", + "tsx", + "typescript", + "vim", + "vue", + "yaml", + }, + }) +end diff --git a/config/nvim/lua/plugins/tree-sitter.lua b/config/nvim/lua/plugins/tree-sitter.lua index 5008398..e587652 100644 --- a/config/nvim/lua/plugins/tree-sitter.lua +++ b/config/nvim/lua/plugins/tree-sitter.lua @@ -1,18 +1,15 @@ return { { "nvim-treesitter/nvim-treesitter", - build = ":TSUpdate", - event = { "BufReadPost", "BufNewFile" }, - dependencies = { { "nvim-treesitter/nvim-treesitter-textobjects", init = function() -- PERF: no need to load the plugin, if we only need its queries for mini.ai local plugin = - require("lazy.core.config").spec.plugins["nvim-treesitter"] + require("lazy.core.config").spec.plugins["nvim-treesitter"] local opts = require("lazy.core.plugin").values(plugin, "opts", false) local enabled = false if opts.textobjects then @@ -30,9 +27,8 @@ return { end end, }, + "JoosepAlviste/nvim-ts-context-commentstring", }, - - ---@type TSConfig - opts = require("config.plugins.tree-sitter"), + config = require("config.plugins.tree-sitter"), }, }