63
votes
Accepted
What are the new "popup windows" in Vim 8.2?
Background: I have a plugin for navigating sections in markup documents and wanted to show the section hierarchy in a popup. I distilled what I learned while implementing this down to the following ...
3
votes
Accepted
Is it possible to scroll a popup via keyboard?
After some digging I found this great blog post by @fortime.
I adapted their code for my needs (fixed a bug and keep the scrollbar visible):
function! ScrollPopup(nlines)
let winids = popup_list()
...
2
votes
How to display stdout/stderr of a program as overlay?
Overlays as in video you have linked have nothing to do with vim (and probably neovim).
The only way vim can have something like overlay is to use popup windows. And they would only be able to show ...
2
votes
nvim popup vs vim popup
Beware that Vim popup is "modal". It can have a border and other stuff while omitting normal editing capabilities. That makes it to behave much like "a popup menu" and not a ...
2
votes
Accepted
How can I show the syntax-colored current line wrapped on top of current line in nowrap buffer?
So the trick was to use maxheight and compute it based on how much text is on the current line and how much space is in the terminal width.
With the following solution
function! Foo()
let ...
2
votes
Accepted
nvim: how to manually clear popups which do not clear themselves?
The api-floatwin documentation has this helpful tidbit of information:
To close [a floating window] use |nvim_win_close()| or a command such as |:close|.
To check whether a window is floating, check ...
2
votes
Accepted
How to unlist a terminal buffer opened in a popup window?
With the following code:
setbufvar(bufname(buf_no), 'buflisted', 0)
you are defining a buffer-local variable, b:buflisted with value 0, which is pointless because nothing is using it.
:help '...
2
votes
Accepted
Switch between multiple popup windows with win_gotoid()
In Vim popup can never become an active window. Instead it installs a filter function that intercepts key press before any active window sees it.
If you have several popups shown at the same time then ...
1
vote
Switch between multiple popup windows with win_gotoid()
The popup cannot have the keyboard focus:
The popup window contains a buffer, and that buffer is always associated with
the popup window. The window cannot be in Normal, Visual or Insert mode, it
does ...
1
vote
Accepted
Is It Allowed to Assign popup_create() To a Variable?
As pointed out in comments: the error message is about the function arguments (you can always :help EXXX with the error code you get). Specifically, popup_create expects options.border to be a list.
...
Community wiki
1
vote
Can you turn a popup into a regular buffer?
A bit of a hack, but if you can get the window ID of the popup (popup_create returns it; popup_locate or popup_list might help find it), you can get the buffer contents and create a new one:
const ...
1
vote
Adjust syntax highlighting of git/mercurial patch within a popup
Removing the syntax highlighting is easy. You're getting it because you're setting the 'filetype' of the buffer to git, which is loading those syntax definitions and applying them to the buffer you're ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
popup × 20vimscript × 4
neovim × 4
syntax-highlighting × 3
terminal-buffer × 3
popup-menu × 3
key-bindings × 2
terminal × 2
vim-windows × 2
wrapping × 2
buffers × 1
autocmd × 1
autocompletion × 1
cursor-movement × 1
insert-mode × 1
macvim × 1
scrolling × 1
line-numbers × 1
color × 1
plugin-coc × 1
font × 1
version-control-systems × 1