Create preview window instead of using quickfix list (#78)

* Create preview window instead of using quickfix list

This removes from us burden of providing formatting for content as this
is now simple as setting proper filetype.

* Create custom filetype for preview window

This will allow users to provide their own mappings and features in
hover window easily.

* Add proper statusline for LSP Hover

* Guard and undo_ftplugin

* Support all LSP hover syntaxes
This commit is contained in:
Łukasz Jan Niemier
2018-01-01 22:29:50 +01:00
committed by Prabir Shrestha
parent a15344352f
commit 203d682e30
6 changed files with 87 additions and 47 deletions

14
ftplugin/lsp-hover.vim Normal file
View File

@@ -0,0 +1,14 @@
" No usual did_ftplugin header here as we NEED to run this always
setlocal previewwindow buftype=nofile bufhidden=wipe noswapfile nobuflisted
setlocal nocursorline nofoldenable
if has('syntax')
setlocal nospell
endif
let &l:statusline = ' LSP Hover'
let b:undo_ftplugin = 'setlocal pvw< bt< bh< swf< bl< cul< fen<' .
\ (has('syntax') ? ' spell<' : '') .
\ ' | unlet! g:markdown_fenced_languages'