1
1
local config = {}
2
2
3
3
function config .nvim_bufferline ()
4
+ local fn = vim .fn
5
+ local r = vim .regex
6
+ local fmt = string.format
7
+ local bufferline = require (" bufferline" )
4
8
local default = {
5
9
colors = require (" core.utils" ).get (),
6
10
}
@@ -14,6 +18,61 @@ function config.nvim_bufferline()
14
18
-- Code from NvChad
15
19
require (" bufferline" ).setup ({
16
20
options = {
21
+ groups = {
22
+ options = { toggle_hidden_on_enter = true },
23
+ items = {
24
+ bufferline .groups .builtin .pinned :with ({ icon = " " }),
25
+ bufferline .groups .builtin .ungrouped ,
26
+ {
27
+ name = " Dependencies" ,
28
+ icon = " " ,
29
+ highlight = { fg = " #ECBE7B" },
30
+ matcher = function (buf )
31
+ return vim .startswith (buf .path , vim .env .VIMRUNTIME )
32
+ end ,
33
+ },
34
+ {
35
+ name = " Terraform" ,
36
+ matcher = function (buf )
37
+ return buf .name :match (" %.tf" ) ~= nil
38
+ end ,
39
+ },
40
+ {
41
+ name = " Kubernetes" ,
42
+ matcher = function (buf )
43
+ return buf .name :match (" kubernetes" ) and buf .name :match (" %.yaml" )
44
+ end ,
45
+ },
46
+ {
47
+ name = " SQL" ,
48
+ matcher = function (buf )
49
+ return buf .name :match (" %.sql$" )
50
+ end ,
51
+ },
52
+ {
53
+ name = " tests" ,
54
+ icon = " " ,
55
+ matcher = function (buf )
56
+ local name = buf .name
57
+ return name :match (" [_%.]spec" ) or name :match (" [_%.]test" )
58
+ end ,
59
+ },
60
+ {
61
+ name = " docs" ,
62
+ icon = " " ,
63
+ matcher = function (buf )
64
+ if vim .bo [buf .id ].filetype == " man" or buf .path :match (" man://" ) then
65
+ return true
66
+ end
67
+ for _ , ext in ipairs ({ " txt" , " org" , " wiki" , " norg" }) do
68
+ if ext == fn .fnamemodify (buf .path , " :e" ) then
69
+ return true
70
+ end
71
+ end
72
+ end ,
73
+ },
74
+ },
75
+ },
17
76
hover = {
18
77
enabled = true ,
19
78
delay = 0 ,
0 commit comments