helix-editor / helix

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

Feature Request: Centered code mode (like intellij's distraction free mode) #3203

Closed ldubos closed 4 months ago

ldubos commented 2 years ago

Hi, I find Intellij's "distaction free mode" really interesting, especially the fact of centering the code on the screen. I find it much less tiring than having to constantly look at the left side of the screen, which happens quite often with helix when you have only one window opened, because there is no sidebar which in an editor like VS Code center the code even if it's not the intention at the beginning.

So it could be cool to having an option in config file to allow the user to choose to center his code in the window, maybe with exception like when we are in split-screen.

an example of the feature (in vscode): image

AceofSpades5757 commented 2 years ago

I think this usually gets implemented as a plugin, like with goyo.vim for Vim. Different view options, or more control over the view would be nice.

archseer commented 1 year ago

Seems like it overlaps https://github.com/helix-editor/helix/issues/2262

sicher commented 1 year ago

For now you can do :set gutters.line-numbers.min-width 30 or whatever matches your terminal width, text-width and soft wrap settings.

gavales commented 9 months ago

For now you can do :set gutters.line-numbers.min-width 30 or whatever matches your terminal width, text-width and soft wrap settings.

TBH this will more than satisfy me for now, the way it behaves is what I desire, especially when combined with soft-wrap.wrap-at-text-width.

When a scripting language is implemented, you could easily write a plugin to calculate the correct gutters.line-numbers.min-width to centre the viewport. As long as the maximum value gutters.line-numbers.min-width doesn't get restricted like it is in vim, that is. :)