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 ...
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 ...
5
votes
Accepted
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 ...
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 ...
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, {})
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 ...
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,
\ ...
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 ...
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
...
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 ...
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(...
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...
...
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 ...
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 = [...
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 ...
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 ...
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 ...
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,...
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",
...
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:...
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 ...
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
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 ...
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 ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
popup-menu × 36autocompletion × 8
vimscript × 6
neovim × 4
plugin-you-complete-me × 4
plugin-coc × 4
vim-windows × 3
ins-completion × 3
popup × 3
cursor-movement × 2
colorscheme × 2
highlight × 2
vim8 × 2
lsp × 2
previewwindow × 2
key-bindings × 1
syntax-highlighting × 1
command-line × 1
terminal × 1
autocmd × 1
macvim × 1
quickfix × 1
terminal-buffer × 1
save × 1
variables × 1