vim/lualine: reduce size of mode map

This commit is contained in:
Fernando Schauenburg 2023-08-11 23:39:09 +02:00
parent 417cd24fa5
commit ac8b791339

View file

@ -1,41 +1,23 @@
local config = function() local config = function()
local MODE_MAP = { local MODES = {
['n'] = 'Normal ', ['n'] = 'Normal ', -- Normal
['no'] = 'O-Pend ', ['no'] = 'O-Pend ', -- Operator-pending
['nov'] = 'O-Pend ', ['ni'] = 'Normal ', -- Normal via i_CTRL-O
['noV'] = 'O-Pend ', ['v'] = 'Visual ', -- Visual by character
['no'] = 'O-Pend ', ['V'] = 'V-Line ', -- Visual by line
['niI'] = 'Normal ', [''] = 'V-Block', -- Visual blockwise
['niR'] = 'Normal ', ['s'] = 'Select ', -- Select by character
['niV'] = 'Normal ', ['S'] = 'S-Line ', -- Select by line
['nt'] = 'Normal ', [''] = 'S-Block', -- Select blockwise
['ntT'] = 'Normal*', ['i'] = 'Insert ', -- Insert
['v'] = 'Visual ', ['R'] = 'Replace', -- Replace
['vs'] = 'Visual ', ['Rv'] = 'V-Repl ', -- Virtual Replace
['V'] = 'V-Line ', ['c'] = 'Command', -- Command-line
['Vs'] = 'V-Line ', ['cv'] = ' Ex ', -- Ex mode
[''] = 'V-Block', ['rm'] = ' More ', -- -- MORE --
['s'] = 'V-Block', ['r?'] = 'Confirm', -- :confirm
['s'] = 'Select ', ['!'] = ' Shell ', -- External command executing
['S'] = 'S-Line ', ['t'] = ' Term ', -- Terminal
[''] = 'S-Block',
['i'] = 'Insert ',
['ic'] = 'Insert ',
['ix'] = 'Insert ',
['R'] = 'Replace',
['Rc'] = 'Replace',
['Rx'] = 'Replace',
['Rv'] = 'V-Repl ',
['Rvc'] = 'V-Repl ',
['Rvx'] = 'V-Repl ',
['c'] = 'Command',
['cv'] = ' Ex ',
['ce'] = ' Ex ',
['r'] = 'Replace',
['rm'] = ' More ',
['r?'] = 'Confirm',
['!'] = ' Shell ',
['t'] = ' Term ',
} }
local extend = function(component, overrides) local extend = function(component, overrides)
@ -70,7 +52,7 @@ local config = function()
mode = { mode = {
function() function()
local code = vim.api.nvim_get_mode().mode local code = vim.api.nvim_get_mode().mode
return MODE_MAP[code] or code return MODES[code:sub(1, 2):lower()] or MODES[code:sub(1, 1):lower()] or code
end, end,
}, },