Skip to content

Commit

Permalink
fix(bufferline-nvim): remove default unapplicable buffer mappings and…
Browse files Browse the repository at this point in the history
… add move bindings
  • Loading branch information
mehalter committed May 30, 2024
1 parent f34cd1c commit 3ec0709
Showing 1 changed file with 18 additions and 8 deletions.
26 changes: 18 additions & 8 deletions lua/astrocommunity/bars-and-lines/bufferline-nvim/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,24 @@ return {
dependencies = {
{
"AstroNvim/astrocore",
opts = {
mappings = {
n = {
["]b"] = { function() require("bufferline.commands").cycle(1) end, desc = "Next buffer" },
["[b"] = { function() require("bufferline.commands").cycle(-1) end, desc = "Previous buffer" },
},
},
},
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,
},
},
event = "VeryLazy",
Expand Down

0 comments on commit 3ec0709

Please sign in to comment.