Vsplit has different size
beautiful-boyyy opened this issue · 3 comments
I think you mean that the preview pane is split alongside neovim instead of in the nnn floating window?
Unfortunately I don't think there's anything we can do about that if you rely on kitty splits. The only way that I know of that will open the preview split inside the floating window is with tmux new-session nnn -Pp
(granted that you are not running neovim itself inside a tmux session). I think this should work even inside kitty.
Oh I guess you actually mean the final state of the nvim splits that are uneven after opening a file.
Not something we can really fix either I don't think. The preview-tui
kitty split is closed when the neovim split is already created, after which the neovim splits are resized, adding the new available width to the rightmost window (determined by neovim itself).
If you want to keep using the kitty preview pane, the best you could do is to perhaps create a mapping that opens the file and equalizes the windows: <Enter><C-w>=
, not sure if that will work. Alternatively, relying on tmux
splits with tmux new-session nnn -Pp
instead should prevent both issues.
Oh I guess you actually mean the final state of the nvim splits that are uneven after opening a file.
Not something we can really fix either I don't think. The
preview-tui
kitty split is closed when the neovim split is already created, after which the neovim splits are resized, adding the new available width to the rightmost window (determined by neovim itself).If you want to keep using the kitty preview pane, the best you could do is to perhaps create a mapping that opens the file and equalizes the windows:
<Enter><C-w>=
, not sure if that will work. Alternatively, relying ontmux
splits withtmux new-session nnn -Pp
instead should prevent both issues.
Thanks for you idea. Tmux uses uberzug to preview img but it cannot work on macos, it's the reason I chose kitty. Well, I add a VimResize event to equalize all win width and then solved my problem.
local function open_in_vsplit(files)
builtin.open_in_vsplit(files)
api.nvim_create_autocmd('VimResized', {
pattern = '*',
callback = function() vim.cmd('horizontal wincmd =') end,
once = true
})
end