commit
This commit is contained in:
parent
f02bfafd25
commit
871f585ebb
@ -1,7 +1,49 @@
|
||||
local function base_name(path)
|
||||
local l = 0
|
||||
for i = 1, #path do
|
||||
local c = path:sub(i, i)
|
||||
if c == "/" then
|
||||
l = i
|
||||
end
|
||||
end
|
||||
|
||||
return path:sub(l + 1)
|
||||
end
|
||||
|
||||
local function project_name()
|
||||
return {
|
||||
function()
|
||||
return base_name(vim.fn.getcwd())
|
||||
end,
|
||||
icon = "",
|
||||
color = {
|
||||
fg = "orange",
|
||||
gui = "bold",
|
||||
},
|
||||
}
|
||||
end
|
||||
|
||||
return {
|
||||
"nvim-lualine/lualine.nvim",
|
||||
dependencies = { "nvim-tree/nvim-web-devicons" },
|
||||
config = function()
|
||||
require("lualine").setup()
|
||||
require("lualine").setup({
|
||||
sections = {
|
||||
lualine_a = { "mode" },
|
||||
lualine_b = { project_name(), "branch", "diff", "diagnostics" },
|
||||
lualine_c = { "filename" },
|
||||
lualine_x = { "encoding", "fileformat", "filetype" },
|
||||
lualine_y = { "progress" },
|
||||
lualine_z = { "location" },
|
||||
},
|
||||
inactive_sections = {
|
||||
lualine_a = {},
|
||||
lualine_b = {},
|
||||
lualine_c = { "filename" },
|
||||
lualine_x = { "location" },
|
||||
lualine_y = {},
|
||||
lualine_z = {},
|
||||
},
|
||||
})
|
||||
end,
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user