kevinhwang91 / nvim-ufo

Not UFO in the sky, but an ultra fold in Neovim.
BSD 3-Clause "New" or "Revised" License
2.16k stars 37 forks source link

Turn off automatic folds #136

Closed kaddkaka closed 1 year ago

kaddkaka commented 1 year ago

Feature description

The automatic fold is scary and makes things "jump around" as if alive, especially the automatic close of folds is something I want to avoid. I would prefer to create/open/close them manually.

I'm really just interested in getting folds to include the newline just before the fold, such that:

# Banana
  Some say this isn't even a fruit.
  Usually yellow.
# Apple
  Another kind of fruit.

Can fold into

# Banana ⋯
# Apple ⋯

With preserved syntax highlight for the unfolded # Banana part.

Describe the solution you'd like

Manual folding where the folded text does not occupy it's own line but rather just a few characters on the previous line.

If it's not configurable with ufo, what part of the code should I study to roll this behavior by myself?

Additional context

No response

kevinhwang91 commented 1 year ago

https://github.com/kevinhwang91/nvim-ufo/issues/125#issuecomment-1499262567 is what you should review.

kaddkaka commented 1 year ago

@kevinhwang91 Sorry I'm not sure I could find anything of relevance. The folds are correct (look good) with indent provider - I just don't want them to be automatic.

kevinhwang91 commented 1 year ago

https://github.com/kevinhwang91/nvim-ufo/blob/45aede6f5c4981156df3ddeeae01c4290e43e104/doc/example.lua#L15

realtica commented 6 months ago

Same here, please I do not understand why the folding is automatic.. This is an amazing plugin but we need to Manual folding.