Hiding lualine in zen-mode #987
plum
started this conversation in
Configuration
Replies: 1 comment
-
whilst i wouldn't classify my method as a true solution, i do have a workaround. The main issue seems to be the execution order. Lualine needs to be hidden first, otherwise it just does not work.
if anyone is still interested. this is my code. --]] file: ...../plugins/zenmode.lua
--]] sourced: https://github.com/ThePrimeagen/init.lua/blob/master/lua/theprimeagen/lazy/zenmode.lua
local hide_winbar_tabs = function()
require('lualine').hide(
{
place = { 'tabline', 'winbar' }, -- The segment this change applies to.
unhide = false,
})
end
return {
"folke/zen-mode.nvim",
config = function()
vim.keymap.set("n", "<leader>zz", function()
hide_winbar_tabs()
require("zen-mode").setup {
window = {
width = 110,
options = {}
},
-- callback when the Zen window opens
-- this callback is just incapable of hiding lualine
-- useless
on_open = function()
vim.cmd("echo 'ZenMode opened'")
-- vim.cmd("lua require('lualine').hide()")
-- hide_winbar_tabs()
end,
-- callback when the Zen window closes
on_close = function()
require('lualine').hide({
-- place = { 'tabline', 'winbar' }, -- The segment this change applies to.
unhide = true, -- whether to re-enable lualine again/
})
vim.cmd("echo 'ZenMode closed'")
end,
}
require("zen-mode").toggle()
vim.wo.number = true
vim.wo.rnu = true
end)
}
NOTE:
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Please do tell me what I'm doing wrong here!
When I invoke zen-mode, lualine fails to disappear.
In plugins/zenmode.lua , I have written the following code:
I am fresh to lua code, and am struggling with this after may attempts. Meanwhile I am studying the examples presented here, and the vim-lua guide making my way through the lua wiki tutorials.
i did manage to get lualine hiding with goyo , which appears to be a little more complicated. However, I apprecoiate zen-mode because is written in lua.
Here below, I have modelled a zenmode.lua plugin based on my successful goyo effort, but it too fails to hide the lualine:
Help will spur me on!
John
Beta Was this translation helpful? Give feedback.
All reactions