Maximize Neovim windows.
- Toggle maximizing the current window without any ugly borders.
- Has builtin integration for the following plugins:
- aerial.nvim
- nvim-dap-ui
- nvim-tree.lua
- Neovim >= 0.8.0 (use a tagged version for older Neovim versions)
Install with your favourite plugin manager and run the setup function.
use {
'declancm/maximize.nvim',
config=function() require('maximize').setup() end
}return {
'declancm/maximize.nvim',
config=true
}Toggle maximizing the current window:
:Maximize
Toggle maximizing the current window:
require('maximize').toggle()Maximize the current window:
require('maximize').maximize()Restore windows:
require('maximize').restore()
A settings table can be passed into the setup function for custom options.
{
plugins= {
aerial= { enable=true }, -- enable aerial.nvim integrationdapui= { enable=true }, -- enable nvim-dap-ui integrationtree= { enable=true }, -- enable nvim-tree.lua integration
}
}The following user events are triggered:
- WindowMaximizeStart: before maximizing
- WindowRestoreEnd: after restoring
Use the variable vim.t.maximized to check whether the tab has a maximized window.
localfunctionmaximize_status()
returnvim.t.maximizedand' ' or''endrequire('lualine').setup {
sections= {
lualine_c= { maximize_status }
}
}-- ~/.config/nvim/lua/winbar.lualocalM= {}
M.maximize_status=function()
returnvim.t.maximizedand' ' or''endreturnM-- ~/.config/nvim/init.luavim.o.winbar="%{%v:lua.require('winbar').maximize_status()%}"