From f43e1b9df75ad764171bb288cc7966c2a7c34a29 Mon Sep 17 00:00:00 2001 From: Zoe Roux Date: Thu, 26 Dec 2024 12:10:02 +0100 Subject: [PATCH] Configure treesitter --- nvim/lua/plugins/treesitter.lua | 22 ++++++++++++++++++++++ nvim/lua/settings.lua | 1 + 2 files changed, 23 insertions(+) create mode 100644 nvim/lua/plugins/treesitter.lua diff --git a/nvim/lua/plugins/treesitter.lua b/nvim/lua/plugins/treesitter.lua new file mode 100644 index 0000000..2e5174f --- /dev/null +++ b/nvim/lua/plugins/treesitter.lua @@ -0,0 +1,22 @@ +return { + { + "nvim-treesitter", + lazy = false, + load = function() end, + event = { "BufReadPost", "BufWritePost", "BufNewFile" }, + opts = { + highlight = { + enable = true, + additional_vim_regex_highlighting = false, + }, + indent = { + enable = true + } + }, + after = function(plug) + require("nvim-treesitter.configs").setup(plug.opts) + vim.wo.foldmethod = 'expr' + vim.wo.foldexpr = 'v:lua.vim.treesitter.foldexpr()' + end + }, +} diff --git a/nvim/lua/settings.lua b/nvim/lua/settings.lua index 550a675..7d6dd58 100644 --- a/nvim/lua/settings.lua +++ b/nvim/lua/settings.lua @@ -18,6 +18,7 @@ vim.opt.splitbelow = true vim.opt.inccommand = 'split' vim.opt.wrap = false +vim.opt.foldlevelstart = 99 vim.opt.linebreak = true vim.opt.shiftwidth = 4 vim.opt.tabstop = 4