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
|
|
|
|
}
|
|
|
|
|
return mode_map[vim.fn.mode()]
|
|
|
|
|
end
|
|
|
|
|
|
2021-01-04 01:14:29 +00:00
|
|
|
|
return mode
|