ncm2 / float-preview.nvim

Less annoying completion preview window based on neovim's floating window
MIT License
236 stars 3 forks source link

Nothing happen #1

Closed tracyone closed 5 years ago

tracyone commented 5 years ago

Following is my setup of ncm2 and I am sure about that my neovim support floating window.

https://github.com/tracyone/vinux/blob/master/rc/ncm2.vim#L49-L75

roxma commented 5 years ago

Preview requires info field of the :help complete-items.

You could test it with the folloing keys in insert mode:

<c-r>=complete(1, [{'word': 'foo', 'info': 'this goes to the preview window'}])?'':''<cr>
<c-n>

minimal vimrc:

execute 'source ' . $WORKSPACE_DIR . '/plug.vim'

call plug#begin($WORKSPACE_DIR)

Plug 'morhetz/gruvbox'
Plug 'ncm2/ncm2'
Plug 'roxma/nvim-yarp'
Plug 'ncm2/ncm2-jedi'
Plug 'ncm2/float-preview.nvim'

call plug#end()

set completeopt=noinsert,menuone,noselect
set shortmess+=c
set noshowmode

inoremap <expr> <Tab> pumvisible() ? "\<C-n>" : "\<Tab>"
inoremap <expr> <S-Tab> pumvisible() ? "\<C-p>" : "\<S-Tab>"
inoremap <expr> <CR> (pumvisible() ? "\<c-y>\<cr>" : "\<CR>")

au BufEnter * call ncm2#enable_for_buffer()

set pumheight=5

colorscheme gruvbox
mrded commented 5 years ago

nvim v0.3.7

I'm getting following error with a config above

Error detected while processing ~/.vim/plugged/float-preview.nvim/plugin/float_preview.vim: line 14: E216: No such group or event: CompleteChanged * call float_preview#_menu_popup_changed()

cseelus commented 5 years ago

@mrded Are you shure your NeoVim version supports floating windows?

mrded commented 5 years ago

That's right, it didn't support it, I start using 0.4 version, it kinda works now.

cseelus commented 5 years ago

0.4 is due end of august, then it should work properly.