Well, today I learned that set -o vi is going into all my .bashrc’s from now on.
set -o vi
One thing I’ve found useful is ctrl+x ctrl+e to edit the current command in $EDITOR. That way I can leave the emacs-style keybindings at the shell, as you’ll find that everywhere, but you can still edit unwieldy commands in real vim.
Best part: Bash has it by default.
Or, in your /etc/inputrc or ~/.inputrc:
set editing-mode vi
set keymap vi-command
In some situations (such as the set operations or uniqueness operations below) you can safely ignore slow i18n routines entirely and use traditional byte-based sort order, using export LC_ALL=C.
Be very careful if you do this. I highly recommend you don’t export it and instead use it as the environment for a single command.
LC_ALL=C sort blah
If you export it, you’ll likely to forget that you did and you’ll run into all kinds of trouble.