Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/comfysage/shelf.nvim

:books: a bookmarks manager for chaivim.
https://github.com/comfysage/shelf.nvim

chaivim neovim neovim-plugin nvim nvim-lua nvim-plugin

Last synced: 27 days ago
JSON representation

:books: a bookmarks manager for chaivim.

Awesome Lists containing this project

README

        

# shelf

:books: a bookmarks manager for chaivim.

## :sparkles: Features

open the bufferlist:

```lua
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:

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

## :lock: requirements

- Neovim `>= 0.10.0`
- [yosu.nvim](https://github.com/comfysage/yosu.nvim)

## :package: installation

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

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

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

## :gear: configuration

below is the default shelf configuration.

```lua
{
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 = '',
-- open current item
open = '',
-- apply buffer edits
apply = '=',
-- reset buffer edits
reset = '',
},
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](https://github.com/ThePrimeagen/harpoon/tree/harpoon2) and the keymap
behavior was inspired by
[mini.files](https://github.com/echasnovski/mini.files)