maximize.nvim
maximize.nvim copied to clipboard
Maximize window splits. A Neovim plugin written in Lua!
maximize.nvim
Maximize neovim windows.
⨠Features
- Use
<leader>z
to toggle maximizing the current neovim window without any of the ugly borders that other maximizing plugins create. - Works with plugins such as 'nvim-scrollview', which have floating windows (unlike other maximizing plugins).
đĻ Installation
Install with your favourite plugin manager and run the setup function.
Packer
use {
'declancm/maximize.nvim',
config = function() require('maximize').setup() end
}
âī¸ Configuration
A settings table can be passed into the setup function for custom options.
Default Settings
default_keymaps = true -- Enable default keymaps.
â¨ī¸ Keymaps
Default Keymaps
vim.keymap.set('n', '<Leader>z', "<Cmd>lua require('maximize').toggle()<CR>")
đĨ statusline & winbar
Use the tabpage-scoped variable vim.t.maximized
to check whether the current window
is maximized or not.
Lualine
local function maximize_status()
return vim.t.maximized and ' ī ' or ''
end
require('lualine').setup {
sections = {
lualine_c = { maximize_status }
}
}
winbar
-- ~/.config/nvim/lua/winbar.lua
local M = {}
M.maximize_status = function()
return vim.t.maximized and ' ī ' or ''
end
return M
-- ~/.config/nvim/init.lua
vim.o.winbar = "%{%v:lua.require('winbar').maximize_status()%}"
âšī¸ API
-
Toggle maximizing the current window:
require('maximize').toggle()
-
Maximize the current window:
require('maximize').maximize()
-
Restore windows:
require('maximize').restore()