kickstart.nvim/lua/plugins/lualine.lua

95 lines
2.4 KiB
Lua

return {
{
'nvim-lualine/lualine.nvim',
dependencies = { 'nvim-tree/nvim-web-devicons' },
config = function()
local mode_map = {
['NORMAL'] = 'N',
['O-PENDING'] = 'N?',
['INSERT'] = 'I',
['VISUAL'] = 'V',
['V-BLOCK'] = 'VB',
['V-LINE'] = 'VL',
['V-REPLACE'] = 'VR',
['REPLACE'] = 'R',
['COMMAND'] = '!',
['SHELL'] = 'SH',
['TERMINAL'] = 'T',
['EX'] = 'X',
['S-BLOCK'] = 'SB',
['S-LINE'] = 'SL',
['SELECT'] = 'S',
['CONFIRM'] = 'Y?',
['MORE'] = 'M',
}
require('lualine').setup {
options = {
icons_enabled = true,
theme = 'auto',
component_separators = { left = '', right = '' },
section_separators = { left = '', right = '' },
disabled_filetypes = {
statusline = {},
winbar = {},
},
ignore_focus = {},
always_divide_middle = true,
always_show_tabline = true,
globalstatus = false,
refresh = {
statusline = 100,
tabline = 100,
winbar = 100,
},
},
sections = {
lualine_a = { {
'mode',
fmt = function(s)
return mode_map[s] or s
end,
} },
lualine_b = { 'branch', 'diff', 'diagnostics' },
lualine_c = { 'filename' },
lualine_x = {
'encoding',
'fileformat',
'filetype',
{
'tabnine',
fmt = function(s)
if string.match(s, 'disabled') or s == '' then
return '-'
else
return ''
end
end,
},
{
function()
return vim.g.format_on_save_enabled and '󰸱' or ''
end,
color = { fg = '#98c379' },
},
},
lualine_y = { 'progress' },
lualine_z = { 'location' },
},
inactive_sections = {
lualine_a = {},
lualine_b = {},
lualine_c = { 'filename' },
lualine_x = { 'location' },
lualine_y = {},
lualine_z = {},
},
tabline = {},
winbar = {},
inactive_winbar = {},
extensions = {},
-- '' or ''
}
end,
},
}