dots - my configuration files
lualine.lua (2693B) - raw
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 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 | local colors = require("onedarkpro.helpers").get_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 local function random_icon() local symbols = { "", "", "", "", "", "" } local randomIndex = math.random(1, #symbols) return symbols[randomIndex] end local function lsp_servers() local servers = {} for _, server in pairs(vim.lsp.buf_get_clients()) do table.insert(servers, server.name) end return table.concat(servers, ", ") end local navic = require("nvim-navic") local function is_codeium_enabled() if vim.g.codeium_enabled then local status = vim.api.nvim_call_function("codeium#GetStatusString", {}) if status == " ON" then status = "on" elseif status == " * " then status = "loading.." end return status else return "off" end end -- lualine require("lualine").setup({ options = { icons_enabled = true, theme = "onedark", section_separators = { left = "", right = "" }, component_separators = { left = "", right = "" }, disabled_filetypes = { "NvimTree" }, }, sections = { lualine_a = { { "mode", -- icon = random_icon(), color = { gui = "bold" }, fmt = string.lower, }, }, lualine_c = { { "branch", color = { fg = colors.fg }, }, { "diff", source = diff_source, diff_color = { added = { fg = colors.green }, modified = { fg = colors.yellow }, removed = { fg = colors.red }, }, symbols = { added = " ", modified = "⊡ ", removed = " " }, }, { "diagnostics", symbols = { error = " ", warn = " ", info = " ", hint = " ", }, }, { lsp_servers, icon = "", color = function() if vim.lsp.status()[1] then return { fg = colors.red } end return { fg = colors.purple } end, }, { is_codeium_enabled, icon = " ai:", color = function() if vim.g.codeium_enabled then return { fg = colors.green } else return { fg = colors.red } end end, }, --[[ { "navic", color_correction = nil, navic_opts = nil }, ]] }, lualine_b = { { Session_name, icon = "", color = { fg = colors.fg }, }, }, lualine_x = { { "encoding", color = { fg = colors.purple }, }, { "fileformat", }, { "filetype", color = { fg = colors.blue }, }, }, lualine_y = { { "progress", color = { fg = colors.fg }, fmt = string.lower } }, }, }) |