mirror of
https://github.com/LazyVim/LazyVim.git
synced 2026-07-25 14:01:06 +00:00
Add Toggle to show/hide Bufferline
This commit is contained in:
parent
efc95dc6aa
commit
107ac609ed
1 changed files with 16 additions and 0 deletions
|
|
@ -46,6 +46,22 @@ return {
|
|||
},
|
||||
config = function(_, opts)
|
||||
require("bufferline").setup(opts)
|
||||
|
||||
-- Add Keymap to Show/Hide Bufferline
|
||||
Snacks.toggle({
|
||||
name = "Bufferline",
|
||||
get = function()
|
||||
return vim.o.showtabline == 1 or vim.o.showtabline == 2
|
||||
end,
|
||||
set = function(state)
|
||||
if vim.o.showtabline == 2 then
|
||||
vim.o.showtabline = 0
|
||||
else
|
||||
vim.o.showtabline = 2
|
||||
end
|
||||
end,
|
||||
}):map("<leader>uy")
|
||||
|
||||
-- Fix bufferline when restoring a session
|
||||
vim.api.nvim_create_autocmd({ "BufAdd", "BufDelete" }, {
|
||||
callback = function()
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue