helix-editor / helix

A post-modern modal text editor.
https://helix-editor.com
Mozilla Public License 2.0
33.5k stars 2.48k forks source link

Add Focus Mode (not Zen Mode) #1844

Closed MarkuBu closed 6 months ago

MarkuBu commented 2 years ago

The Atom Editor has an addon called Focus Mode (not to be confused with Zen Mode from VSCode).

In Focus Mode the current scope (paragraph, loop, function and so on) is normally visible, the other code is dimmed.

https://github.com/davidleghorn/atom-focus-mode

This should be easily done with tree-sitter. The most interesting function is the scope focus mode. But the Atom addon is limited. I think it could be nice to change the level of highlighting like to show only the current if block or while loop, or the current block plus one level above, or the whole function.

I made some mockup examples with VSCode to show what I mean with the level of highlighting (this is part of the Helix code)

only the for() loop Screenshot_20220319_090342

the match Screenshot_20220319_090507

the whole function Screenshot_20220319_090533

slinlee commented 2 years ago

For reference, this is what I used in vim: https://github.com/junegunn/limelight.vim