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> |
---|
|
commands/edit.c |
---|