zsh-bindings:vi模式下的noremap

时间:2014-01-15 12:22:39

标签: zsh zshrc zsh-zle

我想将zsh的vicmd中的'dd'绑定到类似'ddi'的内容,如果我使用:

bindkey -M vicmd -s dd 'ddi'

它会给我这个输出:

zsh: string inserting another one too many times

1 个答案:

答案 0 :(得分:0)

我已经找到了答案

function delete_then_insert(){
  zle kill-whole-line
  zle vi-insert
}

zle -N  delete_then_insert
bindkey -M vicmd dd delete_then_insert