简体   繁体   English

无法在 Zsh 中拥有类似 Bash 的 Cxe

[英]Unable to have Bash-like C-x-e in Zsh

I found the following command in Bash which Zsh does not have in the same buttons at the thread .我在 Bash 中找到了以下命令,Zsh 在线程的相同按钮中没有。

Ctrl-x-e

It opens the current input in terminal to an editor.它将终端中的当前输入打开到编辑器。

How can you have the same command in Zsh?你怎么能在 Zsh 中有相同的命令?

I'm using it with VIM mode. 我在VIM模式下使用它。 Basically ESC-v (or simply v if already in command mode) opens the terminal. 基本上ESC-v(或者如果已经处于命令模式则简称为v)打开终端。 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: 以下是如何在emacs模式下设置它:

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. 使用'bindkey -e'启用emacs样式或'bindkey -v'启用vi样式。

If you are using Sublime as your editor then make sure you have -w option added in .zshrc or .bashrc file, otherwise it may won't work.如果您使用 Sublime 作为编辑器,请确保在.zshrc.bashrc文件中添加了-w选项,否则它可能无法工作。

export EDITOR='subl -w'

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM