Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tripplyons/stacker.nvim
Quickly access and manage recently used neovim buffers
https://github.com/tripplyons/stacker.nvim
Last synced: 8 days ago
JSON representation
Quickly access and manage recently used neovim buffers
- Host: GitHub
- URL: https://github.com/tripplyons/stacker.nvim
- Owner: tripplyons
- License: mit
- Created: 2024-03-21T16:48:04.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2024-08-25T15:47:45.000Z (3 months ago)
- Last Synced: 2024-08-25T17:00:25.978Z (3 months ago)
- Language: Lua
- Size: 8.79 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# stacker.nvim
Quickly access and manage recently used neovim buffers
Inspired by [harpoon](https://github.com/ThePrimeagen/harpoon)
## Installation
### With lazy.nvim
Add the following to your lazy config:
```lua
{
"tripplyons/stacker.nvim",
}
```Then, call the setup command, and create keybinds:
```lua
local stacker = require('stacker')
stacker.setup({})-- 1 will navigate to the most recently used buffer, 2 for 2nd most recently used buffer, etc.
for i = 1, 9 do
vim.keymap.set('n', '' .. i, function()
stacker.navigate(i)
end)
end-- 0 will navigate to the 10th most recently used buffer
vim.keymap.set('n', '0', function()
stacker.navigate(10)
end)-- dh will delete the buffer history
vim.keymap.set('n', 'dh', function()
stacker.clear_history()
end)
```## Customization
### Default Options
```lua
{
max_buffers = 10,
separator = ' ',
show_tabline = true,
storage_path = vim.fn.stdpath('data') .. '/stacker.json',
load_cursor_position = false, # a bit buggy
use_storage = false,
}
```### Custom Colors
```lua
inactive_color = '#808080' -- replace with a custom color
active_color = '#ffffff' -- replace with a custom color
number_color = '#ff0000' -- replace with a custom color
vim.cmd('highlight! StackerInactive guibg=NONE guifg='..inactive_color)
vim.cmd('highlight! StackerActive guibg=NONE guifg='..active_color)
vim.cmd('highlight! StackerNumber guibg=NONE guifg='..number_color)
```