I looked into the :h popup.txt
and unless i missed something, did not see any mention for setting a popup window on the left or right side.
PS: I'm on Vim 8.2 (latest compiled as of now)
Any example on how to do this?
Vi and Vim Stack Exchange is a question and answer site for people using the vi and Vim families of text editors. It only takes a minute to sign up.
Sign up to join this communityI looked into the :h popup.txt
and unless i missed something, did not see any mention for setting a popup window on the left or right side.
PS: I'm on Vim 8.2 (latest compiled as of now)
Any example on how to do this?
A popup window in Vim is a "floating" window, so it actually covers the current windows and the text in them.
You can set the line, column and adjust min/max width and height to have a popup cover the left or the right half of the screen.
For example, for a popup covering the left half of the screen:
let winid = popup_create('popup', {
\ 'line': 1,
\ 'col': 1,
\ 'minwidth': &columns / 2,
\ 'minheight': &lines - 1})
And one covering the right half:
let winid = popup_create('popup', {
\ 'line': 1,
\ 'col': &columns,
\ 'minwidth': &columns / 2,
\ 'minheight': &lines - 1,
\ 'pos': 'topright'})
See :help popup_create-arguments
for details on the arguments you can pass when creating a popup window.
center
and such on thepopup.txt
, which didn't really do the trick (not like the way your answer did!) that basically explain this i think. – Nordine Lotfi Sep 13 '20 at 23:17win_screenpos('.')
,winheight('.')
, etc. Keeping it in sync with the current window as it scrolls might be tricky too... And if the current window gets resized. Looks like a lot of work and many details to consider. I wish you luck in implementing your feature! – filbranden♦ Sep 13 '20 at 23:21