.inputrc当我使用 bash 时,我曾经有这个,但它在 ZSH 中不起作用,因为 ZSH 不读取 .inputrc (AFAIK):
$if Bash
# Meta+O can be made to load the previous
# command and position the cursor for typing an option
"\eo": "\C-p\C-a\ef "
Run Code Online (Sandbox Code Playgroud)
这是我在 bash 时代最怀念的一件事。有没有办法将此命令移植到 ZSH?我尝试了一些绑定键恶作剧,但收效甚微。
pet*_*eth 12
没错,zsh它有自己的行编辑器 ( ZLE) 而不会读取readline's .inputrc。
尝试:
# define widget function
function cursor-after-first-word {
zle up-history
zle beginning-of-line
zle forward-word
RBUFFER=" $RBUFFER"
}
# create widget from function
zle -N cursor-after-first-word
# bind widget to ESC-o
bindkey '^[o' cursor-after-first-word
Run Code Online (Sandbox Code Playgroud)
看看man zshzle还有什么可能。
| 归档时间: |
|
| 查看次数: |
4111 次 |
| 最近记录: |