Skip to main content
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 ...
B Layer's user avatar
  • 20.1k
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() ...
deox's user avatar
  • 146
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 ...
Maxim Kim's user avatar
  • 13.9k
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 ...
Matt's user avatar
  • 21.6k
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 ...
Enlico's user avatar
  • 2,276
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 ...
Slade's user avatar
  • 228
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 '...
romainl's user avatar
  • 42.3k
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 ...
Matt's user avatar
  • 21.6k
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 ...
Vivian De Smedt's user avatar
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. ...
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 ...
D. Ben Knoble's user avatar
  • 27.7k
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 ...
filbranden's user avatar
  • 29.9k

Only top scored, non community-wiki answers of a minimum length are eligible