2021-02-13 00:03:57 +00:00
|
|
|
|
-- Copyright (c) 2020-2021 hoob3rt
|
|
|
|
|
-- MIT license, see LICENSE for more details.
|
|
|
|
|
|
2021-03-14 14:14:19 +00:00
|
|
|
|
local mode_map = {
|
|
|
|
|
['n'] = 'NORMAL',
|
|
|
|
|
['no'] = 'O-PENDING',
|
|
|
|
|
['nov'] = 'O-PENDING',
|
|
|
|
|
['noV'] = 'O-PENDING',
|
|
|
|
|
['no'] = 'O-PENDING',
|
|
|
|
|
['niI'] = 'NORMAL',
|
|
|
|
|
['niR'] = 'NORMAL',
|
|
|
|
|
['niV'] = 'NORMAL',
|
|
|
|
|
['v'] = 'VISUAL',
|
|
|
|
|
['V'] = 'V-LINE',
|
|
|
|
|
[''] = 'V-BLOCK',
|
|
|
|
|
['s'] = 'SELECT',
|
|
|
|
|
['S'] = 'S-LINE',
|
|
|
|
|
[''] = 'S-BLOCK',
|
|
|
|
|
['i'] = 'INSERT',
|
|
|
|
|
['ic'] = 'INSERT',
|
|
|
|
|
['ix'] = 'INSERT',
|
|
|
|
|
['R'] = 'REPLACE',
|
|
|
|
|
['Rc'] = 'REPLACE',
|
|
|
|
|
['Rv'] = 'V-REPLACE',
|
|
|
|
|
['Rx'] = 'REPLACE',
|
|
|
|
|
['c'] = 'COMMAND',
|
|
|
|
|
['cv'] = 'EX',
|
|
|
|
|
['ce'] = 'EX',
|
|
|
|
|
['r'] = 'REPLACE',
|
|
|
|
|
['rm'] = 'MORE',
|
|
|
|
|
['r?'] = 'CONFIRM',
|
|
|
|
|
['!'] = 'SHELL',
|
|
|
|
|
['t'] = 'TERMINAL',
|
|
|
|
|
}
|
2021-01-04 01:14:29 +00:00
|
|
|
|
local function mode()
|
2021-03-14 14:14:19 +00:00
|
|
|
|
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]
|
2020-12-30 14:48:51 +00:00
|
|
|
|
end
|
|
|
|
|
|
2021-01-04 01:14:29 +00:00
|
|
|
|
return mode
|