require('bufferline').setup { options = { mode = 'buffers', numbers = 'ordinal', separator_style = 'slant', show_buffer_icons = true, show_buffer_close_icons = false, show_close_icon = false, always_show_bufferline = true, right_mouse_command = function(bufnum) end, middle_mouse_command = function(bufnum) require('bufdelete').bufdelete(bufnum) end, custom_areas = { right = function() local result = {} local seve = vim.diagnostic.severity local error = #vim.diagnostic.get(0, {severity = seve.ERROR}) local warning = #vim.diagnostic.get(0, {severity = seve.WARN}) local info = #vim.diagnostic.get(0, {severity = seve.INFO}) local hint = #vim.diagnostic.get(0, {severity = seve.HINT}) if error ~= 0 then table.insert(result, {text = "  " .. error, fg = "#EC5241"}) end if warning ~= 0 then table.insert(result, {text = "  " .. warning, fg = "#EFB839"}) end if hint ~= 0 then table.insert(result, {text = "  " .. hint, fg = "#A3BA5E"}) end if info ~= 0 then table.insert(result, {text = "  " .. info, fg = "#7EA9A7"}) end return result end, }, offsets = { { filetype = "NvimTree", text = function() return vim.fn.getcwd() end, highlight = "Directory", text_align = "left" } } } }