anuvyklack / pretty-fold.nvim

Foldtext customization in Neovim
Apache License 2.0
441 stars 21 forks source link

Option to always show preview of first line #15

Closed davidscotson closed 2 years ago

davidscotson commented 2 years ago

This may be a ridiculous request, but if it's possible without major downsides there's probably a lot of people who would appreciate it.

As you almost certainly know, one of the current limitations of vim folds is the ability to syntax highlight the folded text. Some people, like me, would like to emulate the feature of other editors, where the class or function signature remains visible and highlighted when the body of the class/function is folded.

There's a couple of in-depth issues with screenshots and technical background and partial implementations in the neovim and treesitter trackers:

https://github.com/neovim/neovim/issues/12649

https://github.com/nvim-treesitter/nvim-treesitter/pull/390

I noticed while using your plugin that you appear to have most of the elements in place already to do a decent version of this. Though I'm not familiar enough with vim floating windows to know if what I'm requesting is possible or not.

Ideally, I'd like the preview to always show the first line, effectively hiding the actual fold, and stay visible and move in sync with the rest of the code, with a visual effect similar to this screenshot of Atom that was posted in the treesitter issue linked above:

98057074-63a48080-1e0f-11eb-8fc5-795e5421adc5

anuvyklack commented 2 years ago

Interesting idea! I will check it.

adamency commented 12 months ago

@anuvyklack IIUC this has been closed without being implemented right ? I'm asking cause I don't see any option for it, nor any mention of it in the README, nor in the commit messages of the commits of June 28th 2022.