pretty-fold.nvim
pretty-fold.nvim copied to clipboard
FR: highlight 'content'
Great Plugin!
Is there a way to highlight the 'content'? It'll make the function signature looks better
Same, would it be possible to have some simple colours in fold signature, it looks pretty dull right now
This could be implemented now, since https://github.com/neovim/neovim/pull/25209 has been merged.
I managed to do this in C, however it's nothing to do with pretty-fold plugin. If you do, tree sitter folding plugin this is an option: https://github.com/nvim-treesitter/nvim-treesitter/issues/1564
You need to add the following into config file:
vim.treesitter.query.set(
"c",
"folds",
[[
[
(switch_statement)
(case_statement)
(comment)
] @fold
(function_definition
type: (type_identifier) @fold
)
(function_definition
body: (compound_statement) @fold
)
]]
)
vim.treesitter.query.set(
"cpp",
"folds",
[[
[
(switch_statement)
(case_statement)
(comment)
(function_definition)
] @fold
]]
)
The above code folds this code:
Into:
An alternative approach was choosen upstream to support this: https://github.com/neovim/neovim/pull/20750/