aboutsummaryrefslogtreecommitdiff
path: root/lua/config
diff options
context:
space:
mode:
authorjdhao <jdhao@hotmail.com>2021-12-05 16:09:21 +0800
committerjdhao <jdhao@hotmail.com>2021-12-05 16:09:21 +0800
commit8e46441a3661370bebdb7bec0d77332dae2d427f (patch)
treeffb01a71ee1854981890793b2d355ac4761906af /lua/config
parent4d497ec8a76d9ded8a99c0e33b51fd4e99974ee7 (diff)
update lualine conf
Diffstat (limited to 'lua/config')
-rw-r--r--lua/config/statusline.lua50
1 files changed, 45 insertions, 5 deletions
diff --git a/lua/config/statusline.lua b/lua/config/statusline.lua
index 6b6dad7..aad6564 100644
--- a/lua/config/statusline.lua
+++ b/lua/config/statusline.lua
@@ -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'},
})