5

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 because popup_findpreview() gives you a window ID, but the range passed to :windo expects window numbers: :[range]windo {cmd} Execute {cmd} in each window or if [...


3

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, {})


3

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 used. In your case ASCII characters are used. If you programmed the popup yourself, see :h popup and search for borderchars. BTW: I don't think that fzf is ...


2

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 in popup window: noremap <buffer> <down> :call Omni_cursor(1)<CR> noremap <buffer> <up> :call Omni_cursor(0)<CR> noremap &...


2

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, \ minwidth: 1, \ minheight: 1, \ maxheight: &lines - 1, \ cursorline: 1, \ wrap: 0, \ firstline: 1, \ scrollbar: ...


2

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 to do this? OTOH, popup windows do have an ID. So, you could try: call win_execute(winid, 'setlocal scrollbind') Or: call setwinvar(winid, '&scrollbind',...


2

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 For example: call range(50) \ ->map({_, i -> string(i)}) \ ->popup_create(#{ \ line: 1, \ col: 1, \ minwidth: 1, \ ...


2

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 preview window. The preview window is opened like with :ptag. The current window and cursor position isn't changed. Useful example: ...


2

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 also for snippet jumps. let g:coc_snippet_next = '' let g:coc_snippet_prev = '' inoremap <expr> <c-j> \ pumvisible() ? "\<c-n>" : ...


2

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... call win_execute(popid, 'call cursor(2, 1)') win_execute() is like execute() but operates in the context of a specified window. This is mentioned at the end ...


2

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 motion) Operator to create a fold.,zF Create a fold for [count] lines. Works like zf.,zd Delete one fold at the cursor.,zD Delete folds recursively at the ...


1

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()) if required. Why this asymmetry In fact, they are quite symmetric to each other: copy from up/down line in insert mode; or cancel/accept pum if it's ...


1

let g:ycm_auto_hover='' This disables the popup.


1

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

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 term=reverse cterm=reverse gui=reverse Since it's defined using hi default, you can override it by setting your own from your vimrc. For example, to highlight ...


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