I wanted to mimic Telescope vim like keyboard binding
Checklist
- [x] I have read through the manual page (
man fzf) - [x] I have searched through the existing issues
- [x] For bug reports, I have checked if the bug is reproducible in the latest version of fzf
Output of fzf --version
0.63.3 (brew)
OS
- [ ] Linux
- [x] macOS
- [ ] Windows
- [ ] Etc.
Shell
- [x] bash
- [ ] zsh
- [ ] fish
Problem / Steps to reproduce
I wanted to mimic Vim-like keybinding that will use the following setup
esc → Normal Mode:
Disables search (you can navigate freely).
Changes prompt to NORMAL> .
Binds j (down) and k (up) for navigation.
Allows i to switch back to insert mode.
i→ Insert Mode:
Enables searching.
Unbinds j/k from navigation so you can type.
j and k (in Normal Mode):
Navigate up/down.
Then if you press esc in the Normal Mode it should turn off.
I tried using
# Use fd for finding files
export FZF_DEFAULT_COMMAND='fd --type f --strip-cwd-prefix --hidden --follow --exclude .git'
# Customize fzf options
export FZF_DEFAULT_OPTS="
--preview 'bat --style=numbers --color=always {}' \
--bind 'alt-j:preview-down' \
--bind 'alt-k:preview-up' \
--bind 'esc:abort' \
--bind 'j:down' \
--bind 'k:up' \
--bind 'ctrl-u:preview-page-up' \
--bind 'ctrl-d:preview-page-down' \
--bind 'ctrl-i:toggle-preview' \
--reverse"
# Enable extended mode
export FZF_DEFAULT_OPS="--extended"
# Use the same command for Ctrl+T (file search)
export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND"
But this blocked j and k from the insert mode. Please let me know if you have any suggestions!
You might want to check out the mode switching example in https://junegunn.github.io/fzf/releases/0.59.0/#hiding-input-section
is there a plan to add vim keybinds to fzf ? (not the vim fzf plugin but to the native fzf)