Skip to content

Instantly share code, notes, and snippets.

@levmichael3
Created June 27, 2024 09:37
Show Gist options
  • Save levmichael3/71c2d2fcc7e46ea026c70762fe77220a to your computer and use it in GitHub Desktop.
Save levmichael3/71c2d2fcc7e46ea026c70762fe77220a to your computer and use it in GitHub Desktop.
bufferline setup
return {
{ import = "astrocommunity.recipes.disable-tabline" },
{
"akinsho/bufferline.nvim",
dependencies = {
{
"AstroNvim/astrocore",
opts = {
mappings = {
n = {
["]b"] = { function() require("bufferline.commands").cycle(vim.v.count1) end, desc = "Next buffer" },
["[b"] = { function() require("bufferline.commands").cycle(-vim.v.count1) end, desc = "Previous buffer" },
["<Leader>1"] = { function() require("bufferline").go_to(1, true) end, desc = "Go to buffer 1" },
["<Leader>2"] = { function() require("bufferline").go_to(2, true) end, desc = "Go to buffer 2" },
["<Leader>3"] = { function() require("bufferline").go_to(3, true) end, desc = "Go to buffer 3" },
["<Leader>4"] = { function() require("bufferline").go_to(4, true) end, desc = "Go to buffer 4" },
["<Leader>5"] = { function() require("bufferline").go_to(5, true) end, desc = "Go to buffer 5" },
["<Leader>6"] = { function() require("bufferline").go_to(6, true) end, desc = "Go to buffer 6" },
["<Leader>7"] = { function() require("bufferline").go_to(7, true) end, desc = "Go to buffer 7" },
["<Leader>8"] = { function() require("bufferline").go_to(8, true) end, desc = "Go to buffer 8" },
["<Leader>9"] = { function() require("bufferline").go_to(9, true) end, desc = "Go to buffer 9" },
["<Leader>$"] = { function() require("bufferline").go_to(-1, true) end, desc = "Go to buffer $" },
},
},
},
},
},
event = "VeryLazy",
opts = {
options = {
mode = "buffers", -- set to "tabs" to only show tabpages instead
always_show_bufferline = true,
show_buffer_icons = true,
show_buffer_close_icons = true,
show_close_icon = true,
-- modified_icon = "",
indicator = {
icon = "▎", -- this should be omitted if indicator style is not 'icon'
style = "icon",
},
color_icons = true,
buffer_close_icon = "󰅖",
modified_icon = "●",
close_icon = "",
left_trunc_marker = "",
right_trunc_marker = "",
show_tab_indicators = true,
-- tab_size = 5,
separator_style = "thin",
numbers = function(opts) return string.format("%s", opts.raise(opts.ordinal)) end,
offsets = {
{
filetype = "neo-tree",
text = "Neo-tree",
highlight = "Directory",
text_align = "left",
},
},
},
},
},
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment