| ... | @@ -14,9 +14,24 @@ | ... | @@ -14,9 +14,24 @@ |
| 14 | foldcolumn = "1"; | 14 | foldcolumn = "1"; |
| 15 | foldlevelstart = 99; | 15 | foldlevelstart = 99; |
| 16 | foldenable = true; | 16 | foldenable = true; |
| | 17 | foldmethod = "expr"; |
| | 18 | #Default to treesitter folding |
| | 19 | foldexpr = "v:lua.vim.treesitter.foldexpr()"; |
| 17 | }; | 20 | }; |
| 18 | | 21 | |
| 19 | autocmds = [ | 22 | autocmds = [ |
| | 23 | { |
| | 24 | event = ["LspAttach"]; |
| | 25 | callback = pkgs.lib.generators.mkLuaInline '' |
| | 26 | function(args) |
| | 27 | local client = vim.lsp.get_client_by_id(args.data.client_id) |
| | 28 | if client:supports_method('textDocument/foldingRange') then |
| | 29 | local win = vim.api.nvim_get_current_win() |
| | 30 | vim.wo[win][0].foldexpr = 'v:lua.vim.lsp.foldexpr()' |
| | 31 | end |
| | 32 | end |
| | 33 | ''; |
| | 34 | } |
| 20 | ]; | 35 | ]; |
| 21 | theme = { | 36 | theme = { |
| 22 | name = "catppuccin"; | 37 | name = "catppuccin"; |