diff options
| author | Elvis Claros Castro <elvis@claros.ar> | 2025-08-31 09:55:39 -0300 |
|---|---|---|
| committer | Elvis Claros Castro <elvis@claros.ar> | 2025-08-31 09:55:39 -0300 |
| commit | 0b4280dec8fec6ef2e2281ec3616918e7b78d275 (patch) | |
| tree | 7d29fcbd561a75cdd4ad2ba3720c3681013e3aff /lua | |
| parent | ec011dd9c8d4372f4f8566b87981ecc178675adf (diff) | |
| download | nvim-conf-0b4280dec8fec6ef2e2281ec3616918e7b78d275.tar.gz nvim-conf-0b4280dec8fec6ef2e2281ec3616918e7b78d275.zip | |
feat(ui): reemplaza solarized-osaka y lualine.nvim por esquema de color y barra de estado nativos
- Se eliminaron los plugins externos para el esquema de color (solarized-osaka) y la barra de estado (lualine.nvim).
- Se agregó una implementación nativa inspirada en Solarized Osaka en `config.native-colorscheme`.
- Se agregó una barra de estado nativa en `config.native-statusline` para mejorar el rendimiento y la personalización.
- Se actualizó la configuración para cargar la interfaz nativa y establecer opciones relacionadas desde el inicio.
- Motivación: Reducir dependencias de plugins, mejorar el tiempo de inicio y permitir una personalización más profunda de los elementos de la interfaz.
Diffstat (limited to 'lua')
| -rw-r--r-- | lua/config/init.lua | 23 | ||||
| -rw-r--r-- | lua/config/native-colorscheme.lua | 209 | ||||
| -rw-r--r-- | lua/config/native-statusline.lua | 259 | ||||
| -rw-r--r-- | lua/plugins/colorscheme.lua | 145 | ||||
| -rw-r--r-- | lua/plugins/lualine.lua | 232 |
5 files changed, 491 insertions, 377 deletions
diff --git a/lua/config/init.lua b/lua/config/init.lua index b666da3..534555f 100644 --- a/lua/config/init.lua +++ b/lua/config/init.lua @@ -1,4 +1,27 @@ require "config.options" + +-- ===================================================== +-- Load Native Colorscheme and Statusline +-- ===================================================== +-- Load native implementations early to replace external plugins +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 +vim.opt.number = true +vim.opt.relativenumber = true +vim.opt.signcolumn = "yes" + +if vim.fn.has("termguicolors") == 1 then + vim.opt.termguicolors = true +end +-- ===================================================== + -- autocmds and keymaps can wait to load vim.api.nvim_create_autocmd("User", { group = vim.api.nvim_create_augroup("LazyVim", { clear = true }), diff --git a/lua/config/native-colorscheme.lua b/lua/config/native-colorscheme.lua new file mode 100644 index 0000000..029cf43 --- /dev/null +++ b/lua/config/native-colorscheme.lua @@ -0,0 +1,209 @@ +-- ===================================================== +-- Native Solarized Osaka Colorscheme Implementation +-- ===================================================== + +local M = {} + +-- Color palette based on solarized-osaka +local colors = { + -- Base colors + base03 = "#16161e", + base02 = "#1a1a23", + base01 = "#2e3c64", + base00 = "#414868", + base0 = "#565f89", + base1 = "#6183bb", + base2 = "#7aa2f7", + base3 = "#bb9af7", + base4 = "#c0caf5", + + -- Background variants + bg_dark = "#16161e", + bg = "#1a1b26", + bg_highlight = "#292e42", + bg_popup = "#16161e", + bg_sidebar = "#16161e", + bg_statusline = "#16161e", + bg_float = "#1a1a23", + + -- Foreground + fg = "#c0caf5", + fg_dark = "#a9b1d6", + fg_gutter = "#3b4261", + + -- Accent colors + red = "#f7768e", + orange = "#ff9e64", + yellow = "#e0af68", + green = "#9ece6a", + cyan = "#73daca", + blue = "#7aa2f7", + purple = "#bb9af7", + magenta = "#bb9af7", + + -- Enhanced versions + red100 = "#ff7a93", + orange100 = "#ffad7a", + yellow100 = "#e7c664", + green100 = "#b3d882", + cyan100 = "#7dd3c0", + blue100 = "#9bb3f7", + purple100 = "#d2a8ff", + magenta100 = "#d2a8ff", + + red300 = "#f7768e", + orange300 = "#ff9e64", + yellow300 = "#e0af68", + green300 = "#9ece6a", + cyan300 = "#73daca", + blue300 = "#7aa2f7", + purple300 = "#bb9af7", + magenta300 = "#bb9af7", + + -- Special + border = "#27a1b9", + comment = "#565f89", + none = "NONE", +} + +-- Highlight groups +local highlights = { + -- Editor + Normal = { fg = colors.fg, bg = colors.none }, + NormalFloat = { fg = colors.fg, bg = colors.bg_float }, + NormalNC = { fg = colors.fg, bg = colors.none }, + + -- Cursor + Cursor = { fg = colors.bg, bg = colors.fg }, + CursorLine = { bg = "#1e202a" }, + CursorLineNr = { fg = colors.orange, bold = true }, + CursorColumn = { bg = colors.bg_highlight }, + + -- Line numbers + LineNr = { fg = colors.fg_gutter }, + SignColumn = { fg = colors.fg_gutter, bg = colors.none }, + + -- Visual selection + Visual = { bg = "#33467c" }, + VisualNOS = { bg = "#33467c" }, + + -- Search + Search = { bg = colors.yellow, fg = colors.bg_dark }, + IncSearch = { bg = colors.orange, fg = colors.bg_dark }, + + -- Statusline + StatusLine = { fg = colors.fg, bg = colors.bg_statusline }, + StatusLineNC = { fg = colors.comment, bg = colors.bg_statusline }, + + -- Tabs + TabLine = { fg = colors.comment, bg = colors.bg_statusline }, + TabLineFill = { bg = colors.bg_statusline }, + TabLineSel = { fg = colors.fg, bg = colors.bg_highlight }, + + -- Popup menu + Pmenu = { fg = colors.fg, bg = colors.bg_popup }, + PmenuSel = { bg = colors.bg_highlight }, + PmenuSbar = { bg = colors.bg_popup }, + PmenuThumb = { bg = colors.fg_gutter }, + + -- Splits + VertSplit = { fg = colors.border }, + WinSeparator = { fg = colors.border }, + + -- Diagnostics + DiagnosticError = { fg = colors.red }, + DiagnosticWarn = { fg = colors.yellow }, + DiagnosticInfo = { fg = colors.blue }, + DiagnosticHint = { fg = colors.cyan }, + + -- Syntax highlighting + Comment = { fg = colors.comment, italic = true }, + + Constant = { fg = colors.orange, bold = true }, + String = { fg = colors.green }, + Character = { fg = colors.green }, + Number = { fg = colors.orange }, + Boolean = { fg = colors.orange }, + Float = { fg = colors.orange }, + + Identifier = { fg = colors.red }, + Function = { fg = colors.blue, bold = true }, + + Statement = { fg = colors.purple, italic = true }, + Conditional = { fg = colors.purple, italic = true }, + Repeat = { fg = colors.purple, italic = true }, + Label = { fg = colors.purple }, + Operator = { fg = colors.cyan }, + Keyword = { fg = colors.purple, italic = true }, + Exception = { fg = colors.purple }, + + PreProc = { fg = colors.cyan }, + Include = { fg = colors.purple }, + Define = { fg = colors.purple }, + Macro = { fg = colors.purple }, + PreCondit = { fg = colors.cyan }, + + Type = { fg = colors.yellow, bold = true }, + StorageClass = { fg = colors.yellow }, + Structure = { fg = colors.yellow }, + Typedef = { fg = colors.yellow }, + + Special = { fg = colors.blue }, + SpecialChar = { fg = colors.orange }, + Tag = { fg = colors.red }, + Delimiter = { fg = colors.fg }, + SpecialComment = { fg = colors.comment }, + Debug = { fg = colors.orange }, + + -- Git + GitSignsAdd = { fg = colors.green }, + GitSignsChange = { fg = colors.yellow }, + GitSignsDelete = { fg = colors.red }, + + -- Tree-sitter + ["@comment"] = { link = "Comment" }, + ["@keyword"] = { link = "Keyword" }, + ["@keyword.conditional"] = { link = "Conditional" }, + ["@keyword.repeat"] = { link = "Repeat" }, + ["@keyword.function"] = { fg = colors.purple, italic = true }, + ["@function"] = { link = "Function" }, + ["@function.builtin"] = { fg = colors.cyan, bold = true }, + ["@variable"] = { fg = colors.fg }, + ["@variable.builtin"] = { fg = colors.red }, + ["@constant"] = { link = "Constant" }, + ["@constant.builtin"] = { fg = colors.orange, bold = true }, + ["@string"] = { link = "String" }, + ["@number"] = { link = "Number" }, + ["@boolean"] = { link = "Boolean" }, + ["@type"] = { link = "Type" }, + ["@type.builtin"] = { fg = colors.cyan, bold = true }, +} + +function M.setup() + -- Clear existing highlights + vim.cmd("highlight clear") + if vim.fn.exists("syntax_on") then + vim.cmd("syntax reset") + end + + -- Set colorscheme name + vim.g.colors_name = "native-solarized-osaka" + + -- Set terminal colors + if vim.fn.has("termguicolors") == 1 then + vim.opt.termguicolors = true + end + + -- Apply highlights + for group, settings in pairs(highlights) do + vim.api.nvim_set_hl(0, group, settings) + end + + -- Set background + vim.opt.background = "dark" +end + +-- Export colors for use in statusline +M.colors = colors + +return M diff --git a/lua/config/native-statusline.lua b/lua/config/native-statusline.lua new file mode 100644 index 0000000..c7dea6e --- /dev/null +++ b/lua/config/native-statusline.lua @@ -0,0 +1,259 @@ +-- ===================================================== +-- 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", " " }, + [""] = { "V-BLOCK", "StatuslineModeVisual", " " }, + 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 + + local client_names = {} + for _, client in ipairs(clients) do + table.insert(client_names, client.name) + end + + return "%#StatuslineLSP#" .. 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 = "" + 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_filename() + + local right = get_diagnostics() .. separator() .. + get_lsp_clients() .. separator() .. + get_filetype() .. 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/colorscheme.lua b/lua/plugins/colorscheme.lua deleted file mode 100644 index aaae1db..0000000 --- a/lua/plugins/colorscheme.lua +++ /dev/null @@ -1,145 +0,0 @@ -return { - "craftzdog/solarized-osaka.nvim", - lazy = false, - priority = 1000, - opts = {}, - config = function() - -- ===================================================== - -- Solarized Osaka Colorscheme Configuration - -- Enhanced setup with better customization - -- ===================================================== - - require("solarized-osaka").setup({ - -- ========== Core Settings ========== - transparent = true, -- Enable transparent background - terminal_colors = true, -- Configure terminal colors - - -- ========== Syntax Highlighting Styles ========== - styles = { - comments = { italic = true }, - keywords = { italic = true, bold = false }, - functions = { italic = false, bold = true }, - variables = { bold = false }, - conditionals = { italic = true }, - loops = { italic = true }, - constants = { bold = true }, - strings = { italic = false }, - types = { bold = true }, - - -- ========== UI Element Styles ========== - sidebars = "dark", -- Sidebar style: "dark", "transparent", "normal" - floats = "dark", -- Floating window style - }, - - -- ========== UI Configuration ========== - sidebars = { - "qf", "help", "vista_kind", "terminal", - "packer", "spectre_panel", "toggleterm", - "Trouble", "NvimTree", "neo-tree" - }, - day_brightness = 0.4, -- Better brightness for day variant - hide_inactive_statusline = false, - dim_inactive = true, -- Dim inactive windows for better focus - lualine_bold = true, - - -- ========== Color Customization ========== - ---@param colors ColorScheme - on_colors = function(colors) - -- Enhance base colors for better readability - colors.bg_dark = "#16161e" - colors.bg_float = "#1a1a23" - colors.border = "#27a1b9" - colors.comment = "#565f89" - colors.gitSigns = { - add = "#449dab", - change = "#6183bb", - delete = "#f7768e", - } - end, - - -- ========== Highlight Customization ========== - ---@param highlights Highlights - ---@param colors ColorScheme - on_highlights = function(hl, c) - -- ========== Indent Guides ========== - hl.IblIndent = { fg = c.base03, nocombine = true } - hl.IndentBlanklineChar = { fg = c.blue, nocombine = true } - hl.IndentBlanklineContextChar = { fg = c.orange500, nocombine = true } - - -- ========== Telescope Enhanced Styling ========== - local prompt = "#2d3149" - local results = "#1f2335" - local preview = "#24283b" - - hl.TelescopeNormal = { bg = c.bg_dark, fg = c.fg_dark } - hl.TelescopeBorder = { bg = c.bg_dark, fg = c.border } - hl.TelescopePromptNormal = { bg = prompt } - hl.TelescopePromptBorder = { bg = prompt, fg = c.border } - hl.TelescopePromptTitle = { bg = c.blue, fg = c.bg_dark, bold = true } - hl.TelescopePreviewTitle = { bg = c.green, fg = c.bg_dark, bold = true } - hl.TelescopeResultsTitle = { bg = c.purple, fg = c.bg_dark, bold = true } - hl.TelescopeSelection = { bg = "#364A82", fg = c.fg } - hl.TelescopeSelectionCaret = { fg = c.red } - - -- ========== Enhanced UI Elements ========== - -- Better cursor line - hl.CursorLine = { bg = "#1e202a" } - hl.CursorLineNr = { fg = c.orange, bold = true } - - -- Improved visual selection - hl.Visual = { bg = "#33467c" } - - -- Better search highlights - hl.Search = { bg = c.yellow, fg = c.bg_dark } - hl.IncSearch = { bg = c.orange, fg = c.bg_dark } - - -- Enhanced diagnostics - hl.DiagnosticError = { fg = c.red } - hl.DiagnosticWarn = { fg = c.yellow } - hl.DiagnosticInfo = { fg = c.blue } - hl.DiagnosticHint = { fg = c.cyan } - - -- ========== Plugin-specific Highlights ========== - -- Neo-tree - hl.NeoTreeNormal = { bg = c.bg_dark } - hl.NeoTreeNormalNC = { bg = c.bg_dark } - - -- Which-key - hl.WhichKey = { fg = c.blue } - hl.WhichKeyGroup = { fg = c.purple } - hl.WhichKeyDesc = { fg = c.fg } - - -- Notify - hl.NotifyBackground = { bg = c.bg_dark } - - -- GitSigns - hl.GitSignsAdd = { fg = c.green } - hl.GitSignsChange = { fg = c.yellow } - hl.GitSignsDelete = { fg = c.red } - end, - }) - - -- ===================================================== - -- Apply Colorscheme - -- ===================================================== - vim.cmd.colorscheme("solarized-osaka") - - -- ===================================================== - -- Additional UI Enhancements - -- ===================================================== - -- Better cursor visibility - vim.opt.guicursor = "n-v-c:block,i-ci-ve:ver25,r-cr:hor20,o:hor50" - - -- Enhanced visual feedback - vim.opt.cursorline = true - vim.opt.number = true - vim.opt.relativenumber = true - vim.opt.signcolumn = "yes" - - -- Better terminal colors - if vim.fn.has("termguicolors") == 1 then - vim.opt.termguicolors = true - end - - end, -} diff --git a/lua/plugins/lualine.lua b/lua/plugins/lualine.lua deleted file mode 100644 index 5873598..0000000 --- a/lua/plugins/lualine.lua +++ /dev/null @@ -1,232 +0,0 @@ -return { - 'nvim-lualine/lualine.nvim', - dependencies = { 'nvim-tree/nvim-web-devicons' }, - config = function() - - local colors = require("solarized-osaka.colors").setup({ transform = true }) - local config = require("solarized-osaka.config").options - - local solarized_osaka = { - normal = { - a = { bg = colors.base03, fg = colors.blue100 }, - b = { bg = colors.fg, fg = colors.black }, - 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(solarized_osaka) 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 = solarized_osaka, - -- 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 - } |