Re:Show HN: Emacs Anywhere
by kaushiks on Sunday March 04, 2018 @07:34AM
(#16514480)
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!
[ Parent
| on HN ]
Re:Show HN: Emacs Anywhere
by arximboldi on Sunday March 04, 2018 @08:10AM
(#16514578)
What?! That's amazing! You never stop learning bash I guess :)
Similar...look into rlwrap[1]
It attempts to launch an external program with your $EDITOR (vi or emacs) preferred key bindings.
Thank 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?
For Zsh, add “bindkey '^x^e' edit-command-line” somewhere in your ~/.zshrc and you have it.
In vim editing mode, enter normal mode and push v and the line will be opened in a temp file.
For 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.
I'm using 25.2 and that command is not defined in my emacs.