tags:

views:

377

answers:

1

I found the following command in Bash which Zsh does not have in the same buttons at the thread.

Ctrl-x-e

It opens the current input in terminal to an editor.

How can you have the same command in Zsh?

+5  A: 

I'm using it with VIM mode. Basically ESC-v (or simply v if already in command mode) opens the terminal. It is setup by:

autoload -U edit-command-line
zle -N edit-command-line
bindkey -M vicmd v edit-command-line

Here is how to setup it in emacs mode:

autoload edit-command-line
zle -N edit-command-line
bindkey '^Xe' edit-command-line

Use 'bindkey -e’ to to enable emacs style or ‘bindkey -v’ to enable vi style.

Is the command for Emacs mode Ctrl-X-e? It did not work for me in terminal.
Masi
It's Ctr-x, then e. You could change '^Xe' to '^X^e' if it is Ctrl-x ctrl-e what you want. Be sure to turn on emacs style (although it is the zsh default) by simply: bindkey -e alone in a line.
PS. I verified, it is working.
@emg-2: It works. Thank you! I had a corrupted shell script which Zsh did not give any alert. I get an alert about it in Bash.
Masi