akinsho / akinsho/bufferline.nvim

[Feature Request]: Set filetype icon color to "gray" for inactive buffers

Offen
#1,045 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
enhancement
Vorherrschende Sprache
Lua
Sterne
4.4k
Forks
240
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

### What?

I use below configs for bufferline, I think it is worth to merge into this plugin:

```lua
require("bufferline").setup({
get_element_icon = function(element)
local current_bufpath = vim.api.nvim_buf_get_name(0)
local icon_text, icon_color =
require("nvim-web-devicons").get_icon_by_filetype(element.filetype, { default = false })
if
str.not_empty(current_bufpath)
and str.not_empty(element.path)
and path.normalize(current_bufpath, { expand = true, double_backslash = true })
== path.normalize(element.path, { expand = true, double_backslash = true })
then
return icon_text, icon_color
else
return icon_text, "Comment"
end
end,
})
```

### Why?

It set a "grey" color (with "Comment" hl group) for inactive buffer's filetype icon, it looks better:

Image

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.