fix statusline bug, handle all Vim modes

This commit is contained in:
Galen Rowell 2021-08-24 14:20:32 +10:00 committed by siduck76
parent bce7e624e2
commit a3dbef5872
1 changed files with 21 additions and 11 deletions

View File

@ -216,20 +216,30 @@ gls.right[3] = {
} }
local mode_colors = { local mode_colors = {
[110] = { "NORMAL", colors.red }, ['n'] = { "NORMAL", colors.red },
[105] = { "INSERT", colors.dark_purple }, ['no'] = { "N-PENDING", colors.red },
[99] = { "COMMAND", colors.pink }, ['i'] = { "INSERT", colors.dark_purple },
[116] = { "TERMINAL", colors.green }, ['ic'] = { "INSERT", colors.dark_purple },
[118] = { "VISUAL", colors.cyan }, ['t'] = { "TERMINAL", colors.green },
[22] = { "V-BLOCK", colors.cyan }, ['v'] = { "VISUAL", colors.cyan },
[86] = { "V_LINE", colors.cyan }, ['V'] = { "V-LINE", colors.cyan },
[82] = { "REPLACE", colors.orange }, [''] = { "V-BLOCK", colors.cyan },
[115] = { "SELECT", colors.nord_blue }, ['R'] = { "REPLACE", colors.orange },
[83] = { "S-LINE", colors.nord_blue }, ['Rv'] = { "V-REPLACE", colors.orange },
['s'] = { "SELECT", colors.nord_blue },
['S'] = { "S-LINE", colors.nord_blue },
[''] = { "S-BLOCK", colors.nord_blue },
['c'] = { "COMMAND", colors.pink },
['cv'] = { "COMMAND", colors.pink },
['ce'] = { "COMMAND", colors.pink },
['r'] = { "PROMPT", colors.teal },
['rm'] = { "MORE", colors.teal },
['r?'] = { "CONFIRM", colors.teal },
['!'] = { "SHELL", colors.green },
} }
local mode = function(n) local mode = function(n)
return mode_colors[vim.fn.mode():byte()][n] return mode_colors[vim.fn.mode()][n]
end end
gls.right[4] = { gls.right[4] = {