akinsho / akinsho/bufferline.nvim

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

Đang mở
#1,045 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
enhancement
Ngôn ngữ chính
Lua
Star
4.4k
Fork
240
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

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

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.