1
0
mirror of https://github.com/dcarrillo/dotfiles.git synced 2024-12-23 14:56:48 +00:00
dotfiles/.config/nvim/lua/plugins/bufferline.lua

43 lines
876 B
Lua

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({
options = {
close_command = "Bdelete! %d",
right_mouse_command = "Bdelete! %d",
offsets = {
{ filetype = "neo-tree", text = "", padding = 1 },
{ filetype = "dapui_scopes", text = "", padding = 1 },
},
indicator = {
style = "underline",
},
hover = {
enabled = false,
},
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
return { { text = text, fg = "#636E7B" } }
end,
},
},
})