0203 update: Now it won't close any tab, but you can close it yourself
via (possibly many) :q
or one :tabclose
.
Please use NeoSplit
and NeoVSplit
commands to create new split so this plugin will work correctly. Here is an example:
---- Tmux-like window-split (and jumps).
vim.keymap.set('n', '<C-W>"', function () vim.cmd('NeoSplit') end, {nowait=true,silent=true,noremap=true})
vim.keymap.set('n', '<C-W>%', function () vim.cmd('NeoVSplit') end, {nowait=true,silent=true,noremap=true})
like_a_boss_demo.mov
Are you still using <C-W>o
to maximize a window split and DESTROY THE OTHER ONES under the same tab ๐ต? You should try NeoZoom.lua!
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, while NeoZoom.lua will do.:tab split
won't pin your current cursorline to 80% of the current height, while NeoZoom.lua will do to prevent you become a turtle ๐ข.:tab split
creates a new tab on any circumstance, while NeoZoom.luatabclose
one with a single window.
So NeoZoom.lua is more user friendly, you only need one key to zoom-in/out.
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 won't be close.
- NeoZoom.lua is very lightweight. It's almost impossible to have any conflict with those favorite plugins that 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.
- Cursor pos. is restored, after zoom-in
- Very Light-weight (27 lines, excluding non-logics)
- 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 :)
use {
'nyngwang/NeoZoom.lua'
}
Change <CR>
to whatever shortcut you like~
Recommended, I will keep track of this one to make sure it always works after any possible breaking change
-- if you use `<CR>` as toggle, then you should handle when to fallback yourself so it won't intercept the plain-old `<CR>`.
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 })
- 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