News for hackers. Stuff that matters.
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!
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 :)
Re:Show HN: Emacs Anywhere by tyingq on Sunday March 04, 2018 @10:03AM (#16514894)
Similar...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

Re:Show HN: Emacs Anywhere by meken on Sunday March 04, 2018 @02:29PM (#16516116)
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?

Re:Show HN: Emacs Anywhere by Arkanosis on Sunday March 04, 2018 @04:50PM (#16516994)
For Zsh, add “bindkey '^x^e' edit-command-line” somewhere in your ~/.zshrc and you have it.
Re:Show HN: Emacs Anywhere by polm23 on Sunday March 04, 2018 @08:57PM (#16518134)
In vim editing mode, enter normal mode and push v and the line will be opened in a temp file.
Re:Show HN: Emacs Anywhere by Arkanosis on Sunday March 04, 2018 @03:28PM (#16516513)
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.
Re:Show HN: Emacs Anywhere by e40 on Sunday March 04, 2018 @03:54PM (#16516661)
I'm using 25.2 and that command is not defined in my emacs.
Re:Show HN: Emacs Anywhere by Arkanosis on Sunday March 04, 2018 @04:48PM (#16516973)
Sorry if I've misunderstood your comment, but the parent was mentioning a bash key binding, not an emacs one.