folke / zen-mode.nvim

🧘 Distraction-free coding for Neovim
Apache License 2.0
1.69k stars 47 forks source link

feat(statusline): Turn on/off statusline in zen mode #101

Closed vladimir-popov closed 1 year ago

vladimir-popov commented 1 year ago

Closes https://github.com/folke/zen-mode.nvim/issues/47

Feature: This PR brings an option to show statusline in zen mode, but only if laststatus == 3, that is when global statusline is used. This done because showing statusline per window would look weird and only global mode looks reasonable.

Also, it's possible to manage statusline visibility only for zen mode changing configuration:

{
   ...
  plugins = {
    -- disable some global vim options (vim.o...)
    -- comment the lines to not apply the options
    options = {
      enabled = true,
       ...
      -- you may turn on/off statusline in zen mode by setting the 'laststatus' 
      -- statusline will be shown only if 'laststatus' == 3
      laststatus = 0, -- turn off statusline in zen mode
    }
...
}

Preview

Screenshot 2023-10-05 at 12 59 30
folke commented 1 year ago

thanks!

devidw commented 1 month ago

Hey @vladimir-popov, Is it expected that the left and right side become blacked out and the wallpaper/background color is not visible when setting laststatus=3?

vladimir-popov commented 1 month ago

Hi, @devidw ! I don't think the laststatus is a reason here. I don't know how exactly transparency works in neovim (I've never used it), it seems that the ZenBg highlight determines the color of the background window. Adjusting this highlight might resolve the problem.