mirror of
https://github.com/jdhao/nvim-config.git
synced 2025-06-08 14:14:33 +02:00
update lualine conf
This commit is contained in:
parent
4d497ec8a7
commit
8e46441a36
@ -6,6 +6,19 @@ local function spell()
|
|||||||
return ""
|
return ""
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local function trailing_space()
|
||||||
|
local trailing_space_pos = vim.b.trailing_whitespace_pos
|
||||||
|
|
||||||
|
local msg = ""
|
||||||
|
if #trailing_space_pos > 0 then
|
||||||
|
-- Note that lua index is 1-based, not zero based!!!
|
||||||
|
local line = trailing_space_pos[1][1]
|
||||||
|
msg = string.format("[%d]trailing", line)
|
||||||
|
end
|
||||||
|
|
||||||
|
return msg
|
||||||
|
end
|
||||||
|
|
||||||
require("lualine").setup({
|
require("lualine").setup({
|
||||||
options = {
|
options = {
|
||||||
icons_enabled = true,
|
icons_enabled = true,
|
||||||
@ -17,11 +30,38 @@ require("lualine").setup({
|
|||||||
},
|
},
|
||||||
sections = {
|
sections = {
|
||||||
lualine_a = { "mode" },
|
lualine_a = { "mode" },
|
||||||
lualine_b = { "branch", "diff", },
|
lualine_b = { "branch", "diff" },
|
||||||
lualine_c = { spell, "filename" },
|
lualine_c = {
|
||||||
lualine_x = { "encoding", "fileformat", "filetype" },
|
{
|
||||||
|
spell,
|
||||||
|
color = "Cursor"
|
||||||
|
},
|
||||||
|
"filename"
|
||||||
|
},
|
||||||
|
lualine_x = {
|
||||||
|
"encoding",
|
||||||
|
{
|
||||||
|
"fileformat",
|
||||||
|
symbols = {
|
||||||
|
unix = "unix",
|
||||||
|
dos = "win",
|
||||||
|
mac = "mac",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
"filetype",
|
||||||
|
},
|
||||||
lualine_y = { "progress" },
|
lualine_y = { "progress" },
|
||||||
lualine_z = { "location", { "diagnostics", sources = { "nvim_lsp" } }},
|
lualine_z = {
|
||||||
|
"location",
|
||||||
|
{
|
||||||
|
"diagnostics",
|
||||||
|
sources = { "nvim_lsp" }
|
||||||
|
},
|
||||||
|
{
|
||||||
|
trailing_space,
|
||||||
|
color = "WarningMsg"
|
||||||
|
}
|
||||||
|
},
|
||||||
},
|
},
|
||||||
inactive_sections = {
|
inactive_sections = {
|
||||||
lualine_a = {},
|
lualine_a = {},
|
||||||
@ -32,6 +72,6 @@ require("lualine").setup({
|
|||||||
lualine_z = {},
|
lualine_z = {},
|
||||||
},
|
},
|
||||||
tabline = {},
|
tabline = {},
|
||||||
extensions = {},
|
extensions = {'quickfix', 'fugitive'},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user