2021-01-04 01:14:29 +00:00
|
|
|
|
local function mode()
|
2020-12-30 14:48:51 +00:00
|
|
|
|
local mode_map = {
|
|
|
|
|
['__'] = '------',
|
|
|
|
|
['n'] = 'NORMAL',
|
|
|
|
|
['i'] = 'INSERT',
|
|
|
|
|
['v'] = 'VISUAL',
|
|
|
|
|
['V'] = 'V-LINE',
|
|
|
|
|
[''] = 'V-BLOCK',
|
|
|
|
|
['R'] = 'REPLACE',
|
|
|
|
|
['r'] = 'REPLACE',
|
|
|
|
|
['Rv'] = 'V-REPLACE',
|
|
|
|
|
['c'] = 'COMMAND',
|
|
|
|
|
['t'] = 'TERMINAL',
|
2021-01-06 13:52:05 +00:00
|
|
|
|
['s'] = 'SELECT',
|
2020-12-30 14:48:51 +00:00
|
|
|
|
}
|
2021-01-08 03:52:30 +00:00
|
|
|
|
local function get_mode()
|
|
|
|
|
local mode_code = vim.api.nvim_get_mode().mode
|
|
|
|
|
if mode_map[mode_code] == nil then return mode_code end
|
|
|
|
|
return mode_map[mode_code]
|
|
|
|
|
end
|
|
|
|
|
return get_mode()
|
2020-12-30 14:48:51 +00:00
|
|
|
|
end
|
|
|
|
|
|
2021-01-04 01:14:29 +00:00
|
|
|
|
return mode
|