3 ms·
You can do this in Bash already (Ctrl x Ctrl e is bound to readline's edit-and-execute-command, which will open $EDITOR with the current command), but being ab
by kaushiks 9y ago
You can do this in Bash already (Ctrl x Ctrl e is bound to readline's edit-and-execute-command, which will open $EDITOR with the current command), but being able to do this everywhere is nice!
- arximboldi 9y agoWhat?! That's amazing! You never stop learning bash I guess :)
- tyingq 9y agoSimilar...look into rlwrap[1] It attempts to launch an external program with your $EDITOR (vi or emacs) preferred key bindings. [1] https://linux.die.net/man/1/rlwrap https://linux.die.net/man/1/rlwrap
- meken 9y agoThank you! I tried to google how to do this some time ago with no success! However it looks like it only works with emacs editing mode (set -o emacs). Is there a way to do this in vim editing mode (set -o vi)? Also it doesn't appear to work in zsh. Is there a zsh equivalent?
- Arkanosis 9y agoFor those of us who use Zsh, the equivalent is “Alt-x edit-command-line”, which can easily be bound to “Ctrl x, Ctrl e” by adding “bindkey '^x^e' edit-commandline” in ~/.zshrc.
- e40 9y agoI'm using 25.2 and that command is not defined in my emacs.
- Arkanosis 9y agoSorry if I've misunderstood your comment, but the parent was mentioning a bash key binding, not an emacs one.