From d1aade11b5d39ebfe9c54e28e2323d92dcc79d38 Mon Sep 17 00:00:00 2001 From: peturparkur <61064454+peturparkur@users.noreply.github.com> Date: Mon, 25 Aug 2025 20:55:30 +0200 Subject: [PATCH] almost no-op (#8) * add folding * no more fold --- lua/kickstart/plugins/lsp.lua | 5 +++++ lua/kickstart/plugins/treesitter.lua | 9 +++++++++ 2 files changed, 14 insertions(+) diff --git a/lua/kickstart/plugins/lsp.lua b/lua/kickstart/plugins/lsp.lua index 2a9bfab3..3ae4bf3b 100644 --- a/lua/kickstart/plugins/lsp.lua +++ b/lua/kickstart/plugins/lsp.lua @@ -167,6 +167,11 @@ return { vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled { bufnr = event.buf }) end, '[T]oggle Inlay [H]ints') end + + if client and client_supports_method(client, 'textDocument/foldingRange', event.buf) then + -- local win = vim.api.nvim_get_current_win() + -- vim.wo[win][0].foldexpr = 'v:lua.vim.lsp.foldexpr()' + end end, }) diff --git a/lua/kickstart/plugins/treesitter.lua b/lua/kickstart/plugins/treesitter.lua index bbc032a4..d37a3565 100644 --- a/lua/kickstart/plugins/treesitter.lua +++ b/lua/kickstart/plugins/treesitter.lua @@ -15,6 +15,15 @@ return { -- Highlight, edit, and navigate code -- indent = { enable = true, disable = { 'ruby' } }, }, config = function(_, opts) + -- fold method to be function / treesitter + -- vim.o.foldmethod = 'expr' + -- Default to treesitter folding + -- vim.o.foldexpr = 'v:lua.vim.treesitter.foldexpr()' + -- vim.o.foldenable = false + vim.opt.foldnestmax = 4 + vim.opt.foldlevel = 99 + vim.opt.foldlevelstart = 1 + -- [[ Configure Treesitter ]] See `:help nvim-treesitter` -- Prefer git instead of curl in order to improve connectivity in some environments