Skip to content

Commit

Permalink
refactor(bufferline-nvim): simplify pack by using the `disable-tablin…
Browse files Browse the repository at this point in the history
…e` recipe
  • Loading branch information
mehalter committed May 30, 2024
1 parent 3ec0709 commit 622869b
Showing 1 changed file with 17 additions and 23 deletions.
40 changes: 17 additions & 23 deletions lua/astrocommunity/bars-and-lines/bufferline-nvim/init.lua
Original file line number Diff line number Diff line change
@@ -1,27 +1,26 @@
return {
{ import = "astrocommunity.recipes.disable-tabline" },
{
"akinsho/bufferline.nvim",
dependencies = {
{
"AstroNvim/astrocore",
opts = function(_, opts)
local maps = opts.mappings
maps.n["]b"] = { function() require("bufferline.commands").cycle(vim.v.count1) end, desc = "Next buffer" }
maps.n["[b"] =
{ function() require("bufferline.commands").cycle(-vim.v.count1) end, desc = "Previous buffer" }
maps.n[">b"] = {
function() require("bufferline.commands").move(vim.v.count1) end,
desc = "Move buffer tab right",
}
maps.n["<b"] = {
function() require("bufferline.commands").move(-vim.v.count1) end,
desc = "Move buffer tab left",
}

for k, _ in pairs(maps.n) do
if k:find "^<Leader>b" then maps.n[k] = false end
end
end,
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" },
[">b"] = {
function() require("bufferline.commands").move(vim.v.count1) end,
desc = "Move buffer tab right",
},
["<b"] = {
function() require("bufferline.commands").move(-vim.v.count1) end,
desc = "Move buffer tab left",
},
},
},
},
},
},
event = "VeryLazy",
Expand All @@ -38,9 +37,4 @@ return {
},
},
},
{
"rebelot/heirline.nvim",
optional = true,
opts = function(_, opts) opts.tabline = nil end,
},
}

0 comments on commit 622869b

Please sign in to comment.