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 ""
|
||||
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({
|
||||
options = {
|
||||
icons_enabled = true,
|
||||
@ -17,11 +30,38 @@ require("lualine").setup({
|
||||
},
|
||||
sections = {
|
||||
lualine_a = { "mode" },
|
||||
lualine_b = { "branch", "diff", },
|
||||
lualine_c = { spell, "filename" },
|
||||
lualine_x = { "encoding", "fileformat", "filetype" },
|
||||
lualine_b = { "branch", "diff" },
|
||||
lualine_c = {
|
||||
{
|
||||
spell,
|
||||
color = "Cursor"
|
||||
},
|
||||
"filename"
|
||||
},
|
||||
lualine_x = {
|
||||
"encoding",
|
||||
{
|
||||
"fileformat",
|
||||
symbols = {
|
||||
unix = "unix",
|
||||
dos = "win",
|
||||
mac = "mac",
|
||||
},
|
||||
},
|
||||
"filetype",
|
||||
},
|
||||
lualine_y = { "progress" },
|
||||
lualine_z = { "location", { "diagnostics", sources = { "nvim_lsp" } }},
|
||||
lualine_z = {
|
||||
"location",
|
||||
{
|
||||
"diagnostics",
|
||||
sources = { "nvim_lsp" }
|
||||
},
|
||||
{
|
||||
trailing_space,
|
||||
color = "WarningMsg"
|
||||
}
|
||||
},
|
||||
},
|
||||
inactive_sections = {
|
||||
lualine_a = {},
|
||||
@ -32,6 +72,6 @@ require("lualine").setup({
|
||||
lualine_z = {},
|
||||
},
|
||||
tabline = {},
|
||||
extensions = {},
|
||||
extensions = {'quickfix', 'fugitive'},
|
||||
})
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user