Expand description
Word-wise motion, and the keys that ask for it.
Alt-← and Alt-→ are what a terminal user reaches for to cross a word, but terminals spell them
in more than one way: some send a modified arrow, some report the same keypress with the Meta
or Super bit instead of Alt, and some send the readline bindings Alt-b and Alt-f. All of
them mean the same thing here — along with Ctrl-←/→, which is the other common spelling.
Functions§
- is_alt
- Alt, however the terminal reported it.
- is_
delete_ word_ left - Alt-Backspace: delete the word before the cursor.
- is_
typed - A character key that should be typed, rather than one carrying a modifier we did not bind.
- is_
word_ left - Alt-←, Ctrl-←, or Alt-b: move to the start of the word before the cursor.
- is_
word_ right - Alt-→, Ctrl-→, or Alt-f: move past the end of the word after the cursor.
- word_
left - The index the cursor lands on moving left by a word: over any spaces, then over the word.
- word_
right - The index the cursor lands on moving right by a word: over any spaces, then over the word.