1
0
mirror of https://github.com/dcarrillo/dotfiles.git synced 2024-11-15 09:11:12 +00:00
dotfiles/.config/nvim/lua/plugins/bufferline.lua

43 lines
876 B
Lua
Raw Normal View History

local bufferline = require("bufferline")
local function is_buffer_loaded(name)
local bufs = vim.api.nvim_list_bufs()
for _, buffer in pairs(bufs) do
if vim.fn.getbufvar(buffer, "&filetype") == name then
return true
end
end
return false
end
bufferline.setup({
2022-10-01 11:46:18 +00:00
options = {
2023-09-16 18:05:38 +00:00
close_command = "Bdelete! %d",
right_mouse_command = "Bdelete! %d",
2022-11-05 12:30:40 +00:00
offsets = {
{ filetype = "neo-tree", text = "", padding = 1 },
{ filetype = "dapui_scopes", text = "", padding = 1 },
},
indicator = {
2023-09-16 18:05:38 +00:00
style = "underline",
},
2023-09-16 18:05:38 +00:00
hover = {
2023-10-04 17:49:06 +00:00
enabled = false,
2022-10-01 11:46:18 +00:00
},
2023-09-16 18:05:38 +00:00
separator_style = "slant",
custom_areas = {
left = function()
local text = ""
if not is_buffer_loaded("neo-tree") then
text = "" .. string.gsub(vim.loop.cwd(), "^" .. os.getenv("HOME"), "~") .. ""
end
2024-02-12 19:46:40 +00:00
return { { text = text, fg = "#adbac7" } }
end,
},
2022-10-01 11:46:18 +00:00
},
})