WolfeCub / harpeek.nvim

A simple plugin that allows you to _peek_ at your harpoon/grapple lists.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Har(and other quick access lists)peek

A simple plugin that allows you to peek at your harpoon/grapple/arrow lists. The look was heavily inspired by bufpin.nvim.

harpeek-demo

Quick Start

Using lazy.nvim

{
    'WolfeCub/harpeek.nvim',
    config = function()
        require('harpeek').setup()
    end
}

The public API of harpeek is very simple:

-- You can toggle the visibility of the window with:
require('harpeek').toggle()
-- if you need more granular control you can open/close the preview window with:
require('harpeek').open()
require('harpeek').close()


-- You can also pass an optional settings to open and toggle functions:
require('harpeek').toggle({
    hl_group = 'Error',
    format = 'relative',
})
require('harpeek').open({
    winopts = {
        row = 10,
        col = 10,
        border = 'none',
    }
})

Harpeek will automatically detect if you have harpoon or grapple installed and use the appropriate list.

Advanced Setup

require('harpeek').setup({
    -- You can replace the hightlight group used on the currently selected buffer
    hl_group = 'Error',
    -- You can override any window options. For example here we set a different position & border.
    winopts = {
        row = 10,
        col = 10,
        border = 'rounded',
    },
    -- How each item will be displayed:
    -- 'filename' will show just the tail (default)
    -- 'relative' will show the entire path relative to cwd
    -- 'shortened' will show relative with single letters for the dir
    format = 'relative',
    -- Alternatively format can be a function that returns a custom format for each line
    format = function(path, index)
        return '[' .. index .. '] - ' .. path
    end
    -- Don't show the window if you don't have any marks. It will automatically (re)open if a mark is created.
    hide_on_empty = true,
})

About

A simple plugin that allows you to _peek_ at your harpoon/grapple lists.


Languages

Language:Lua 100.0%