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
6 votes
Accepted

Popup border is ugly, how can I make it look nice?

The border depends on 'encoding' and 'ambiwidth'. From the docs: By default a double line is used all around when 'encoding' is "utf-8" and 'ambiwidth' is "single", otherwise ASCII characters are ...
Ralf's user avatar
  • 9,417
5 votes
Accepted

Disabling hint popup

let g:ycm_auto_hover='' This disables the popup.
digital_revenant's user avatar
5 votes
Accepted

How to open folds in a pedit-preview popup window?

What I've tried is a exe ':'.pupid.'windo norm! zi' however the command fails upfront with and 'Invalid range` error. The pupid is being obtained via popup_findpreview() and is correct. That's ...
user938271's user avatar
  • 6,032
3 votes
Accepted

Display file contents in a popup window upon pressing a key?

I've done something similar before. I was learning Vim's fold commands. I just stuffed my cheat sheet in a string that separated each line with a comma... let g:foldcmds = split("zf (Plus a ...
B Layer's user avatar
  • 20.1k
3 votes

How to gF (go to file Particular line) to popup window?

You can use any of the popup_* functions that open popups with a buffer number, so, let bufnr = bufadd(expand('<cfile>')) let popup_id = popup_create (bufnr, {})
D. Ben Knoble's user avatar
  • 27.7k
2 votes

Unmap <c-n> / <c-p> in completion menu to use as previous / next snippet placeholder with Coc

Hey not a long time ago I was also looking to have the same setup as yours and ended up with this config. Although I ended up using <c-j> and <c-k> for navigating the completion list and ...
mackarelfish's user avatar
2 votes

Sync cursors of popup window and current window

I've had some success by creating the popup window without focus: let m = range(50) \ ->map({_, i -> string(i)}) \ ->popup_create(#{ \ line: 1, \ col: 1, \ ...
filbranden's user avatar
  • 29.9k
2 votes
Accepted

Sync cursors of popup window and current window

I tried using windo set scrollbind, but this doesn't work on a popup window (as far as i know). It cannot work because :windo only works on windows which have a number; popup windows don't. Any ways ...
user938271's user avatar
  • 6,032
2 votes
Accepted

Scrolling down in popup window not working as intended

Try to limit the height of the popup, at least 1 line less than the height of the terminal window, by including this key in the options dictionary passed to popup_create(): maxheight: &lines - 1 ...
user938271's user avatar
  • 6,032
2 votes
Accepted

How to set cursor position in a popup buffer?

Your example is trying to mimic popup menu by popup window, it's complicate, I changed it to use arrow keys to scroll popup window in normal mode, it's only purpose is to show you how to change cursor ...
dedowsdi's user avatar
  • 6,358
2 votes
Accepted

Insert mode's CTRL-E and CTRL-Y vs popup menu

Is that something avoidable? What is "avoidable"? <C-E> normally escapes from pum; <C-Y> accepts pum selection. But you can remap both (probably with check against :h pumvisible(...
Matt's user avatar
  • 21.6k
2 votes
Accepted

Popup menu: Set a selected item on creation

All of the popup creation functions return a window ID. So save the return value of popup_menu... let popid = popup_menu(...) Then use that to reach into the popup buffer and move the cursor... ...
B Layer's user avatar
  • 20.1k
2 votes

how to disable the new popup file-picker on :w

As explained in the documentation at :h 'wildmenu' you can type CTRL-E: end completion, go back to what was there before selecting a match. Note: To have the popup menu displayed, and a recent ...
Christian Brabandt's user avatar
2 votes
Accepted

Is it possible to get the index of the highlighted selection of a popup_menu before confirming?

Popup menu here is popup window where current item index equals cursor position line number. You can query it using :h getcurpos() function with winid of your popup window: vim9script var my_fruit = [...
Maxim Kim's user avatar
  • 13.9k
2 votes

How to open folds in a pedit-preview popup window?

If you look at the help for the :pedit command, you will see this: :ped :pedit :ped[it][!] [++opt] [+cmd] {file} Edit {file} in the ...
Christian Brabandt's user avatar
1 vote
Accepted

Search within Popup menu

As I suspected, this is possible. We use complete_info() to find the existing matches, ask the user to type his desired filter using getchar(), and replace the completions with complete(). I mapped ...
user22476690's user avatar
1 vote

Search within Popup menu

For the text completion you can have that feature using the completeopt option: set completeopt+=fuzzy For command line completion you can have that feature using the wildoptions option: set ...
Vivian De Smedt's user avatar
1 vote
Accepted

Popup menu highlight issues when it is called for the second time

If you're about current line highlight, this might be the issue with default bundled colorschemes. In short, some of the default colorschemes, for example, koehler define PopupSelected highlight group,...
Maxim Kim's user avatar
  • 13.9k
1 vote

Help in positioning a popup menu in the screen

A possible solution is to use &lines and &columns: popup_create(items, { title: " Title ", line: &lines, col: &columns, pos: "botright", ...
Barzi2001's user avatar
  • 808
1 vote

Can a popup_menu's callback access its popup_menu's first argument?

Popup windows, like all windows in vim, have buffers that contain the text within them. Thus, you can use getbufline to retrieve the text. func ColorSelected(id, result) echo getbufline(winbufnr(a:...
Mass's user avatar
  • 14.4k
1 vote
Accepted

Disable coc diagnostic popups

You can use diagnostic.enableSign and diagnostic.enableMessage to set whether the signs and messages are shown. diagnostic.showUnused sets whether the unused warnings show up.There are probably ...
basesorbytes's user avatar
1 vote

Signature popup has unreadable colors in YCM for Rust

On my setup, Pmenu is responsible for the popup (see BLayer's comment) so: :hi Pmenu ctermbg=darkgray or add it to your vimrc, below all other styling rules: highlight Pmenu ctermbg=darkgray
d9ngle's user avatar
  • 163
1 vote
Accepted

How to display popup window on the left or right side

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 ...
filbranden's user avatar
  • 29.9k
1 vote
Accepted

Highlight group for signature help

The highlight group used to style the current argument is called YCMInverse, since its default is to reverse foreground and background colors. Its default is defined here as: hi default YCMInverse ...
filbranden's user avatar
  • 29.9k

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