vim/lualine: use icons for modes
This commit is contained in:
parent
77c7c1a8b9
commit
ecadf89867
1 changed files with 25 additions and 24 deletions
|
@ -1,4 +1,5 @@
|
|||
local config = function()
|
||||
local get_mode_icon = function()
|
||||
local MODES = {
|
||||
['n'] = ' ', -- 'Normal ', -- Normal
|
||||
['no'] = ' ', -- 'O-Pend ', -- Operator-pending
|
||||
|
@ -17,6 +18,11 @@ local config = function()
|
|||
['!'] = ' ', -- ' Shell ', -- External command executing
|
||||
['t'] = ' ', -- ' Term ', -- Terminal
|
||||
}
|
||||
return function()
|
||||
local code = vim.api.nvim_get_mode().mode
|
||||
return MODES[code:sub(1, 2):lower()] or MODES[code:sub(1, 1):lower()] or code
|
||||
end
|
||||
end
|
||||
|
||||
local extend = function(component, overrides)
|
||||
local new = require(component):extend()
|
||||
|
@ -47,12 +53,7 @@ local config = function()
|
|||
|
||||
diff = extend('lualine.components.diff', { update_status = udpate_with_color }),
|
||||
|
||||
mode = {
|
||||
function()
|
||||
local code = vim.api.nvim_get_mode().mode
|
||||
return MODES[code:sub(1, 2):lower()] or MODES[code:sub(1, 1):lower()] or code
|
||||
end,
|
||||
},
|
||||
mode = { get_mode_icon() },
|
||||
|
||||
visual_multi = function()
|
||||
local info = vim.F.npcall(vim.fn.VMInfos)
|
||||
|
|
Loading…
Add table
Reference in a new issue