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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
|
return {
'nvim-lualine/lualine.nvim',
dependencies = { 'nvim-tree/nvim-web-devicons' },
config = function()
local colors = require("solarized-osaka.colors").setup({ transform = true })
local config = require("solarized-osaka.config").options
local solarized_osaka = {
normal = {
a = { bg = colors.base03, fg = colors.blue100 },
b = { bg = colors.fg, fg = colors.black },
c = { bg = colors.bg_statusline, fg = colors.fg },
},
insert = {
a = { bg = colors.base03, fg = colors.green100 },
},
command = {
a = { bg = colors.base03, fg = colors.yellow100 },
},
visual = {
a = { bg = colors.base03, fg = colors.magenta100 },
},
replace = {
a = { bg = colors.base03, fg = colors.red100 },
},
terminal = {
a = { bg = colors.base03, fg = colors.orange100 },
},
inactive = {
a = { bg = colors.bg_statusline, fg = colors.blue },
b = { bg = colors.bg_statusline, fg = colors.fg, gui = "bold" },
c = { bg = colors.bg_statusline, fg = colors.fg },
}
}
for _, mode in pairs(solarized_osaka) do
if config.lualine_bold then
mode.a.gui = "bold"
end
end
-- local empty = require('lualine.component'):extend()
-- local function jarak()
-- return ' '
-- end
local empty = require('lualine.component'):extend()
function empty:draw(default_highlight)
self.status = ''
self.applied_separator = ''
self:apply_highlights(default_highlight)
self:apply_section_separators()
return self.status
end
local function process_sections(sections)
for name, section in pairs(sections) do
local left = name:sub(9, 10) < 'x'
for pos = 1, name ~= 'lualine_z' and #section or #section - 1 do
table.insert(section, pos * 2, { empty, color = { fg = colors.base03, bg = colors.base03 } })
end
for id, comp in ipairs(section) do
if type(comp) ~= 'table' then
comp = { comp }
section[id] = comp
end
-- comp.separator = left and { right = '' } or { left = '' }
comp.separator = left and { right = ' ' } or { left = ' '}
-- comp.separator = {left = '' } and { right = '' }
end
end
return sections
end
local lazy_status = require("lazy.status")
require('lualine').setup{
options =
{
theme = solarized_osaka,
-- icons_enabled = true,
-- component_separators = { left = '>', right = '┇' },
-- section_separators = {left = '', right = '' },
},
sections = process_sections {
lualine_a = {
{ 'mode',
icons_enabled = true,
icon = {
" ",
color = { fg = colors.base4, bg = colors.base03, gui = 'bold'}
},
-- color = { fg = colors.base0, bg = colors.green300, gui = 'bold' },
-- separator = { left = '', right = '' },
-- left_padding = 2, right_padding = 0,
},
},
-- lualine_b = { 'filename', 'branch' },
lualine_b = {
{
'branch',
-- separator = { left = '', right = '' },
-- left_padding = 0, right_padding = 2,
icon = {
"",
-- align = 'left',
color = { fg = colors.orange100, bg = colors.base03, gui = 'bold'},
-- -- separator = {left = '', right = ''}
},
-- left_padding = 0,
color = { fg = colors.orange100, bg = colors.base03, gui = 'bold' },
},
{
'diff',
-- separator = { right = '',left = ''},
colored = true,
symbols = { added = " " , modified = " " , removed = " " },
diff_color = {
added = { fg = colors.green300, bg = colors.base03, gui = 'bold' },
modified = { fg = colors.yellow300, bg = colors.base03, gui = 'bold' },
removed = { fg = colors.red300, bg = colors.base03, gui = 'bold' },
}
},
},
lualine_c = {
{
'filename',
on_click = function()
require('telescope.builtin').find_files()
-- print('file name clicked')
end,
icon = ' ',
color = { fg = colors.yellow100, bg = colors.base03, gui = 'bold'},
path = 4,
file_status = false,
-- separator = { right = '┇', left = '┇'},
},
},
lualine_x = {
{
'diagnostics',
on_click = function()
require('telescope.builtin').diagnostics()
end,
-- separator = { left = '' },
sources = { 'nvim_diagnostic'},
sections = { 'error', 'warn', 'info', 'hint' },
diagnostics_color = {
error = { fg = colors.red300, bg = colors.base03 , gui = 'bold'}, -- Changes diagnostics' error color.
added = { fg = colors.green300, bg = colors.base03, gui = 'bold'},
warn = { fg = colors.yellow300, bg = colors.base03, gui = 'bold' }, -- Changes diagnostics' warn color.
info = { fg = colors.blue300, bg = colors.base03, gui = 'bold' }, -- Changes diagnostics' info color.
hint = { fg = colors.cyan300, bg = colors.base03, gui = 'bold' }, -- Changes diagnostics' hint color.
},
symbols = { error = " ", warn = " ", hint = " ", info = " " },
colored = true, -- Displays diagnostics status in color if set to true.
update_in_insert = true, -- Update diagnostics in insert mode. default = false
always_visible = false, -- Show diagnostics even if there are none.
},
{
lazy_status.updates,
cond = lazy_status.has_updates,
color = {fg=colors.orange300},
},
{
-- code from https://github.com/nvim-lualine/lualine.nvim/blob/566b7036f717f3d676362742630518a47f132fff/examples/evil_lualine.lua
-- Lsp server name .
function()
local msg = 'No LSP'
local buf_ft = vim.api.nvim_get_option_value("filetype", { buf = 0 })
local clients = vim.lsp.get_clients()
if next(clients) == nil then
return msg
end
for _, client in ipairs(clients) do
local filetypes = client.config.filetypes
if filetypes and vim.fn.index(filetypes, buf_ft) ~= -1 then
return client.name
end
end
return msg
end,
-- icon = ' LSP:',
-- icon = {' ', color = {bg = colors.base03, fg = colors.red100}},
-- separator = { left = '', right = ''},
-- separator = { left = ' ', right = ' '},
color = { fg = colors.base4, gui = 'bold', bg = colors.base03 },
},
{
'filetype',
color = {bg = colors.base03, fg = colors.magenta100, gui = 'bold'}
-- separator = { left = '', right = ' ' },
}
},
lualine_y = {
{
'progress', left_padding = 0,
color = {bg = colors.base03, fg = colors.cyan100, gui = 'bold'}
}
},
lualine_z = {
{
-- 'location',
-- function()
-- return "Ln:%l Col:%c"
-- end
-- separator = { right = '' }, left_padding = 2 },
}
},
},
inactive_sections = {
lualine_a = {},
lualine_b = {},
lualine_c = {'filename'},
lualine_x = {'location'},
lualine_y = {},
lualine_z = {},
},
tabline = {},
extensions = {},
}
end
}
|