Skip to content

AndrewRadev/quickpeek.vim

Repository files navigation

GitHub version

Screenshot

Usage

Turn on/off preview popup (commands only defined in quickfix window):

:Quickpeek
:QuickpeekStop
:QuickpeekToggle

It's recommended to create a mapping for QuickpeekToggle, for instance, in ~/.vim/ftplugin/qf.vim, you can do this:

nnoremap <buffer> <c-p> :QuickpeekToggle<cr>

To turn preview popup on automatically, put this in your .vimrc:

let g:quickpeek_auto = v:true

Note that auto mode is currently experimental and results in some weird issues for me sometimes. If you end up with popups hanging around, you can close all of them with :call popup_close().

You can customize the popup that shows up using the g:quickpeek_popup_options variable. See the help docs for more details.

Requirements

The plugin needs Vim with popup window support (v8.1 with a large patch number), otherwise it'll silently do nothing. If you'd like to check if you have popups, try:

:echo exists('*popup_create')

If you get the value of "1", that means you have popup support.

Related Work

  • The quickr-preview plugin provides previews of quickfix items in customizable buffers.
  • The quickui plugin has a preview popup as well, although it comes with a lot of other functionality.

Contributing

Pull requests are welcome, but take a look at CONTRIBUTING.md first for some guidelines. Be sure to abide by the CODE_OF_CONDUCT.md as well.