1
- --- @diagnostic disable : unused-function
2
- --- @diagnostic disable : unused-local
3
-
4
1
local user = require (' user_api' )
5
2
local Check = user .check
6
3
local types = user .types .lualine
@@ -12,169 +9,166 @@ local floor = math.floor
12
9
local M = {}
13
10
14
11
--- @diagnostic disable-next-line : missing-fields
15
- M .components = {
16
- buffers = {
17
- ' buffers' ,
18
-
19
- filetype_names = {
20
- TelescopePrompt = ' Telescope' ,
21
- dashboard = ' Dashboard' ,
22
- packer = ' Packer' ,
23
- lazy = ' Lazy' ,
24
- fzf = ' FZF' ,
25
- alpha = ' Alpha' ,
26
- NvimTree = ' Nvim Tree' ,
27
- },
28
-
29
- symbols = {
30
- modified = ' ●' , -- Text to show when the buffer is modified
31
- alternate_file = ' #' , -- Text to show to identify the alternate file
32
- directory = ' ' , -- Text to show when the buffer is a directory
33
- },
34
-
35
- buffers_color = {
36
- active = ' lualine_a_normal' ,
37
- inactive = ' lualine_a_inactive' ,
38
- },
12
+ M .components = {}
13
+ M .components .buffers = {
14
+ ' buffers' ,
39
15
40
- max_length = floor (vim .opt .columns :get () * 2 / 3 ),
16
+ filetype_names = {
17
+ TelescopePrompt = ' Telescope' ,
18
+ dashboard = ' Dashboard' ,
19
+ packer = ' Packer' ,
20
+ lazy = ' Lazy' ,
21
+ fzf = ' FZF' ,
22
+ alpha = ' Alpha' ,
23
+ NvimTree = ' Nvim Tree' ,
41
24
},
42
25
43
- diff = {
44
- ' diff' ,
45
- colored = true ,
46
- diff_color = {
47
- added = ' LuaLineDiffAdd' ,
48
- modified = ' LuaLineDiffChange' ,
49
- removed = ' LuaLineDiffDelete' ,
50
- },
51
-
52
- symbols = {
53
- added = ' +' ,
54
- modified = ' ~' ,
55
- removed = ' -' ,
56
- },
26
+ symbols = {
27
+ modified = ' ●' , -- Text to show when the buffer is modified
28
+ alternate_file = ' #' , -- Text to identify the alternate file
29
+ directory = ' ' , -- Text to show when the buffer is a directory
57
30
},
58
31
59
- encoding = { ' encoding ' },
60
- hostname = { ' hostname ' } ,
61
- location = { ' location ' } ,
62
- selectioncount = { ' selectioncount ' },
32
+ buffers_color = {
33
+ active = ' lualine_a_normal ' ,
34
+ inactive = ' lualine_a_inactive ' ,
35
+ },
63
36
64
- filename = {
65
- ' filename ' ,
37
+ max_length = floor ( vim . opt . columns : get () / 4 ),
38
+ }
66
39
67
- file_status = true ,
68
- newfile_status = false ,
69
- path = 4 ,
40
+ M .components .diff = {
41
+ ' diff' ,
42
+ colored = true ,
43
+ diff_color = {
44
+ added = ' LuaLineDiffAdd' ,
45
+ modified = ' LuaLineDiffChange' ,
46
+ removed = ' LuaLineDiffDelete' ,
70
47
},
71
48
72
- filetype = {
73
- ' filetype' ,
74
- colored = true ,
75
- icon_only = false ,
76
- icon = { align = ' right' },
49
+ symbols = {
50
+ added = ' +' ,
51
+ modified = ' ~' ,
52
+ removed = ' -' ,
77
53
},
54
+ }
78
55
79
- branch = { ' branch' },
56
+ M .components .branch = { ' branch' }
57
+ M .components .encoding = { ' encoding' }
58
+ M .components .hostname = { ' hostname' }
59
+ M .components .location = { ' location' }
60
+ M .components .selectioncount = { ' selectioncount' }
61
+ M .components .filesize = { ' filesize' }
80
62
81
- fileformat = {
82
- ' fileformat ' ,
63
+ M . components . filename = {
64
+ ' filename ' ,
83
65
84
- symbols = {
85
- unix = ' ' , -- e712
86
- dos = ' ' , -- e70f
87
- mac = ' ' , -- e711
88
- },
89
- },
66
+ file_status = true ,
67
+ newfile_status = false ,
68
+ path = 4 ,
69
+ }
90
70
91
- searchcount = {
92
- maxcount = 999 ,
93
- timeout = 500 ,
94
- },
71
+ M .components .filetype = {
72
+ ' filetype' ,
73
+ colored = true ,
74
+ icon_only = false ,
75
+ icon = { align = ' right' },
76
+ }
77
+
78
+ M .components .fileformat = {
79
+ ' fileformat' ,
95
80
96
- filesize = {
97
- ' filesize' ,
81
+ symbols = {
82
+ unix = ' ' , -- e712
83
+ dos = ' ' , -- e70f
84
+ mac = ' ' , -- e711
98
85
},
86
+ }
99
87
100
- tabs = {
101
- ' tabs' ,
88
+ M .components .searchcount = {
89
+ ' searchcount' ,
90
+ maxcount = 999 ,
91
+ timeout = 500 ,
92
+ }
102
93
103
- tab_max_length = floor (vim .opt .columns :get () / 3 ),
94
+ M .components .tabs = {
95
+ ' tabs' ,
104
96
105
- mode = 2 ,
106
- path = 1 ,
107
- },
97
+ tab_max_length = floor (vim .opt .columns :get () / 3 ),
108
98
99
+ mode = 2 ,
100
+ path = 1 ,
109
101
tabs_color = {
110
102
active = ' lualine_b_normal' ,
111
103
inactive = ' lualine_b_inactive' ,
112
104
},
105
+ }
113
106
114
- windows = {
115
- ' windows' ,
116
-
117
- max_length = floor (vim .opt .columns :get () * 2 / 3 ),
107
+ M .components .windows = {
108
+ ' windows' ,
118
109
119
- disabled_buftypes = {
120
- ' quickfix' ,
121
- ' prompt' ,
122
- },
110
+ max_length = floor (vim .opt .columns :get () / 5 ),
123
111
124
- windows_color = {
125
- active = ' lualine_z_normal' ,
126
- inactive = ' lualine_z_inactive' ,
127
- },
112
+ disabled_buftypes = {
113
+ ' quickfix' ,
114
+ ' prompt' ,
128
115
},
129
116
130
- diagnostics = {
131
- ' diagnostics' ,
132
-
133
- sources = {
134
- ' nvim_workspace_diagnostic' ,
135
- },
117
+ windows_color = {
118
+ active = ' lualine_z_normal' ,
119
+ inactive = ' lualine_z_inactive' ,
120
+ },
121
+ }
136
122
137
- sections = { ' error' , ' warn' },
123
+ M .components .diagnostics = {
124
+ ' diagnostics' ,
138
125
139
- diagnostics_color = {
140
- error = ' DiagnosticError' ,
141
- warn = ' DiagnosticWarn' ,
142
- info = ' DiagnosticInfo' ,
143
- hint = ' DiagnosticHint' ,
144
- },
126
+ sources = {
127
+ ' nvim_workspace_diagnostic' ,
128
+ },
145
129
146
- symbols = {
147
- error = ' ' ,
148
- hint = ' ' ,
149
- info = ' ' ,
150
- warn = ' ' ,
151
- },
130
+ sections = { ' error' , ' warn' , ' info' , ' hint' },
152
131
153
- colored = true ,
154
- update_in_insert = false ,
155
- always_visible = true ,
132
+ diagnostics_color = {
133
+ error = ' DiagnosticError' ,
134
+ warn = ' DiagnosticWarn' ,
135
+ info = ' DiagnosticInfo' ,
136
+ hint = ' DiagnosticHint' ,
156
137
},
157
138
158
- datetime = {
159
- ' datetime' ,
160
- style = ' uk' ,
139
+ symbols = {
140
+ error = ' ' ,
141
+ hint = ' ' ,
142
+ info = ' ' ,
143
+ warn = ' ' ,
161
144
},
162
145
163
- mode = {
164
- ' mode' ,
165
- fmt = function (str ) return str :sub (1 , 1 ) end ,
166
- },
146
+ colored = true ,
147
+ update_in_insert = false ,
148
+ always_visible = true ,
149
+ }
150
+
151
+ M .components .datetime = {
152
+ ' datetime' ,
153
+ style = ' uk' ,
154
+ }
155
+
156
+ M .components .mode = {
157
+ ' mode' ,
158
+ fmt = function (str ) return str :sub (1 , 1 ) end ,
167
159
}
168
160
169
161
M .default = {
170
162
lualine_a = {
171
163
M .components .mode ,
172
164
},
173
165
lualine_b = {
166
+ M .components .branch ,
174
167
M .components .filename ,
175
168
},
176
169
lualine_c = {
177
170
M .components .diagnostics ,
171
+ M .components .diff ,
178
172
},
179
173
lualine_x = {
180
174
M .components .encoding ,
0 commit comments