-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfeline.lua
124 lines (114 loc) · 2.14 KB
/
feline.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
local ale = require('feline.custom_providers.ale')
local components = {
active = { {}, {}, {} },
inactive = { {}, {} },
}
-- Left
-- Active File Info {{{
table.insert(components.active[1], {
provider = {
name = 'file_info',
opts = { colored_icon = false },
},
hl = { bg = '#047857' },
right_sep = 'slant_right',
left_sep = 'block',
})
-- }}}
-- Active Git Branch {{{
table.insert(components.active[1], {
provider = 'git_branch',
left_sep = 'block',
})
-- }}}
-- Right
-- Active File Encoding {{{
table.insert(active[3], {
provider = 'file_encoding',
right_sep = 'block',
})
-- }}}
-- Active ALE Component {{{
table.insert(active[3], {
provider = 'ale_status',
hl = {
fg = '#262626',
bg = '#ffffff',
},
left_sep = {
str = 'slant_left',
hl = {
fg = '#ffffff',
bg = '#606060',
},
},
})
-- }}}
-- Active ALE Error Component {{{
table.insert(active[3], {
provider = 'ale_error',
hl = {
fg = '#ffffff',
bg = '#df0000',
},
left_sep = {
str = 'slant_left',
hl = {
fg = '#df0000',
bg = '#ffffff',
},
},
})
-- }}}
-- Active ALE Warning Component {{{
table.insert(active[3], {
provider = 'ale_warning',
hl = {
fg = '#ffffff',
bg = '#ff8700',
},
left_sep = {
str = 'slant_left',
hl = function()
if ale.get_diagnostic_count('error') > 0 then
return {
fg = '#ff8700',
bg = '#df0000',
}
else
return {
fg = '#ff8700',
bg = '#ffffff',
}
end
end,
},
})
-- }}}
-- Inactive Left
-- File Info {{{
table.insert(components.inactive[1], {
provider = {
name = 'file_info',
opts = { colored_icon = false },
},
hl = { bg = '#047857' },
right_sep = 'slant_right',
left_sep = 'block',
})
-- }}}
-- Inactive Right
-- File Encoding {{{
table.insert(components.active[3], {
provider = 'file_encoding',
right_sep = 'block',
})
-- }}}
require('feline').setup({
components = components,
custom_providers = {
ale_status = ale.status_provider,
ale_error = ale.diagnostic_error_provider,
ale_warning = ale.diagnostic_warning_provider,
},
})