Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

Is there a way to enable Ctrl + / keyboard shortcuts (go to previous / next word) in the Bash console installed with MSysGit?

question from:https://stackoverflow.com/questions/4094828/msysgit-bash-how-to-enable-ctrlleft-right-arrows

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
907 views
Welcome To Ask or Share your Answers For Others

1 Answer

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...