In his A Practical Guide to Linux, 4e, Sobell gives us the following snippet:
$ cat ~/.inputrc
set editing-mode vi
$if mode=vi
"\C-y": vi-next-word
$else
"\C-y": forward-word
$endif
The snippet arises in the context of wanting to cause CONTROL-Y to move the cursor to the beginning of the next word regardless of whether bash is in vi or emacs mode.
What I am confused about is how we can be in emacs mode at all given this snippet. My current understanding is the following:
When I use some elements/shortcuts/tokens (I don't know the term) from the Readline Library, bash goes and looks in input.rc to see what I mean by it.
If 1) is true (perhaps it's not and input.rc is only used on initialization of a new shell but, in that case, I can't understand why the
$elseclause above is relevant given that it would never be reached?) then after I useset -o emacsand, perhaps, useCONTROL-Yto skip ahead in a given entry to the command line, won't input.rc be read and switch me back to aediting-mode = visituation?