Skip to content

66RING/peek.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Peek.nvim

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.

image

Features

  • Universal wrapping: Preview any command or keybinding destination
  • Auto-close: Preview window automatically closes on cursor move, buffer leave, or keypress

Installation

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,
})

Usage

Basic Commands

" 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
:PeekCloseAll

Peek again to jump into.

Lua API

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()

Configuration

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,
})

License

MIT

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages