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
|
local function lualine_spell()
if vim.wo.spell then
return "spell"
else
return
end
end
local conditions = {
spell_on = function()
return vim.wo.spell
end,
filetype_is_tex = function()
return vim.bo.filetype == "tex"
end
}
-- https://www.reddit.com/r/neovim/comments/u2uc4p/your_lualine_custom_features/i4muvp6/
-- override 'encoding': don't display if encoding is utf-8.
local encoding = function()
local ret, _ = vim.bo.fenc:gsub("^utf%-8$", "")
return ret
end
-- fileformat: don't display if &ff is unix.
local fileformat = function()
local ret, _ = vim.bo.fileformat:gsub("^unix$", "")
return ret
end
return {
"nvim-lualine/lualine.nvim",
event = "VeryLazy",
dependencies = {
"nvim-tree/nvim-web-devicons"
},
config = function()
require("lualine").setup({
options = {
icons_enabled = true,
theme = "catppuccin",
section_separators = { left = '', right = '' },
component_separators = { left = '', right = '' },
disabled_filetypes = {
"NvimTree",
},
},
sections = {
lualine_a = { { 'mode', fmt = string.lower } },
lualine_b = { 'branch',
{
'diff',
diff_color = {
added = { fg = 'LightGreen' },
modified = { fg = 'LightBlue' },
removed = { fg = 'LightRed' },
}
},
{
lualine_spell,
cond = conditions.spell_on,
} },
lualine_c = { 'filename' },
lualine_x = { encoding, fileformat, 'filetype' },
lualine_y = { 'progress' },
lualine_z = {
'location', {
'diagnostics',
sources = { 'nvim_diagnostic' },
sections = { 'error', 'warn', 'info', 'hint' },
symbols = { error = 'e', warn = 'w', info = 'i', hint = 'h' }
}
}
},
inactive_sections = {
lualine_a = {},
lualine_b = {},
lualine_c = { 'filename' },
lualine_x = {},
lualine_y = {},
lualine_z = {}
},
tabline = {},
extensions = {}
})
end,
}
|