How do I escape `<` in a mapping?

Here’s a simple mapping that selects the current indentation block and indents it on level, then it re-selects it.

map global normal L '<a-i>i><a-i>i' -docstring 'move right'

But when I try to do the same thing with the < mapping:

map global normal H '<a-i>i<<a-i>i' -docstring 'move left'

I get the following error:

'map' unable to parse modifier in '<<a-i>'

It also doesn’t work when I try to do something like \< or use %{}

Note: This is obviously a non-sensical example because I already have what I want selected.

I skimmed your post but it’s probably a <lt> for < and <gt> for > matter.

That did the trick. I need to get better at RTFM. Thanks!

I hate to create a new thread for this. Do you know how to map something to <a-;>?

map global normal O <alt-;>

I get the following error:

'map' unable to parse modifier in '<alt-;>'

map global normal O "<a-;>"

I recommand to read doc expansions and to play a bit with quotes for various commands: echo, exec, eval

Problem one (as described by @tototest99) is that ; separates commands, so you need to stick it in quotes (or use the alternative spelling, <semicolon>).

Problem two is the actual cause of the error message you’re seeing. The prefix for the Alt modifier is a-, not alt-, so Kakoune doesn’t recognise which modifier you’re talking about, and throws an error.