How do you specify "\<C-v>" as a key in Lua?
mitchellwrosen opened this issue · 2 comments
mitchellwrosen commented
Hi there,
Apologies for the question that is not quite lightline.vim
-specific. I can't seem to figure out the syntax for specifying a mode_map
in Lua for the \<C-v>
key.
I've tried "<C-v>"
, "\<C-v>"
(an invalid Lua string), "\\<C-v>"
, and "\22"
(which is what you get from vim.api.nvim_replace_termcodes("<C-v>", true, true, true)
). None of them work; I can't override the default V-BLOCK
string.
Has anyone else run into this? Thanks.
itchyny commented
"\22"
works for me.
jakubbortlik commented
Sorry for necro-bumping, but I've encountered this issue too. @mitchellwrosen, or anybody else, you need to put the string in square brackets like this:
-- lua code
mode_map = {
["\22"] = "V-BLOCK"
}