diff options
| author | Elvis Claros Castro <elvis@claros.ar> | 2025-09-03 21:11:57 -0300 |
|---|---|---|
| committer | Elvis Claros Castro <elvis@claros.ar> | 2025-09-03 21:11:57 -0300 |
| commit | 97811dd201f2f88ff453303d8baa6739616cc9fb (patch) | |
| tree | a7d7c8ade9f7dd06fc2ddba7fa43e372f7c9b123 | |
| parent | 9d6f4942b982bf3c42af96ce69fc28cd3b9a9374 (diff) | |
| download | nvim-conf-97811dd201f2f88ff453303d8baa6739616cc9fb.tar.gz nvim-conf-97811dd201f2f88ff453303d8baa6739616cc9fb.zip | |
feat(statusline): migración de implementación nativa a lualine.nvim
Se reemplazó la barra de estado personalizada nativa por el plugin lualine.nvim para mejorar la flexibilidad, el mantenimiento y la estética. Se eliminó el módulo native-statusline y su configuración en config. Se agregó una nueva configuración de lualine aprovechando el esquema de colores nativo y secciones personalizadas. Este cambio permite funciones más avanzadas en la barra de estado, mejor integración con iconos y diagnósticos, y una personalización futura más sencilla.
| -rw-r--r-- | lazy-lock.json | 23 | ||||
| -rw-r--r-- | lua/config/init.lua | 3 | ||||
| -rw-r--r-- | lua/config/native-statusline.lua | 308 | ||||
| -rw-r--r-- | lua/plugins/lualine.lua | 233 |
4 files changed, 245 insertions, 322 deletions
diff --git a/lazy-lock.json b/lazy-lock.json index dc68f46..b1e6bf2 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -12,10 +12,10 @@ "blink-cmp-latex": { "branch": "main", "commit": "3a958361e275bb5996e8393e7b2595b2f40c15ca" }, "blink.cmp": { "branch": "main", "commit": "bae4bae0eedd1fa55f34b685862e94a222d5c6f8" }, "buffer_manager.nvim": { "branch": "main", "commit": "4ae0b2de328ef1a7effad830d716c231fe9a6af2" }, - "codecompanion.nvim": { "branch": "main", "commit": "2b5aea7a371af96a08e984b42795ce8f5ae70e49" }, + "codecompanion.nvim": { "branch": "main", "commit": "4bc03c40b8f7f5e5d3c324479a893c6589471446" }, "color-picker.nvim": { "branch": "master", "commit": "06cb5f853535dea529a523e9a0e8884cdf9eba4d" }, "composer.nvim": { "branch": "main", "commit": "ec9537969adc7fc128cfe9c3a9925850455896c8" }, - "copilot.lua": { "branch": "master", "commit": "e73fe7c43c68aeb84fbeed12ee6cc60a29e78fbb" }, + "copilot.lua": { "branch": "master", "commit": "407fbd5cd3397e1e46b7dedbd928eefcaf621e76" }, "direnv.vim": { "branch": "master", "commit": "ab2a7e08dd630060cd81d7946739ac7442a4f269" }, "dressing.nvim": { "branch": "master", "commit": "2d7c2db2507fa3c4956142ee607431ddb2828639" }, "elixir-tools.nvim": { "branch": "main", "commit": "f7e18753f5587b422aac628249fa46c66ed24af3" }, @@ -23,9 +23,9 @@ "floaterm": { "branch": "main", "commit": "ae3de018d20dccd9372bbff7137e8a6d6030f69e" }, "flutter-tools.nvim": { "branch": "main", "commit": "65b7399804315a1160933b64292d3c5330aa4e9f" }, "friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" }, - "fzf": { "branch": "master", "commit": "416aff86e9d550d0a34af9d3cc12dfede25354c3" }, - "fzf-lua": { "branch": "main", "commit": "091bcd0c925199b1371ea81ec79278611d299627" }, - "fzf.vim": { "branch": "master", "commit": "3725f364ccd25b85a91970720ba9bc2931861910" }, + "fzf": { "branch": "master", "commit": "de4059c8fa9d88247e0716f546a76d65fa3eb17b" }, + "fzf-lua": { "branch": "main", "commit": "3d6721645f3bb5b7cb337862e4a5823e74608966" }, + "fzf.vim": { "branch": "master", "commit": "879db51d0965515cdaef9b7f6bdeb91c65d2829e" }, "git-worktree.nvim": { "branch": "master", "commit": "f247308e68dab9f1133759b05d944569ad054546" }, "gitsigns.nvim": { "branch": "main", "commit": "6e3c66548035e50db7bd8e360a29aec6620c3641" }, "guihua.lua": { "branch": "master", "commit": "87bea7b98429405caf2a0ce4d029b027bb017c70" }, @@ -39,6 +39,7 @@ "laravel.nvim": { "branch": "main", "commit": "ae0f3794fed6b6bee632eabe40a9057b7075587f" }, "lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" }, "lua-utils.nvim": { "branch": "main", "commit": "e565749421f4bbb5d2e85e37c3cef9d56553d8bd" }, + "lualine.nvim": { "branch": "master", "commit": "b8c23159c0161f4b89196f74ee3a6d02cdc3a955" }, "luarocks.nvim": { "branch": "main", "commit": "1db9093915eb16ba2473cfb8d343ace5ee04130a" }, "markdown-preview.nvim": { "branch": "main", "commit": "cc05a30393e2bf9f12e2d59fc35a1aa928ed1727" }, "markview.nvim": { "branch": "main", "commit": "e6b0f5aee8105adab6077509c46459812db4cffa" }, @@ -50,7 +51,7 @@ "middleclass": { "branch": "master", "commit": "9fab4d5bca67262614960960ca35c4740eb2be2c" }, "mini.diff": { "branch": "main", "commit": "7077b636d642fcd5cd48554e187a251883239660" }, "mini.icons": { "branch": "main", "commit": "f9a177c11daa7829389b7b6eaaec8b8a5c47052d" }, - "mini.nvim": { "branch": "main", "commit": "ddb70da6ec6aa896cfde87350d1e8dffb57ddef0" }, + "mini.nvim": { "branch": "main", "commit": "e7538b549361c9ac8416a07b0223ce03c508bfe7" }, "minty": { "branch": "main", "commit": "aafc9e8e0afe6bf57580858a2849578d8d8db9e0" }, "my-note.nvim": { "branch": "main", "commit": "bce15c38514df229eb446a6b6bef2fcbb1993e80" }, "navigator.lua": { "branch": "master", "commit": "f5dad314dadfa742127d820ed233265d71670ee9" }, @@ -79,18 +80,18 @@ "nvim-dap-virtual-text": { "branch": "master", "commit": "fbdb48c2ed45f4a8293d0d483f7730d24467ccb6" }, "nvim-dap-vscode-js": { "branch": "main", "commit": "03bd29672d7fab5e515fc8469b7d07cc5994bbf6" }, "nvim-early-retirement": { "branch": "main", "commit": "1a5b09db3874f9e2c5b3f332b372c8cc972370f8" }, - "nvim-lspconfig": { "branch": "master", "commit": "cb4765526f7201ce4ff0c49888f80c18da614e68" }, + "nvim-lspconfig": { "branch": "master", "commit": "8b597f8fd1cf33e925f783a812ddcb81c5611a34" }, "nvim-nio": { "branch": "master", "commit": "21f5324bfac14e22ba26553caf69ec76ae8a7662" }, "nvim-notify": { "branch": "master", "commit": "397c7c1184745fca649e5104de659e6392ef5a4d" }, - "nvim-python-repl": { "branch": "main", "commit": "952a4e26f0492ceea0054f274bde2702e506b87d" }, + "nvim-python-repl": { "branch": "main", "commit": "9ffffe88af915c6362c57f2db84ae90a93fce431" }, "nvim-spectre": { "branch": "master", "commit": "72f56f7585903cd7bf92c665351aa585e150af0f" }, "nvim-transparent": { "branch": "main", "commit": "8ac59883de84e9cd1850ea25cf087031c5ba7d54" }, "nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" }, - "nvim-treesitter-context": { "branch": "master", "commit": "dca8726fea2c14e1ce6adbaa76a04816fbfaff61" }, + "nvim-treesitter-context": { "branch": "master", "commit": "66a9b5fa9e806918b5fe3dba00c6cce7e230abd2" }, "nvim-treesitter-endwise": { "branch": "master", "commit": "a61a9de7965324d4019fb1637b66bfacdcb01f51" }, "nvim-treesitter-textobjects": { "branch": "master", "commit": "71385f191ec06ffc60e80e6b0c9a9d5daed4824c" }, "nvim-ts-autotag": { "branch": "main", "commit": "a1d526af391f6aebb25a8795cbc05351ed3620b5" }, - "nvim-web-devicons": { "branch": "master", "commit": "f66cdfef5e84112045b9ebc3119fee9bddb3c687" }, + "nvim-web-devicons": { "branch": "master", "commit": "6e51ca170563330e063720449c21f43e27ca0bc1" }, "oil-git-status.nvim": { "branch": "main", "commit": "4b5cf53842c17a09420919e655a6a559da3112d7" }, "oil-image-preview.nvim": { "branch": "master", "commit": "a71eacc879e1264339a62019ee3c2ff376f2cc39" }, "oil.nvim": { "branch": "master", "commit": "07f80ad645895af849a597d1cac897059d89b686" }, @@ -100,7 +101,7 @@ "popup.nvim": { "branch": "master", "commit": "b7404d35d5d3548a82149238289fa71f7f6de4ac" }, "refactoring.nvim": { "branch": "master", "commit": "74b608dfee827c2372250519d433cc21cb083407" }, "rustaceanvim": { "branch": "master", "commit": "e9c5aaba16fead831379d5f44617547a90b913c7" }, - "rustowl": { "branch": "main", "commit": "d95b4c5de6a373cf5030794dca1b0bbd83185ce8" }, + "rustowl": { "branch": "main", "commit": "2d51f907e2cb89a41865e51ceaa1d26cc984fdf3" }, "smart-splits.nvim": { "branch": "master", "commit": "1ac316e6ea719843fd80716d1105613c98632af1" }, "spinner.nvim": { "branch": "main", "commit": "67ae7f64a6a7940be10c226301413521da26ea72" }, "telescope-dap.nvim": { "branch": "master", "commit": "783366bd6c1e7fa0a5c59c07db37f49c805a28df" }, diff --git a/lua/config/init.lua b/lua/config/init.lua index 534555f..7bd1993 100644 --- a/lua/config/init.lua +++ b/lua/config/init.lua @@ -7,9 +7,6 @@ require "config.options" local colorscheme = require("config.native-colorscheme") colorscheme.setup() -local statusline = require("config.native-statusline") -statusline.setup() - -- Additional UI Enhancements vim.opt.guicursor = "n-v-c:block,i-ci-ve:ver25,r-cr:hor20,o:hor50" vim.opt.cursorline = true diff --git a/lua/config/native-statusline.lua b/lua/config/native-statusline.lua deleted file mode 100644 index 61ac97a..0000000 --- a/lua/config/native-statusline.lua +++ /dev/null @@ -1,308 +0,0 @@ --- ===================================================== --- Native Statusline Implementation --- Replacement for lualine.nvim --- ===================================================== - -local M = {} - --- Import colors from our native colorscheme -local function get_colors() - local ok, colorscheme = pcall(require, "config.native-colorscheme") - if ok then - return colorscheme.colors - end - -- Fallback colors - return { - base03 = "#16161e", - fg = "#c0caf5", - blue100 = "#9bb3f7", - green100 = "#b3d882", - yellow100 = "#e7c664", - orange100 = "#ffad7a", - red100 = "#ff7a93", - cyan100 = "#7dd3c0", - magenta100 = "#d2a8ff", - base4 = "#c0caf5", - green300 = "#9ece6a", - yellow300 = "#e0af68", - red300 = "#f7768e", - blue300 = "#7aa2f7", - cyan300 = "#73daca", - orange300 = "#ff9e64", - } -end - -local colors = get_colors() - --- Helper function to create highlight groups -local function create_highlight(name, fg, bg, style) - local hl = { fg = fg, bg = bg } - if style then - if style:find "bold" then - hl.bold = true - end - if style:find "italic" then - hl.italic = true - end - end - vim.api.nvim_set_hl(0, name, hl) - return "%#" .. name .. "#" -end - --- Define statusline highlight groups -local function setup_highlights() - create_highlight("StatuslineModeNormal", colors.blue100, colors.base03, "bold") - create_highlight("StatuslineModeInsert", colors.green100, colors.base03, "bold") - create_highlight("StatuslineModeVisual", colors.magenta100, colors.base03, "bold") - create_highlight("StatuslineModeReplace", colors.red100, colors.base03, "bold") - create_highlight("StatuslineModeCommand", colors.yellow100, colors.base03, "bold") - create_highlight("StatuslineModeTerminal", colors.orange100, colors.base03, "bold") - - create_highlight("StatuslineBranch", colors.orange100, colors.base03, "bold") - create_highlight("StatuslineFilename", colors.yellow100, colors.base03, "bold") - create_highlight("StatuslineLSP", colors.base4, colors.base03, "bold") - create_highlight("StatuslineFiletype", colors.magenta100, colors.base03, "bold") - create_highlight("StatuslineProgress", colors.cyan100, colors.base03, "bold") - - create_highlight("StatuslineGitAdd", colors.green300, colors.base03, "bold") - create_highlight("StatuslineGitChange", colors.yellow300, colors.base03, "bold") - create_highlight("StatuslineGitDelete", colors.red300, colors.base03, "bold") - - create_highlight("StatuslineDiagError", colors.red300, colors.base03, "bold") - create_highlight("StatuslineDiagWarn", colors.yellow300, colors.base03, "bold") - create_highlight("StatuslineDiagInfo", colors.blue300, colors.base03, "bold") - create_highlight("StatuslineDiagHint", colors.cyan300, colors.base03, "bold") - - create_highlight("StatuslineSeparator", colors.base03, colors.base03, "") -end - --- Get current mode -local function get_mode() - local mode_map = { - n = { "NORMAL", "StatuslineModeNormal", " " }, - i = { "INSERT", "StatuslineModeInsert", " " }, - v = { "VISUAL", "StatuslineModeVisual", " " }, - V = { "V-LINE", "StatuslineModeVisual", " " }, - ["\22"] = { "V-BLOCK", "StatuslineModeVisual", " " }, -- Ctrl+v visual block mode - c = { "COMMAND", "StatuslineModeCommand", " " }, - R = { "REPLACE", "StatuslineModeReplace", " " }, - t = { "TERMINAL", "StatuslineModeTerminal", " " }, - } - - local current_mode = vim.fn.mode() - local mode_info = mode_map[current_mode] or { "UNKNOWN", "StatuslineModeNormal", " " } - - return "%#" .. mode_info[2] .. "#" .. mode_info[3] .. mode_info[1] .. " " -end - --- Get git branch -local function get_git_branch() - local handle = io.popen "git branch --show-current 2>/dev/null" - if not handle then - return "" - end - - local branch = handle:read "*l" - handle:close() - - if not branch or branch == "" then - return "" - end - return "%#StatuslineBranch# " .. " " .. branch .. " " -end - --- Get git diff stats -local function get_git_diff() - -- Check if we're in a git repository - local handle = io.popen "git rev-parse --is-inside-work-tree 2>/dev/null" - if not handle then - return "" - end - - local is_git = handle:read "*l" - handle:close() - - if is_git ~= "true" then - return "" - end - - -- Get staged changes - local staged_handle = io.popen "git diff --cached --numstat 2>/dev/null | wc -l" - local added = staged_handle and staged_handle:read "*l" or "0" - if staged_handle then - staged_handle:close() - end - - -- Get unstaged changes - local unstaged_handle = io.popen "git diff --numstat 2>/dev/null | wc -l" - local modified = unstaged_handle and unstaged_handle:read "*l" or "0" - if unstaged_handle then - unstaged_handle:close() - end - - local result = "" - if tonumber(added) and tonumber(added) > 0 then - result = result .. "%#StatuslineGitAdd# +" .. added .. " " - end - if tonumber(modified) and tonumber(modified) > 0 then - result = result .. "%#StatuslineGitChange# ~" .. modified .. " " - end - - return result -end - --- Get filename with path -local function get_filename() - local filename = vim.fn.expand "%:t" - if filename == "" then - filename = "[No Name]" - end - return "%#StatuslineFilename# " .. filename .. " " -end - --- Get LSP clients -local function get_lsp_clients() - local clients = vim.lsp.get_clients { bufnr = 0 } - if #clients == 0 then - return "%#StatuslineLSP#No LSP " - end - - -- Map common LSP names to icons (nerdfonts / devicons style). Add or adjust as you like. - local lsp_icons = { - lua_ls = "", - sumneko_lua = "", - pyright = "", - pylsp = "", - tsserver = "", - denols = "", - rust_analyzer = "", - gopls = "", - clangd = "", - html = "", - cssls = "", - bashls = "", - jsonls = "ﬥ", - tailwindcss = "", - angularls = "", - emmet_ls = "", - ["null-ls"] = "ﳠ", - copilot = "", - } - - local seen = {} - local client_names = {} - for _, client in ipairs(clients) do - local name = client.name or "unknown" - if not seen[name] then - seen[name] = true - local icon = lsp_icons[name] or "" - table.insert(client_names, icon .. " " .. name) - end - end - - return "%#StatuslineLSP#" .. "LSP: " .. table.concat(client_names, ", ") .. " " -end - --- Get diagnostics -local function get_diagnostics() - local diagnostics = vim.diagnostic.get(0) - local counts = { error = 0, warn = 0, info = 0, hint = 0 } - - for _, diagnostic in ipairs(diagnostics) do - if diagnostic.severity == vim.diagnostic.severity.ERROR then - counts.error = counts.error + 1 - elseif diagnostic.severity == vim.diagnostic.severity.WARN then - counts.warn = counts.warn + 1 - elseif diagnostic.severity == vim.diagnostic.severity.INFO then - counts.info = counts.info + 1 - elseif diagnostic.severity == vim.diagnostic.severity.HINT then - counts.hint = counts.hint + 1 - end - end - - local result = "" - - -- Add icons for each diagnostic type (uses nerdfonts/devicons where available) - if counts.error > 0 then - result = result .. "%#StatuslineDiagError# " .. counts.error .. " " - end - if counts.warn > 0 then - result = result .. "%#StatuslineDiagWarn# " .. counts.warn .. " " - end - if counts.info > 0 then - result = result .. "%#StatuslineDiagInfo# " .. counts.info .. " " - end - if counts.hint > 0 then - result = result .. "%#StatuslineDiagHint# " .. counts.hint .. " " - end - - return result -end - --- Get filetype -local function get_filetype() - local filetype = vim.bo.filetype - if filetype == "" then - return "" - end - return "%#StatuslineFiletype#" .. filetype .. " " -end - --- Get progress (line/total) -local function get_progress() - local current = vim.fn.line "." - local total = vim.fn.line "$" - local percentage = math.floor((current / total) * 100) - return "%#StatuslineProgress#" .. percentage .. "%% " -end - --- Get separator -local function separator() - return "%#StatuslineSeparator# " -end - --- Build the statusline -function M.build_statusline() - local left = get_mode() - .. separator() - .. get_git_branch() - .. separator() - .. get_git_diff() - .. separator() - .. get_filetype() - .. get_filename() - - local right = get_diagnostics() .. separator() .. get_lsp_clients() .. separator() .. get_progress() - - return left .. "%=" .. right -end - --- Setup function -function M.setup() - setup_highlights() - - -- Set up autocommands to refresh statusline - vim.api.nvim_create_augroup("NativeStatusline", { clear = true }) - - -- Update statusline on various events - vim.api.nvim_create_autocmd({ - "VimEnter", - "WinEnter", - "BufEnter", - "ModeChanged", - "DiagnosticChanged", - }, { - group = "NativeStatusline", - callback = function() - vim.opt.statusline = M.build_statusline() - end, - }) - - -- Set initial statusline - vim.opt.statusline = M.build_statusline() - - -- Always show statusline - vim.opt.laststatus = 2 -end - -return M diff --git a/lua/plugins/lualine.lua b/lua/plugins/lualine.lua new file mode 100644 index 0000000..aa74930 --- /dev/null +++ b/lua/plugins/lualine.lua @@ -0,0 +1,233 @@ +return { + "nvim-lualine/lualine.nvim", + dependencies = { "nvim-tree/nvim-web-devicons" }, + config = function() + local native_colorscheme = require "config.native-colorscheme" + local colors = native_colorscheme.colors + local config = { lualine_bold = true } -- Default config since we're not using solarized-osaka plugin + + local personal_colors = { + normal = { + a = { bg = colors.base03, fg = colors.blue100 }, + b = { bg = colors.fg, fg = colors.bg }, + c = { bg = colors.bg_statusline, fg = colors.fg }, + }, + insert = { + a = { bg = colors.base03, fg = colors.green100 }, + }, + + command = { + a = { bg = colors.base03, fg = colors.yellow100 }, + }, + + visual = { + a = { bg = colors.base03, fg = colors.magenta100 }, + }, + + replace = { + a = { bg = colors.base03, fg = colors.red100 }, + }, + + terminal = { + a = { bg = colors.base03, fg = colors.orange100 }, + }, + + inactive = { + a = { bg = colors.bg_statusline, fg = colors.blue }, + b = { bg = colors.bg_statusline, fg = colors.fg, gui = "bold" }, + c = { bg = colors.bg_statusline, fg = colors.fg }, + }, + } + + for _, mode in pairs(personal_colors) do + if config.lualine_bold then + mode.a.gui = "bold" + end + end + + -- local empty = require('lualine.component'):extend() + + -- local function jarak() + -- return ' ' + -- end + + local empty = require("lualine.component"):extend() + function empty:draw(default_highlight) + self.status = "" + self.applied_separator = "" + self:apply_highlights(default_highlight) + self:apply_section_separators() + return self.status + end + + local function process_sections(sections) + for name, section in pairs(sections) do + local left = name:sub(9, 10) < "x" + for pos = 1, name ~= "lualine_z" and #section or #section - 1 do + table.insert(section, pos * 2, { empty, color = { fg = colors.base03, bg = colors.base03 } }) + end + for id, comp in ipairs(section) do + if type(comp) ~= "table" then + comp = { comp } + section[id] = comp + end + -- comp.separator = left and { right = '' } or { left = '' } + comp.separator = left and { right = " " } or { left = " " } + -- comp.separator = {left = '' } and { right = '' } + end + end + return sections + end + + local lazy_status = require "lazy.status" + + require("lualine").setup { + options = { + theme = personal_colors, + -- icons_enabled = true, + -- component_separators = { left = '>', right = '┇' }, + -- section_separators = {left = '', right = '' }, + }, + sections = process_sections { + lualine_a = { + { + "mode", + icons_enabled = true, + icon = { + " ", + color = { fg = colors.base4, bg = colors.base03, gui = "bold" }, + }, + -- color = { fg = colors.base0, bg = colors.green300, gui = 'bold' }, + -- separator = { left = '', right = '' }, + -- left_padding = 2, right_padding = 0, + }, + }, + -- lualine_b = { 'filename', 'branch' }, + lualine_b = { + { + "branch", + -- separator = { left = '', right = '' }, + -- left_padding = 0, right_padding = 2, + icon = { + "", + -- align = 'left', + color = { fg = colors.orange100, bg = colors.base03, gui = "bold" }, + -- -- separator = {left = '', right = ''} + }, + -- left_padding = 0, + color = { fg = colors.orange100, bg = colors.base03, gui = "bold" }, + }, + { + "diff", + -- separator = { right = '',left = ''}, + colored = true, + symbols = { added = " ", modified = " ", removed = " " }, + diff_color = { + added = { fg = colors.green300, bg = colors.base03, gui = "bold" }, + modified = { fg = colors.yellow300, bg = colors.base03, gui = "bold" }, + removed = { fg = colors.red300, bg = colors.base03, gui = "bold" }, + }, + }, + }, + lualine_c = { + { + "filename", + on_click = function() + require("telescope.builtin").find_files() + -- print('file name clicked') + end, + icon = " ", + color = { fg = colors.yellow100, bg = colors.base03, gui = "bold" }, + path = 4, + file_status = false, + -- separator = { right = '┇', left = '┇'}, + }, + }, + lualine_x = { + { + "diagnostics", + on_click = function() + require("telescope.builtin").diagnostics() + end, + -- separator = { left = '' }, + sources = { "nvim_diagnostic" }, + sections = { "error", "warn", "info", "hint" }, + + diagnostics_color = { + error = { fg = colors.red300, bg = colors.base03, gui = "bold" }, -- Changes diagnostics' error color. + added = { fg = colors.green300, bg = colors.base03, gui = "bold" }, + warn = { fg = colors.yellow300, bg = colors.base03, gui = "bold" }, -- Changes diagnostics' warn color. + info = { fg = colors.blue300, bg = colors.base03, gui = "bold" }, -- Changes diagnostics' info color. + hint = { fg = colors.cyan300, bg = colors.base03, gui = "bold" }, -- Changes diagnostics' hint color. + }, + symbols = { error = " ", warn = " ", hint = " ", info = " " }, + colored = true, -- Displays diagnostics status in color if set to true. + update_in_insert = true, -- Update diagnostics in insert mode. default = false + always_visible = false, -- Show diagnostics even if there are none. + }, + { + lazy_status.updates, + cond = lazy_status.has_updates, + color = { fg = colors.orange300 }, + }, + { + -- code from https://github.com/nvim-lualine/lualine.nvim/blob/566b7036f717f3d676362742630518a47f132fff/examples/evil_lualine.lua + -- Lsp server name . + function() + local msg = "No LSP" + local buf_ft = vim.api.nvim_get_option_value("filetype", { buf = 0 }) + local clients = vim.lsp.get_clients() + if next(clients) == nil then + return msg + end + for _, client in ipairs(clients) do + local filetypes = client.config.filetypes + if filetypes and vim.fn.index(filetypes, buf_ft) ~= -1 then + return client.name + end + end + return msg + end, + -- icon = ' LSP:', + -- icon = {' ', color = {bg = colors.base03, fg = colors.red100}}, + -- separator = { left = '', right = ''}, + -- separator = { left = ' ', right = ' '}, + color = { fg = colors.base4, gui = "bold", bg = colors.base03 }, + }, + + { + "filetype", + color = { bg = colors.base03, fg = colors.magenta100, gui = "bold" }, + -- separator = { left = '', right = ' ' }, + }, + }, + lualine_y = { + { + "progress", + left_padding = 0, + color = { bg = colors.base03, fg = colors.cyan100, gui = "bold" }, + }, + }, + lualine_z = { + { + -- 'location', + -- function() + -- return "Ln:%l Col:%c" + -- end + -- separator = { right = '' }, left_padding = 2 }, + }, + }, + }, + inactive_sections = { + lualine_a = {}, + lualine_b = {}, + lualine_c = { "filename" }, + lualine_x = { "location" }, + lualine_y = {}, + lualine_z = {}, + }, + tabline = {}, + extensions = {}, + } + end, +} |