fzf has some keybindings of which some are listed below as examples:
- Alt-C :
cd
into the selected directory - Ctrl-T : select a file
I want to add a keybiding so that I can launch the selected file with fzf, maybe using xdg-open
or mimeopen
.
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.
Sign up to join this communityAdd this to your .bashrc
:
bind -x '"\C-o": file="$(fzf --height 40% --reverse)" && [ -f "$file" ] && xdg-open "$file"'
Restart your terminal, or run source .bashrc
.
Now you can use Ctrl+o to open files directly with preferred application.