3 ms·
here's the magic line in .*rc that you didn't know you need: `set -o vi` It applies vi rules to your command line.
by Aperocky 4y ago
here's the magic line in .*rc that you didn't know you need:
`set -o vi`
It applies vi rules to your command line.
- jgwil2 4y agoI love vi bindings but I've found that if you're using oh-my-zsh this will break a bunch of stuff like the command history. If anyone knows of a workaround for that I'd love to hear about it.
- mdaniel 4y agoOr its more sane friend, control-x+control-e to launch $EDITOR with a file in $TMPDIR containing the current command-line, and then execute it when $EDITOR exits. BTW, I don't mean "$EDITOR" as a placeholder for whatever editor is your favorite, I quite literally mean the shell variable "EDITOR". Strictly speaking, $VISUAL has precedence but I don't think any system sets that one by default, whereas many do set EDITOR. I guess the one drawback to this comment in reply to yours is that the very bottom of that fallback tree is "emacs", but what vimmer doesn't already have EDITOR=$(command -v vi)? :-D The gory details: https://www.gnu.org/software/bash/manual/html_node/Miscellaneous-Commands.html#index-edit_002dand_002dexecute_002dcommand-_0028C_002dx-C_002de_0029 https://www.gnu.org/software/bash/manual/html_node/Miscellan...