got folding range to work
This commit is contained in:
parent
56f3aa2982
commit
212098b6e7
1 changed files with 15 additions and 0 deletions
|
@ -14,9 +14,24 @@
|
||||||
foldcolumn = "1";
|
foldcolumn = "1";
|
||||||
foldlevelstart = 99;
|
foldlevelstart = 99;
|
||||||
foldenable = true;
|
foldenable = true;
|
||||||
|
foldmethod = "expr";
|
||||||
|
#Default to treesitter folding
|
||||||
|
foldexpr = "v:lua.vim.treesitter.foldexpr()";
|
||||||
};
|
};
|
||||||
|
|
||||||
autocmds = [
|
autocmds = [
|
||||||
|
{
|
||||||
|
event = ["LspAttach"];
|
||||||
|
callback = pkgs.lib.generators.mkLuaInline ''
|
||||||
|
function(args)
|
||||||
|
local client = vim.lsp.get_client_by_id(args.data.client_id)
|
||||||
|
if client:supports_method('textDocument/foldingRange') then
|
||||||
|
local win = vim.api.nvim_get_current_win()
|
||||||
|
vim.wo[win][0].foldexpr = 'v:lua.vim.lsp.foldexpr()'
|
||||||
|
end
|
||||||
|
end
|
||||||
|
'';
|
||||||
|
}
|
||||||
];
|
];
|
||||||
theme = {
|
theme = {
|
||||||
name = "catppuccin";
|
name = "catppuccin";
|
||||||
|
|
Loading…
Reference in a new issue