local map = vim.api.nvim_set_keymap local opts = { noremap = true, silent = true } -- Move to previous/next map('n', '', 'BufferPrevious', opts) map('n', '', 'BufferNext', opts) -- Re-order to previous/next map('n', '', 'BufferMovePrevious', opts) map('n', '>', 'BufferMoveNext', opts) -- Goto buffer in position... map('n', '', 'BufferGoto 1', opts) map('n', '', 'BufferGoto 2', opts) map('n', '', 'BufferGoto 3', opts) map('n', '', 'BufferGoto 4', opts) map('n', '', 'BufferGoto 5', opts) map('n', '', 'BufferGoto 6', opts) map('n', '', 'BufferGoto 7', opts) map('n', '', 'BufferGoto 8', opts) map('n', '', 'BufferGoto 9', opts) map('n', '', 'BufferLast', opts) -- Pin/unpin buffer map('n', '', 'BufferPin', opts) -- Goto pinned/unpinned buffer -- :BufferGotoPinned -- :BufferGotoUnpinned -- Close buffer map('n', '', 'BufferClose', opts) -- Wipeout buffer -- :BufferWipeout -- Close commands -- :BufferCloseAllButCurrent -- :BufferCloseAllButPinned -- :BufferCloseAllButCurrentOrPinned -- :BufferCloseBuffersLeft -- :BufferCloseBuffersRight -- Magic buffer-picking mode map('n', '', 'BufferPick', opts) map('n', '', 'BufferPickDelete', opts) -- Sort automatically by... map('n', 'bb', 'BufferOrderByBufferNumber', opts) map('n', 'bn', 'BufferOrderByName', opts) map('n', 'bd', 'BufferOrderByDirectory', opts) map('n', 'bl', 'BufferOrderByLanguage', opts) map('n', 'bw', 'BufferOrderByWindowNumber', opts) -- Other: -- :BarbarEnable - enables barbar (enabled by default) -- :BarbarDisable - very bad command, should never be used vim.g.barbar_auto_setup = false -- disable auto-setup require'barbar'.setup { -- Enable/disable animations animation = true, -- Automatically hide the tabline when there are this many buffers left. -- Set to any value >=0 to enable. auto_hide = false, -- Enable/disable current/total tabpages indicator (top right corner) tabpages = true, -- Enables/disable clickable tabs -- - left-click: go to buffer -- - middle-click: delete buffer clickable = true, }