简体   繁体   中英

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+. you get the last argument of the last command under the cursor. How can I get it on ZSH?

You can use the same widget ( insert-last-word ) in both viins and emacs mode; it just isn't bound to a key by default in viins mode.

Run the following in the current shell (and add it to .zshrc for it to take effect in future shells).

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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