Unable to have Bash-like C-x-e in Zsh

主宰稳场 提交于 2019-12-03 04:14:13

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/890620/unable-to-have-bash-like-c-x-e-in-zsh

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!