Files
vim-lsp-mirror/ftplugin/lsp-hover.vim
Thomas Faingnaert 813ea77b91 Add LspPeekDefinition (#412)
* Add LspPeekDefinition

* Add documentation

* Add lsp-peek-definition mapping to documentation

* Add link to Vim preview-window help

* Rewrite LspPeekDefinition using preview window

* Implement peek for Vim popup window

* Make LspPeekDefinition work in Neovim

* Support align in Neovim

* Fix linter errors

* Extract duplicate code to s:align_preview function

* Merge setlocal settings in one line

* Remove suppress_close

* Clean up cursor movement for preview window

* Move Neovim cursor code to separate function

* Allow customising peek alignment

* Move Vim alignment code to separate function

* Implement Vim alignment of popup window

* Cleanup

* Remove extraneous lines

* Move set_cursor logic

* Move scrolloff setting

* Make function calls a bit more consistent

* Vim popup window fixes

* Remove extraneous call

* Fix Vim alignment

* Remove hardcoded width

* Add abort to closure function

* Fix artifacts

* Fix wrong height if popup above cursor

* Add remaining Peek commands

Add LspPeekImplementation, LspPeekTypeDefinition and LspPeekDeclaration.

* Fix wrong positioning of Vim popup
2019-07-21 09:40:19 -07:00

19 lines
678 B
VimL

" No usual did_ftplugin header here as we NEED to run this always
if has('patch-8.1.1517') && g:lsp_preview_float && !has('nvim')
" Can not set buftype or popup_close will fail with 'not a popup window'
setlocal previewwindow bufhidden=wipe noswapfile nobuflisted
else
setlocal previewwindow buftype=nofile bufhidden=wipe noswapfile nobuflisted
endif
setlocal nocursorline nofoldenable nonumber norelativenumber
if has('syntax')
setlocal nospell
endif
let b:undo_ftplugin = 'setlocal pvw< bt< bh< swf< bl< cul< fen<' .
\ (has('syntax') ? ' spell<' : '') .
\ ' number< relativenumber<' .
\ ' | unlet! g:markdown_fenced_languages'