local prefix = "b" local keys = {} -- stylua: ignore start table.insert(keys, { prefix .. "S", "BufferLineSortByDirectory", desc = "Sort By Directory" }) table.insert(keys, { prefix .. "s", "BufferLineSortByExtension", desc = "Sort By Extensions" }) table.insert(keys, { prefix .. "<", "BufferLineMovePrev", desc = "Move buffer prev" }) table.insert(keys, { prefix .. ">", "BufferLineMoveNext", desc = "Move buffer next" }) -- Jump straight to a buffer by its position in the bufferline. -- BufferLineGoToBuffer takes the absolute 1-based slot, so b1 is always -- the leftmost buffer and the count never skips the one you are already on. -- The ordinal shown in the bufferline (see numbers = "ordinal" below) is the -- number to press. for i = 1, 9 do table.insert(keys, { prefix .. i, "BufferLineGoToBuffer " .. i .. "", desc = "Buffer " .. i }) end -- ...and 0 for the last one, however many there are. table.insert(keys, { prefix .. "0", "BufferLineGoToBuffer -1", desc = "Last Buffer" }) -- Arrows step through the bufferline in visible order. table.insert(keys, { prefix .. "", "BufferLineCyclePrev", desc = "Prev Buffer" }) table.insert(keys, { prefix .. "", "BufferLineCycleNext", desc = "Next Buffer" }) -- stylua: ignore end return { "akinsho/bufferline.nvim", keys = keys, opts = { options = { modified_icon = "", color_icons = true, separator_style = "slope", -- Show 1, 2, 3 ... so the number you see is the number you press. numbers = "ordinal", }, }, }