edit: add vi alias with vi-style bindings
The edit command already supports a few key bindings for code
navigation. To improve user experience for vi-impaired users, add a vi
alias that maps traditional vi key bindings to the barebox edit ones.
This is done by adding a mode-aware read_modal_key that maps vi
normal-mode keys to barebox edit. For operations that requires more
than one barebox edit key, a backlog of two characters is additionally
used.

In interest of code size reduction, a command mode (and the associated
readline overhead) are not implemented, the effect of the most common
commands :q and :wq commands can be realized with vim-like ZQ and ZZ
bindings instead.

This increases the size of my LZO-compressed THUMB2 barebox by 843 bytes.

Acked-by: Roland Hieber <rhi@pengutronix.de>
Signed-off-by: Ahmad Fatoum <ahmad@a3f.at>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
1 parent e4aa909 commit 040e74a8b6cd316f9553b80aa8b1a7f83672bbed
@Ahmad Fatoum Ahmad Fatoum authored on 14 Oct 2019
Sascha Hauer committed on 18 Oct 2019
Showing 1 changed file
View
commands/edit.c