2 ms·
If you use vi-mode under bash, and you miss ESC-dot, Ctrl-a, Ctrl-e, etc
I recently found out about vi-mode under bash:
set -o vi
I love it - but there's a problem: over the years I've formed "muscle memory" for the default bash (actually, readline) shortcuts:
"ESC-." will reproduce my last line's last argument
"Ctrl-a" will take me to the line's beginning
"Ctrl-e" will take me to the line's end
"Ctrl-w" deletes the word before the cursor
"Ctrl-l" clears the screen
These obviously don't work in vi-mode - "ESC-." for example switches to VI command mode (because of ESC) and then "." repeats the last inserted word.
After a bit of research, I found a way to have my cake and eat it too - this is what you need in your .bashrc:
set -o vi
bind -m vi-command ".":insert-last-argument
bind -m vi-insert "\C-l.":clear-screen
bind -m vi-insert "\C-a.":beginning-of-line
bind -m vi-insert "\C-e.":end-of-line
bind -m vi-insert "\C-w.":backward-kill-word
This way, the shortcuts I've been using for decades still work - and I can still switch to vi command mode (with ESC) and enjoy the immense powers of vi.
Granted, I am losing a bit of functionality (e.g. the repeating of a series of commands with a single '.') ; but if you are like me, you'll prefer this tradeoff.
P.S. If you need further commands to replicate, just look them up in "man bash" (search for "Readline Command Names").