The future is still black and blank.
A Neovim plugin for previewing any command's destination in a floating window without leaving your current position.
- Universal wrapping: Preview any command or keybinding destination
- Auto-close: Preview window automatically closes on cursor move, buffer leave, or keypress
require('peek').setup({
-- Preview window size
width = 20,
height = 10,
-- Window position: 'center', 'top-right', 'top-left', 'bottom-right', 'bottom-left', 'cursor'
position = 'cursor',
-- Border style: 'single', 'double', 'rounded', 'solid', etc.
border = 'rounded',
-- border = 'double',
-- border = 'single',
-- Auto-close options
close_on_cursor_move = true,
close_on_buf_leave = true,
close_on_key = true,
})" Preview where a keystroke would take you
:Peek gd
" Preview movement commands
:Peek j
:Peek k
:Peek G
" Close preview window
:PeekClose
" Close all preview windows
:PeekCloseAllPeek again to jump into.
local peek = require('peek')
-- Wrap keystrokes
peek.peek('gd')
peek.peek('j')
peek.peek('G')
peek.peek(':norm G')
peek.peek(function() vim.cmd("norm G") end)
peek.peek(vim.lsp.buf.definition)
-- Close preview windows
peek.close()require('peek').setup({
-- Preview window size
width = 20,
height = 10,
-- Window position: 'center', 'top-right', 'top-left', 'bottom-right', 'bottom-left', 'cursor'
position = 'cursor',
-- Border style: 'single', 'double', 'rounded', 'solid', etc.
border = 'rounded',
-- Auto-close options
close_on_cursor_move = true,
close_on_buf_leave = true,
close_on_key = true,
})MIT