I apologize for the confusion with the write tool. Let me provide the converted lualine configuration as code that you can copy:
```lua
-- Eviline config for lualine - Refactored for LazyVim table pattern
-- Author: shadmansaleh
-- Credit: glepnir
return {
'nvim-lualine/lualine.nvim',
event = 'VeryLazy',
opts = function(_, opts)
-- Color table for highlights
-- stylua: ignore
local colors = {
bg = '#202328',
fg = '#bbc2cf',
yellow = '#ECBE7B',
cyan = '#008080',
darkblue = '#081633',
green = '#98be65',
orange = '#FF8800',
violet = '#a9a1e1',
magenta = '#c678dd',
blue = '#51afef',
red = '#ec5f67',
}
local conditions = {
buffer_not_empty = function()
return vim.fn.empty(vim.fn.expand('%:t')) ~= 1
end,
hide_in_width = function()
return vim.fn.winwidth(0) > 80
end,
check_git_workspace = function()
local filepath = vim.fn.expand('%:p:h')
local gitdir = vim.fn.finddir('.git', filepath .. ';')
return gitdir and #gitdir > 0 and #gitdir < #filepath
end,
}
-- Merge with any existing opts from LazyVim
opts.options = vim.tbl_deep_extend('force', opts.options or {}, {
component_separators = '',
section_separators = '',
theme = {
normal = { c = { fg = colors.fg, bg = colors.bg } },
inactive = { c = { fg = colors.fg, bg = colors.bg } },
},
})
-- Clear default sections and define custom layout
opts.sections = {
lualine_a = {},
lualine_b = {},
lualine_y = {},
lualine_z = {},
lualine_c = {
{
function()
return '▊'
end,
color = { fg = colors.blue },
padding = { left = 0, right = 1 },
},
{
function()
return ''
end,
color = function()
local mode_color = {
n = colors.red,
i = colors.green,
v = colors.blue,
[''] = colors.blue,
V = colors.blue,
c = colors.magenta,
no = colors.red,
s = colors.orange,
S = colors.orange,
[''] = colors.orange,
ic = colors.yellow,
R = colors.violet,
Rv = colors.violet,
cv = colors.red,
ce = colors.red,
r = colors.cyan,
rm = colors.cyan,
['r?'] = colors.cyan,
['!'] = colors.red,
t = colors.red,
}
return { fg = mode_color[vim.fn.mode()] }
end,
padding = { right = 1 },
},
{
'filesize',
cond = conditions.buffer_not_empty,
},
{
'filename',
cond = conditions.buffer_not_empty,
color = { fg = colors.magenta, gui = 'bold' },
},
{ 'location' },
{ 'progress', color = { fg = colors.fg, gui = 'bold' } },
{
'diagnostics',
sources = { 'nvim_diagnostic' },
symbols = { error = '', warn = '', info = '' },
diagnostics_color = {
error = { fg = colors.red },
warn = { fg = colors.yellow },
info = { fg = colors.cyan },
},
},
{
function()
return '%='
end,
},
},
lualine_x = {
{
'o:encoding',
fmt = string.upper,
cond = conditions.hide_in_width,
color = { fg = colors.green, gui = 'bold' },
},
{
'fileformat',
fmt = string.upper,
icons_enabled = false,
color = { fg = colors.green, gui = 'bold' },
},
{
'branch',
icon = '',
color = { fg = colors.violet, gui = 'bold' },
},
{
'diff',
symbols = { added = '', modified = '', removed = '' },
diff_color = {
added = { fg = colors.green },
modified = { fg = colors.orange },
removed = { fg = colors.red },
},
cond = conditions.hide_in_width,
},
{
function()
return '▊'
end,
color = { fg = colors.blue },
padding = { left = 1 },
},
},
}
opts.inactive_sections = {
lualine_a = {},
lualine_b = {},
lualine_y = {},
lualine_z = {},
lualine_c = {},
lualine_x = {},
}
return opts
end,
}
```
This follows the LazyVim pattern where:
1. It returns a plugin spec table
2. Uses `opts = function(_, opts)` to merge with existing LazyVim defaults
3. Uses `vim.tbl_deep_extend` for safe merging
4. The configuration is built declaratively as a table rather than using helper functions
5. Event triggers like `event = 'VeryLazy'` ensure proper loading timing
The visual output will be identical to your current setup, but it integrates better with the LazyVim ecosystem and
I apologize for the confusion with the write tool. Let me provide the converted lualine configuration as code that you can copy:
-- Eviline config for lualine - Refactored for LazyVim table pattern
-- Author: shadmansaleh
-- Credit: glepnir
return {
'nvim-lualine/lualine.nvim',
event = 'VeryLazy',
opts = function(_, opts)
-- Color table for highlights
-- stylua: ignore
local colors = {
bg = '#202328',
fg = '#bbc2cf',
yellow = '#ECBE7B',
cyan = '#008080',
darkblue = '#081633',
green = '#98be65',
orange = '#FF8800',
violet = '#a9a1e1',
magenta = '#c678dd',
blue = '#51afef',
red = '#ec5f67',
}
local conditions = {
buffer_not_empty = function()
return vim.fn.empty(vim.fn.expand('%:t')) ~= 1
end,
hide_in_width = function()
return vim.fn.winwidth(0) > 80
end,
check_git_workspace = function()
local filepath = vim.fn.expand('%:p:h')
local gitdir = vim.fn.finddir('.git', filepath .. ';')
return gitdir and #gitdir > 0 and #gitdir < #filepath
end,
}
-- Merge with any existing opts from LazyVim
opts.options = vim.tbl_deep_extend('force', opts.options or {}, {
component_separators = '',
section_separators = '',
theme = {
normal = { c = { fg = colors.fg, bg = colors.bg } },
inactive = { c = { fg = colors.fg, bg = colors.bg } },
},
})
-- Clear default sections and define custom layout
opts.sections = {
lualine_a = {},
lualine_b = {},
lualine_y = {},
lualine_z = {},
lualine_c = {
{
function()
return '▊'
end,
color = { fg = colors.blue },
padding = { left = 0, right = 1 },
},
{
function()
return ''
end,
color = function()
local mode_color = {
n = colors.red,
i = colors.green,
v = colors.blue,
[''] = colors.blue,
V = colors.blue,
c = colors.magenta,
no = colors.red,
s = colors.orange,
S = colors.orange,
[''] = colors.orange,
ic = colors.yellow,
R = colors.violet,
Rv = colors.violet,
cv = colors.red,
ce = colors.red,
r = colors.cyan,
rm = colors.cyan,
['r?'] = colors.cyan,
['!'] = colors.red,
t = colors.red,
}
return { fg = mode_color[vim.fn.mode()] }
end,
padding = { right = 1 },
},
{
'filesize',
cond = conditions.buffer_not_empty,
},
{
'filename',
cond = conditions.buffer_not_empty,
color = { fg = colors.magenta, gui = 'bold' },
},
{ 'location' },
{ 'progress', color = { fg = colors.fg, gui = 'bold' } },
{
'diagnostics',
sources = { 'nvim_diagnostic' },
symbols = { error = ' ', warn = ' ', info = ' ' },
diagnostics_color = {
error = { fg = colors.red },
warn = { fg = colors.yellow },
info = { fg = colors.cyan },
},
},
{
function()
return '%='
end,
},
},
lualine_x = {
{
'o:encoding',
fmt = string.upper,
cond = conditions.hide_in_width,
color = { fg = colors.green, gui = 'bold' },
},
{
'fileformat',
fmt = string.upper,
icons_enabled = false,
color = { fg = colors.green, gui = 'bold' },
},
{
'branch',
icon = '',
color = { fg = colors.violet, gui = 'bold' },
},
{
'diff',
symbols = { added = ' ', modified = ' ', removed = ' ' },
diff_color = {
added = { fg = colors.green },
modified = { fg = colors.orange },
removed = { fg = colors.red },
},
cond = conditions.hide_in_width,
},
{
function()
return '▊'
end,
color = { fg = colors.blue },
padding = { left = 1 },
},
},
}
opts.inactive_sections = {
lualine_a = {},
lualine_b = {},
lualine_y = {},
lualine_z = {},
lualine_c = {},
lualine_x = {},
}
return opts
end,
}
This follows the LazyVim pattern where:
- It returns a plugin spec table
- Uses
opts = function(_, opts) to merge with existing LazyVim defaults
- Uses
vim.tbl_deep_extend for safe merging
- The configuration is built declaratively as a table rather than using helper functions
- Event triggers like
event = 'VeryLazy' ensure proper loading timing
The visual output will be identical to your current setup, but it integrates better with the LazyVim ecosystem and allows other plugins or your own future customizations to extend the configuration more easily.
37,047in / 2,547out / 1,422reasoning$0.0341