require("bufferline").setup{
  options = {
    diagnostics = "nvim_lsp",
    diagnostics_indicator = function(count, level, diagnostics_dict, context)
      local icon = level:match("error") and " " or " "
      return " " .. icon .. count
    end,

    numbers = function(opts)
      return string.format('%s)', opts.ordinal, opts.id)
    end,

    -- groups = {
    --   options = {
    --     toggle_hidden_on_enter = true -- when you re-enter a hidden group this options re-opens that group so the buffer is visible
    --   },
    --   items = {
    --     {
    --       name = "Code", -- Mandatory
    --       highlight = {underline = true, sp = "blue"}, -- Optional
    --       priority = 1,
    --       icon = "",
    --       matcher = function(buf)
    --       return buf.filename:match('%.rs') or buf.filename:match('%.py') or buf.filename:match('%.nix') or buf.filename:match('%.lua')
    --     end,
    --   },
    --   {
    --     name = "Docs",
    --     highlight = {undercurl = true, sp = "green"},
    --     auto_close = false,
    --     icon = "", -- Optional
    --     priority = 2,
    --     matcher = function(buf)
    --     return buf.filename:match('%.md') or buf.filename:match('%.txt') or buf.filename:match('LICENSE')
    --     end,
    --       separator = { -- Optional
    --         style = require('bufferline.groups').separator.tab
    --       },
    --     }
    --   }
    -- }
  }
}
