简体   繁体   English

获取ESC-上最后一个命令的最后一个参数。 ZSH Vim模式

[英]Get last argument of last command on ESC-. ZSH Vim mode

I want to have the same function of Bash+emacs_mode on Zsh+vi_mode, when you type ESC+. 当你输入ESC +时,我希望在Zsh + vi_mode上具有相同的Bash + emacs_mode功能。 you get the last argument of the last command under the cursor. 你得到光标下最后一个命令的最后一个参数。 How can I get it on ZSH? 我怎样才能在ZSH上获得它?

You can use the same widget ( insert-last-word ) in both viins and emacs mode; 您可以在viinsemacs模式下使用相同的小部件( insert-last-word ); it just isn't bound to a key by default in viins mode. 它只是在viins模式下默认不绑定到键。

Run the following in the current shell (and add it to .zshrc for it to take effect in future shells). 在当前shell中运行以下命令(并将其添加到.zshrc以使其在将来的shell中生效)。

bindkey -M viins '\e.' insert-last-word

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

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