forked from LunarVim/Launch.nvim
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlualine.lua
68 lines (59 loc) · 1.92 KB
/
lualine.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
local M = {
"nvim-lualine/lualine.nvim",
commit = "7533b0ead663d80452210c0c089e5105089697e5",
}
function M.config()
local sl_hl = vim.api.nvim_get_hl_by_name("StatusLine", true)
vim.api.nvim_set_hl(0, "Copilot", { fg = "#6CC644", bg = sl_hl.background })
local icons = require "user.icons"
local diff = {
"diff",
colored = true,
symbols = { added = icons.git.LineAdded, modified = icons.git.LineModified, removed = icons.git.LineRemoved }, -- Changes the symbols used by the diff.
}
local copilot = function()
local buf_clients = vim.lsp.get_active_clients { bufnr = 0 }
if #buf_clients == 0 then
return "LSP Inactive"
end
local buf_client_names = {}
local copilot_active = false
for _, client in pairs(buf_clients) do
if client.name ~= "null-ls" and client.name ~= "copilot" then
table.insert(buf_client_names, client.name)
end
if client.name == "copilot" then
copilot_active = true
end
end
if copilot_active then
return "%#Copilot#" .. icons.git.Octoface .. "%*"
end
return ""
end
require("lualine").setup {
options = {
-- component_separators = { left = "", right = "" },
-- section_separators = { left = "", right = "" },
component_separators = { left = "", right = "" },
section_separators = { left = "", right = "" },
ignore_focus = { "NvimTree" },
},
sections = {
-- lualine_a = { {"branch", icon =""} },
-- lualine_b = { diff },
-- lualine_c = { "diagnostics" },
-- lualine_x = { copilot },
-- lualine_y = { "filetype" },
-- lualine_z = { "progress" },
lualine_a = { "mode" },
lualine_b = { "branch" },
lualine_c = { diff },
lualine_x = { "diagnostics", copilot },
lualine_y = { "filetype" },
lualine_z = { "progress" },
},
extensions = { "quickfix", "man", "fugitive" },
}
end
return M