• Stars
    star
    236
  • Rank 170,480 (Top 4 %)
  • Language
    Vim Script
  • License
    MIT License
  • Created over 5 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Less annoying completion preview window based on neovim's floating window

float-preview.nvim

With let g:float_preview#docked = 1:

asciicast

With let g:float_preview#docked = 0:

asciicast

Note that this is a general purpose plugin instead of ncm2 only, it applies to :help complete-items with info field available.

Why ?

Vim's builtin set completeopt+=preview is annoying. When the preview window is opened, it simply pumps text out of my eye spot. Which makes it very disturbing and actually unusable.

This plugin uses neovim's floating Window, it should never pumps text out of your eye spot.

Config && API

g:float_preview#win

When the floating window opens, float-preview.nvim will emit a custom autocommand which you can use to further configure the opened window. The window ID will be exposed through g:float_preview#win.

Example: a function that disables numbers and the cursor line in the opened window.

function! DisableExtras()
  call nvim_win_set_option(g:float_preview#win, 'number', v:false)
  call nvim_win_set_option(g:float_preview#win, 'relativenumber', v:false)
  call nvim_win_set_option(g:float_preview#win, 'cursorline', v:false)
endfunction

autocmd User FloatPreviewWinOpen call DisableExtras()

g:float_preview#docked

If set to 0, the preview window will be displayed beside the popup menu. Defaults to 1.

g:float_preview#winhl

Custom highlights for preview window. See :help 'winhl' for more information.

g:float_preview#max_height

Height of the preview window. Defaults to :help 'previewheight'.

g:float_preview#max_width

Only used when g:float_preview#docked == 0. Max width of the preview window. Defaults to 50.

g:float_preview#auto_close

Defaults to 1. Only used when g:float_preview#docked == 1.

If you don't want this plugin auto closing the preview window, use :let g:float_preview#auto_close = 0 and call float_preview#close() by yourself.

More Repositories

1

ncm2

❤️ Slim, Fast and Hackable Completion Framework for Neovim
Python
1,336
star
2

ncm2-pyclang

Cached, fast C/C++ completion for ncm2
Python
45
star
3

ncm2-ultisnips

Python
44
star
4

ncm2-jedi

Python
23
star
5

ncm2-path

Python
21
star
6

ncm2-bufword

completion words from current buffer
Python
20
star
7

ncm2-vim-lsp

Vim Script
13
star
8

ncm2-racer

Python
12
star
9

ncm2-tern

ternjs based javascript completion for ncm2
Python
12
star
10

ncm2-d

✨ ncm2 autocompletion source for D
Python
11
star
11

ncm2-github

Vim Script
10
star
12

ncm2-vim

vim source for ncm2
Vim Script
9
star
13

ncm2-go

Python
8
star
14

ncm2-markdown-subscope

fenced code block detection in markdown files for ncm2
Python
8
star
15

ncm2-tmux

completion with words from other tmux panes
Python
8
star
16

ncm2-syntax

syntax source for ncm2
Vim Script
5
star
17

ncm2-match-highlight

Experimental matches highlight plugin for ncm2 based on https://en.wikipedia.org/wiki/Mathematical_Alphanumeric_Symbols
Python
5
star
18

ncm2-gtags

gtags source for ncm2
Python
5
star
19

ncm2-neosnippet

Python
5
star
20

ncm2-cssomni

wrap css omnifunc for ncm2 with one singule function call
Vim Script
4
star
21

ncm2-snipmate

Python
3
star
22

ncm2-html-subscope

Detect javascript/css subscope from html code
Python
3
star
23

ncm2-neoinclude

neoinclude source for ncm2
Vim Script
3
star
24

ncm2-highprio-pop

Limit ncm2 popup the matches of the source with highest priority only, with a few lines of python
Python
2
star
25

ncm2-abbrfuzzy

⚠️ THIS IS BUILTIN IN NCM2, THIS REPO IS DEPRECATED
Python
1
star
26

ncm2-coc

⚠️ This is simply a demo for https://github.com/ncm2/ncm2/issues/51 , this repo is experimental, and unstable
Vim Script
1
star
27

ncm2_lsp_snippet

[EXPERIMENTAL] A python library for parsing lsp snippet. Note that this is not a plugin.
Python
1
star
28

ncm2-tagprefix

tags completion for ncm2. this soruce supports prefix match only.
Python
1
star