mirror of
https://github.com/dcarrillo/dotfiles.git
synced 2024-11-10 06:11:12 +00:00
43 lines
876 B
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 = "#adbac7" } }
|
|
end,
|
|
},
|
|
},
|
|
})
|