From a8f6877e79ce7cb73d3dbe20ac6270a2d930893f Mon Sep 17 00:00:00 2001 From: Simon Walker Date: Mon, 18 Dec 2023 21:50:28 +0000 Subject: [PATCH] Unconditionally run treesitter configuration --- home/nvim/lua/treesitterconfig.lua | 56 +++++++++++++----------------- 1 file changed, 25 insertions(+), 31 deletions(-) diff --git a/home/nvim/lua/treesitterconfig.lua b/home/nvim/lua/treesitterconfig.lua index 29ec0592..0e7ba880 100644 --- a/home/nvim/lua/treesitterconfig.lua +++ b/home/nvim/lua/treesitterconfig.lua @@ -1,35 +1,29 @@ -local function setup() - local ts = require('nvim-treesitter.configs') +local ts = require('nvim-treesitter.configs') - ts.setup { - highlight = { - enable = true, - use_languagetree = true, - disable = { - "gitcommit", - }, - }, - indent = { - enable = false, +ts.setup { + highlight = { + enable = true, + use_languagetree = true, + disable = { + "gitcommit", }, - textobjects = { - select = { - enable = true, - lookahead = true, - keymaps = { - ["af"] = "@function.outer", - ["if"] = "@function.inner", - ["ac"] = "@class.outer", - ["ic"] = "@class.inner", - }, - include_surrounding_whitespace = function(query_string, selection_mode) - return query_string == "@function.outer" or query_string == "@class.outer" - end, + }, + indent = { + enable = false, + }, + textobjects = { + select = { + enable = true, + lookahead = true, + keymaps = { + ["af"] = "@function.outer", + ["if"] = "@function.inner", + ["ac"] = "@class.outer", + ["ic"] = "@class.inner", }, + include_surrounding_whitespace = function(query_string, selection_mode) + return query_string == "@function.outer" or query_string == "@class.outer" + end, }, - } -end - -if vim.fn.has('nvim-0.5') and vim.g.include_treesitter then - setup() -end + }, +}