NeoZoom.lua
DEMO
like_a_boss_demo.mov
Intro.
Are you still using <C-W>o
to maximize a window split and DESTROY THE OTHER ONES under the same tab
You can think of NeoZoom.lua as enhanced :tab split
, with these differences:
:tab split
won't restore your cursor position after you close the tab, but NeoZoom.lua will do.:tab split
creates a new tab on any circumstance, while NeoZoom.lua closes those ones with a single window.
So NeoZoom.lua is more user friendly, you only need one key to zoom-in/out. Since it is so lightweight (<100 lines including README.md), so that's it :)
Some more details:
- It zoom-in on any tab with more than one windows, and zoom-out on any tab with only one window. The last window in the last tab.
- NeoZoom.lua is very lightweight. It's almost impossible to have any conflict with those favorite plugins of you already installed.
- Floating window on cursor-hover (e.g. showing LSP Diagnostics message on cursor-hover) increases the number of windows, while this is taken into account.
- If you're using kyazdani42/nvim-tree.lua:
- You can open it after zoom-in.
- You can have it open before zoom-in. It will also be restored on zoom-out.
Features
- Cursor pos. is restored, after zoom-in
- Very Light-weight (23 lines, including the comics in comment.)
- No dependencies, but you had better know nothing about tabs.
- (For advance users) Floating window on cursor-hover (e.g. to show LSP line Diagnostics message) indeed increases window count, this case is covered by NeoZoom.lua :)
installation
Packer.nvim
use {
'nyngwang/NeoZoom.lua'
}
Usage
Change <CR>
to whatever shortcut you like~
Recommended, I will keep this one working in the future
-- this is to prevent the case you're also using `<cr>` for the toggle, and you use native quickfix list, so the `<cr>` will be intercepted :(
vim.api.nvim_set_keymap('n', '<CR>', "&ft != 'qf' ? '<cmd>NeoZoomToggle<CR>' : '<CR>'", { noremap=true, silent=true, nowait=true })
Simple one, If you never use quickfix list, pick this one
vim.api.nvim_set_keymap('n', '<CR>', '<cmd>NeoZoomToggle<CR>', { noremap=true, silent=true, nowait=true })
TODO list
- a better README.md
- add a DEMO
- add packer.nvim installation guide
- customizable shortcut
- config setup tutorial, must be simple and useful
- have to use
setup
function instead of the ugly_G.
something - add a exclusion list for those strange
buf/filetype
- have to use