At your Bash prompt, press Ctrl-v Ctrl-Left-Arrow and Ctrl-v Ctrl-Right-Arrow and make note of the output. You should see something like: ^[OD
and ^[OC
or similar. Add the following lines to your ~/.inputrc
:
"eOC": forward-word
"eOD": backward-word
where you will substitute e
for escape (^[
) and the rest of the characters you got (OD
, OC
or similar).
To re-read the file and make the changes active immediately, press Ctrl-x Ctrl-r.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…