This is a harpoon like plugin that provides an interface to navigate through buffers or tabs.
Their respective totals can be displayed on the statusline, tabline or winbar.
Please note that this plugin is still in its early development stages. Breaking changes are to be expected!
tabs: 4 | buffers: 7 [lualine]
Using Lazy
{
'Pheon-Dev/buffalo-nvim'
}
Using packer.nvim
use 'Pheon-Dev/buffalo-nvim'
Using vim-plug
Plug 'Pheon-Dev/buffalo-nvim'
-- default config
require('buffalo').setup({})
-- Keymaps
local opts = { noremap = true }
local map = vim.keymap.set
local buffalo = require("buffalo.ui")
-- buffers
map({ 't', 'n' }, '<C-Space>', buffalo.toggle_buf_menu, opts)
map('n', '<C-j>', buffalo.nav_buf_next, opts)
map('n', '<C-k>', buffalo.nav_buf_prev, opts)
-- tabpages
map({ 't', 'n' }, '<M-Space>', buffalo.toggle_tab_menu, opts)
map('n', '<C-n>', buffalo.nav_tab_next, opts)
map('n', '<C-p>', buffalo.nav_tab_prev, opts)
-- Example in lualine
...
sections = {
...
lualine_x = {
{
function()
local buffers = require("buffalo").buffers()
local tabpages = require("buffalo").tabpages()
return " " .. buffers .. " " .. tabpages
end,
color = { fg = "#ffaa00", bg = "#24273a",},
}
},
...
},
...
require("buffalo").setup({
tab_commands = { -- use default neovim commands for tabs e.g `tablast`, `tabnew` etc
next = { -- you can use any unique name e.g `tabnext`, `tab_next`, `next`, `random` etc
key = "<CR>",
command = "tabnext"
},
close = {
key = "c",
command = "tabclose"
},
dd = {
key = "dd",
command = "tabclose"
},
new = {
key = "n",
command = "tabnew"
}
},
buffer_commands = { -- use default neovim commands for buffers e.g `bd`, `edit`
edit = {
key = "<CR>",
command = "edit"
},
vsplit = {
key = "v",
command = "vsplit"
},
split = {
key = "h",
command = "split"
}
buffer_delete = {
key = "d",
command = "bd"
}
},
general_commands = {
cycle = true, -- cycle through buffers or tabs
exit_menu = "x", -- similar to 'q' and '<esc>'
},
go_to = {
enabled = true,
go_to_tab = "<leader>%s",
go_to_buffer = "<M-%s>",
},
filter = {
enabled = true,
filter_tabs = "<M-t>",
filter_buffers = "<M-b>",
},
ui = {
width = 60,
height = 10,
row = 2,
col = 2,
borderchars = { "─", "│", "─", "│", "╭", "╮", "╯", "╰" },
}
})
- Hit any number on the menu to navigate to that buffer or tab without having to scroll.
- Use normal keymap defaults for neovim e.g
dd
to delete a buffer, on the open menu.
BuffaloBorder
BuffaloWindow
BuffaloBuffersModified
BuffaloBuffersCurrentLine
BuffaloTabsCurrentLine
- ThePrimeagen's Harpoon
- J-Morano's Buffer Manager
- PRs and Issues are always welcome.