akinsho / akinsho/bufferline.nvim

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

未关闭
#1,045 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
enhancement
主要语言
Lua
星标
4.4k
派生
240
PR 合并指标
30 天内没有已合并 PR

描述

### 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

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。