In bash line editing (or in any program that uses GNU readline), Meta-f moves to the right by one "word" and Meta-b move to the left by one "word", where a "word" is composed of letters and digits. These are the forward-word
and backward-word
commands. (Meta-f can be either the Alt modifier key or a prefix Escape key.)
For example, if I've typed
cat /etc/motd
then repeatedly typing Meta-b moves the cursor to the m
, then the e
, then the c
.
Is there a command that moves similarly, but by whitespace-delimited words, so /etc/motd
is a single word?
(I often work with very long file paths, and I'd like to be able to skip over them easily. My workaround is either to type the existing word-move commands repeatedly, or to type ^X ^E to launch an editor.)
In vim, w
and b
move forward and back by words, and W
and B
move by whitespace-delimited words. I'm looking for something similar.
I've looked through the readline
documentation, and I suspect the answer is no, but perhaps I've missed something.