pocco81 / true-zen.nvim

🦝 Clean and elegant distraction-free writing for NeoVim
GNU General Public License v3.0
984 stars 30 forks source link

Is It Possible to Toggle the Tmux StatusBar for Only the Window TrueZen is Running In? #48

Closed FOSSilizedDaemon closed 3 years ago

FOSSilizedDaemon commented 3 years ago

Essentially the title. I often find myself getting mixed up as a byproduct of the status bar being turned off when I am working on many things in one tmux session. Is it possible to only toggle the bar for the specific window truezen is running in?

pocco81 commented 3 years ago

Well yes and no... but, why would you want to do that? Keep in mind that tmux's statusbar, unlike nvim's, is one chunk of the terminal and is not on a window basis. Yeah you can hide it and all but it wouldn't feel "natural" because that one chunk of the screen will disappear and reaper every time, making things jump around. I personally wouldn't do this, but here it is in case you want to try it for yourself:

using TrueZen's built-in events:

local truezen = require("true-zen")

true_zen.after_mode_ataraxis_on = function()
    vim.api.nvim_exec(
        [[
            aug truezen_integration_tmux
                au!
                au FocusLost * execute "lua require'true-zen.services.integrations.tmux'.enable_element()"
                au FocusGained * execute "lua require'true-zen.services.integrations.tmux'.disable_element()"
            aug END
        ]],
        false
    )
end

true_zen.after_mode_ataraxis_off = function()
    vim.api.nvim_exec([[
        aug truezen_integration_tmux
            au!
        aug END
    ]], false)
end

Here is how it looks:

https://user-images.githubusercontent.com/58336662/127886647-1721ed3a-de19-44a9-a699-9da5ff992b62.mp4

You're welcome :+1: