lualine.nvim/lua/lualine/components/mode.lua

25 lines
544 B
Lua
Raw Normal View History

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
}
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
return mode