Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

fzf keybindings doesn't work with zsh vi mode

Tags:

zsh

zshrc

fzf

fzf ctrl+r doesn't work anymore after I started to use zsh vi-mode. My zshrc file is here:

function zvm_config() {
  ZVM_LINE_INIT_MODE=$ZVM_MODE_INSERT
  ZVM_VI_INSERT_ESCAPE_BINDKEY=jk
}
source /opt/homebrew/opt/zplug/init.zsh
zplug "jeffreytse/zsh-vi-mode"
# Install plugins if there are plugins that have not been installed
if ! zplug check --verbose; then
    printf "Install? [y/N]: "
    if read -q; then
        echo; zplug install
    fi
fi

# Then, source plugins and add commands to $PATH
zplug load --verbose

[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh

If I separately run source ~/.fzf.zsh then it will work.

like image 370
user1869474 Avatar asked Nov 09 '25 03:11

user1869474


2 Answers

Adding this command to .zshrc solved this issue for me.

ZVM_INIT_MODE=sourcing

Source: https://github.com/jeffreytse/zsh-vi-mode#initialization-mode

like image 117
lordvidex Avatar answered Nov 12 '25 17:11

lordvidex


fzf keybindings seem to conflict with vi-mode. As mentioned here, Loading the fzf key bindings after loading the vi-mode plugin is one way to work around this issue. In my case, I was using oh-my-zsh and adding the fzf plugin after vi-mode in the plugins list fixed the issue.

like image 44
pnanadikar Avatar answered Nov 12 '25 16:11

pnanadikar



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!