Skip to content

comfysage/shelf.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

93 Commits
 
 
 
 
 
 

Repository files navigation

shelf

📚 a bookmarks manager for chaivim.

✨ Features

open the bufferlist:

require('shelf.ui').open()

make changes by editing the buffer, apply them with = or quit without saving changes with esc. the currently highlighted list item can be opened with enter or:

bufferlist:open(1) -- open item at index 1

🔒 requirements

📦 installation

shelf can be installed by adding this to your lua/plugins/init.lua.

{
    'comfysage/shelf.nvim',
    dependencies = {'comfysage/yosu.nvim'},
    opts = {},
    config = function(_, opts)
        require 'shelf'.setup(opts)

        -- toggle shelf ui
        keymaps.normal['<leader>p'] = {
            function()
                require('shelf.ui').open()
            end,
            'show bufferlist',
        }
    end,
}

⚙️ configuration

below is the default shelf configuration.

{
    opts = {
        -- cache file where bufferlists are saved
        cache_file = vim.fn.stdpath 'state' .. '/shelf.list.json',
        -- mappings for shelf ui
        mappings = {
            -- close the window
            close = 'q',
            -- close without applying changes
            quit = '<esc>',
            -- open current item
            open = '<cr>',
            -- apply buffer edits
            apply = '=',
            -- reset buffer edits
            reset = '<bs>',
        },
        ui = {
            size = {
                -- size fields can be either an absolute integer size or a number between 0 and 1
                -- window is 90 characters wide
                width = 90,
                -- max window height is 90% of editor height
                height = 0.9,
            },
        },
    }
}

credits

the project was mainly inspired by harpoon and the keymap behavior was inspired by mini.files

Releases

No releases published

Languages