|
@@ -1,6 +1,17 @@
|
|
local conditions = require "core.lualine.conditions"
|
|
local conditions = require "core.lualine.conditions"
|
|
local colors = require "core.lualine.colors"
|
|
local colors = require "core.lualine.colors"
|
|
|
|
|
|
|
|
+local function diff_source()
|
|
|
|
+ local gitsigns = vim.b.gitsigns_status_dict
|
|
|
|
+ if gitsigns then
|
|
|
|
+ return {
|
|
|
|
+ added = gitsigns.added,
|
|
|
|
+ modified = gitsigns.changed,
|
|
|
|
+ removed = gitsigns.removed,
|
|
|
|
+ }
|
|
|
|
+ end
|
|
|
|
+end
|
|
|
|
+
|
|
return {
|
|
return {
|
|
mode = {
|
|
mode = {
|
|
function()
|
|
function()
|
|
@@ -8,34 +19,29 @@ return {
|
|
end,
|
|
end,
|
|
left_padding = 0,
|
|
left_padding = 0,
|
|
right_padding = 0,
|
|
right_padding = 0,
|
|
- condition = function()
|
|
|
|
- return true
|
|
|
|
- end,
|
|
|
|
color = {},
|
|
color = {},
|
|
|
|
+ condition = nil,
|
|
},
|
|
},
|
|
branch = {
|
|
branch = {
|
|
- "branch",
|
|
|
|
|
|
+ "b:gitsigns_head",
|
|
icon = " ",
|
|
icon = " ",
|
|
- condition = function()
|
|
|
|
- return conditions.hide_in_width() and conditions.check_git_workspace()
|
|
|
|
- end,
|
|
|
|
color = { gui = "bold" },
|
|
color = { gui = "bold" },
|
|
|
|
+ condition = conditions.hide_in_width,
|
|
},
|
|
},
|
|
filename = {
|
|
filename = {
|
|
"filename",
|
|
"filename",
|
|
- condition = function()
|
|
|
|
- return true
|
|
|
|
- end,
|
|
|
|
color = {},
|
|
color = {},
|
|
|
|
+ condition = nil,
|
|
},
|
|
},
|
|
diff = {
|
|
diff = {
|
|
"diff",
|
|
"diff",
|
|
|
|
+ source = diff_source,
|
|
symbols = { added = " ", modified = "柳", removed = " " },
|
|
symbols = { added = " ", modified = "柳", removed = " " },
|
|
color_added = { fg = colors.green },
|
|
color_added = { fg = colors.green },
|
|
color_modified = { fg = colors.yellow },
|
|
color_modified = { fg = colors.yellow },
|
|
color_removed = { fg = colors.red },
|
|
color_removed = { fg = colors.red },
|
|
- condition = conditions.hide_in_width,
|
|
|
|
color = {},
|
|
color = {},
|
|
|
|
+ condition = nil,
|
|
},
|
|
},
|
|
python_env = {
|
|
python_env = {
|
|
function()
|
|
function()
|
|
@@ -53,15 +59,15 @@ return {
|
|
end
|
|
end
|
|
return ""
|
|
return ""
|
|
end,
|
|
end,
|
|
- condition = conditions.hide_in_width,
|
|
|
|
color = { fg = colors.green },
|
|
color = { fg = colors.green },
|
|
|
|
+ condition = conditions.hide_in_width,
|
|
},
|
|
},
|
|
diagnostics = {
|
|
diagnostics = {
|
|
"diagnostics",
|
|
"diagnostics",
|
|
sources = { "nvim_lsp" },
|
|
sources = { "nvim_lsp" },
|
|
symbols = { error = " ", warn = " ", info = " ", hint = " " },
|
|
symbols = { error = " ", warn = " ", info = " ", hint = " " },
|
|
- condition = conditions.hide_in_width,
|
|
|
|
color = {},
|
|
color = {},
|
|
|
|
+ condition = conditions.hide_in_width,
|
|
},
|
|
},
|
|
treesitter = {
|
|
treesitter = {
|
|
function()
|
|
function()
|
|
@@ -70,8 +76,8 @@ return {
|
|
end
|
|
end
|
|
return ""
|
|
return ""
|
|
end,
|
|
end,
|
|
- condition = conditions.hide_in_width,
|
|
|
|
color = { fg = colors.green },
|
|
color = { fg = colors.green },
|
|
|
|
+ condition = conditions.hide_in_width,
|
|
},
|
|
},
|
|
lsp = {
|
|
lsp = {
|
|
function(msg)
|
|
function(msg)
|
|
@@ -106,8 +112,8 @@ return {
|
|
return table.concat(buf_client_names, ", ")
|
|
return table.concat(buf_client_names, ", ")
|
|
end,
|
|
end,
|
|
icon = " ",
|
|
icon = " ",
|
|
- condition = conditions.hide_in_width,
|
|
|
|
color = { gui = "bold" },
|
|
color = { gui = "bold" },
|
|
|
|
+ condition = conditions.hide_in_width,
|
|
},
|
|
},
|
|
location = { "location", condition = conditions.hide_in_width, color = {} },
|
|
location = { "location", condition = conditions.hide_in_width, color = {} },
|
|
progress = { "progress", condition = conditions.hide_in_width, color = {} },
|
|
progress = { "progress", condition = conditions.hide_in_width, color = {} },
|
|
@@ -125,8 +131,8 @@ return {
|
|
encoding = {
|
|
encoding = {
|
|
"o:encoding",
|
|
"o:encoding",
|
|
upper = true,
|
|
upper = true,
|
|
- condition = conditions.hide_in_width,
|
|
|
|
color = {},
|
|
color = {},
|
|
|
|
+ condition = conditions.hide_in_width,
|
|
},
|
|
},
|
|
filetype = { "filetype", condition = conditions.hide_in_width, color = {} },
|
|
filetype = { "filetype", condition = conditions.hide_in_width, color = {} },
|
|
scrollbar = {
|
|
scrollbar = {
|
|
@@ -140,9 +146,7 @@ return {
|
|
end,
|
|
end,
|
|
left_padding = 0,
|
|
left_padding = 0,
|
|
right_padding = 0,
|
|
right_padding = 0,
|
|
- condition = function()
|
|
|
|
- return true
|
|
|
|
- end,
|
|
|
|
color = { fg = colors.yellow, bg = colors.bg },
|
|
color = { fg = colors.yellow, bg = colors.bg },
|
|
|
|
+ condition = nil,
|
|
},
|
|
},
|
|
}
|
|
}
|