For the record, set -o vi works in the Korn shell (ksh), but not so much in the others.
Bash, in my experience, usually already has the arrow keys enabled for access to the command history. So, Up Arrow in bash is like hitting Ctrl-K in ksh (after enabling with set -o vi).
—
Anyways, the short of it is to first realize what shell you’re in. Sounds like @Andrew’s in bash.
I’ll poke around some more (I prefer ksh most of the time) and see if I can get definitive on this for bash.
[Note to self: I’ve really gotta get better with bash.]
Fundamental moving around in bash:
● ^w erase word
● ^u erase from here to beginning of the line (I use this ALL the time.)
● ^a move the cursor to the beginning of the line
● ^e move the curor to the end of the line
Okay… EVERYTHING I posted about getting around in bash above is flawed b/c those jackholes at deadman .org neglected to use the proper capitalization on their web page.
I suggest going with @stocky’s excellent cheat sheet.
—
@Fluther mods: You would make me so happy if you’d simply remove all my dumbass posts here. Thx!
You’re right, of course. Glad that works in bash! And besides ksh, it also works in zsh.
I’ve now gotten around to confirming that it does not work in C Shell (csh), Bourne Shell (sh), and Advanced C Shell (tcsh). Maybe there’s another way to enable vi-access to history in those?