diff options
Diffstat (limited to 'lua/core/galaxyline.lua')
-rw-r--r-- | lua/core/galaxyline.lua | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/lua/core/galaxyline.lua b/lua/core/galaxyline.lua index 512dd78c..0f31ef53 100644 --- a/lua/core/galaxyline.lua +++ b/lua/core/galaxyline.lua @@ -18,6 +18,20 @@ local condition = require "galaxyline.condition" local gls = gl.section gl.short_line_list = { "NvimTree", "vista", "dbui", "packer" } +local function get_mode_name() + local names = { + n = "NORMAL", + i = "INSERT", + c = "COMMAND", + v = "VISUAL", + V = "VISUAL LINE", + t = "TERMINAL", + R = "REPLACE", + [""] = "VISUAL BLOCK", + } + return names[vim.fn.mode()] +end + table.insert(gls.left, { ViMode = { provider = function() @@ -44,6 +58,16 @@ table.insert(gls.left, { ["!"] = colors.blue, t = colors.blue, } + if lvim.builtin.galaxyline.show_mode then + local name = get_mode_name() + -- Fall back to the default behavior is a name is not defined + if name ~= nil then + vim.api.nvim_command("hi GalaxyViMode guibg=" .. mode_color[vim.fn.mode()]) + vim.api.nvim_command("hi GalaxyViMode guifg=" .. colors.alt_bg) + return " " .. name .. " " + end + end + vim.api.nvim_command("hi GalaxyViMode guibg=" .. colors.alt_bg) vim.api.nvim_command("hi GalaxyViMode guifg=" .. mode_color[vim.fn.mode()]) return "â–Š" end, |