From 77aaeef71cc47f67751c29d944aab56053fdc17b Mon Sep 17 00:00:00 2001 From: goodhumored Date: Mon, 20 Jan 2025 12:42:42 +0300 Subject: [PATCH] feat: neozoom settings adjusted - fullscreen - no border - allow terminal - opacity on unfocus --- .../goodhumored/comfort-features/neozoom.lua | 33 ++++++++++++++++--- 1 file changed, 28 insertions(+), 5 deletions(-) diff --git a/.config/nvim/lua/goodhumored/comfort-features/neozoom.lua b/.config/nvim/lua/goodhumored/comfort-features/neozoom.lua index 6787d10..fa4eed7 100644 --- a/.config/nvim/lua/goodhumored/comfort-features/neozoom.lua +++ b/.config/nvim/lua/goodhumored/comfort-features/neozoom.lua @@ -11,18 +11,18 @@ return { -- exclude_filetypes = {}, -- exclude_buftypes = {}, -- }, - exclude_buftypes = { "terminal" }, + -- exclude_buftypes = { "terminal" }, -- exclude_filetypes = { 'lspinfo', 'mason', 'lazy', 'fzf', 'qf' }, winopts = { offset = { -- NOTE: omit `top`/`left` to center the floating window vertically/horizontally. -- top = 0, -- left = 0.17, - width = 150, - height = 0.85, + width = 1.0, + height = 1.0, }, -- NOTE: check :help nvim_open_win() for possible border values. - border = "thicc", -- this is a preset, try it :) + border = "none", -- this is a preset, try it :) }, presets = { { @@ -41,9 +41,32 @@ return { }, }, }, + callbacks = { + function() + if vim.wo.winhl == "" then + vim.wo.winhl = "Normal:" + end + end, + }, }) - vim.keymap.set("n", "", function() + vim.keymap.set("n", "F", function() vim.cmd("NeoZoomToggle") end, { silent = true, nowait = true }) + vim.api.nvim_create_autocmd({ "WinEnter" }, { + group = curfile_augroup, + callback = function() + local did_zoom = require("neo-zoom").did_zoom() + if not did_zoom[1] then + return + end + + -- wait for upstream: https://github.com/neovim/neovim/issues/23542. + if vim.api.nvim_get_current_win() == did_zoom[2] then + vim.api.nvim_win_set_option(did_zoom[2], "winbl", 0) + else + vim.api.nvim_win_set_option(did_zoom[2], "winbl", 25) + end + end, + }) end, }