fzf2nd is a general-purpose command-line fuzzy finder for bash.
It's an interactive Unix filter for command-line that can be used with any list; files, command history, processes, hostnames, bookmarks, git commits, etc.
at first, install ripgrep from here or the following commnads.
curl -L https://static.rust-lang.org/rustup.sh | sudo sh
cargo install ripgrep
second, clone this repository and run install script.
git clone https://github.com/miyagaw61/fzf2nd.git ~/.fzf
~/.fzf/install
cd ~/.fzf && git pull && ./install
fzf will launch interactive finder, read the list from STDIN, and write the selected item to STDOUT.
type foo
can search 'foo' with ambiguous match.
type 'foo
can search 'foo' with exact match.
type <C-j>
can move down.( <C-j>
is CTRL
+ J
)
type <C-k>
can move up.
type <Tab>
can multiple select.
type <C-c>
can quit.
<C-o>
can auto | fzf2nd
injection.
find | fzf2nd > selected
vim $(find /etc -type f | fzf2nd)
<C-j>
can find current directory (depth=1)
vim <C-j>
<C-k>
can find current directory (depth=∞)
vim <C-k>
,<Tab>
can grate completion
cd with fzf2nd
fzf_d
you can use fzf2nd in shell script.
arg=$(find -type f | fzf2nd)
set $arg
echo selected num : $#
echo selected factors : $@
echo selected factor1 : $1
you can execute this shell script by fzf2nd_example.sh
.
https://github.com/junegunn/fzf
The MIT License (MIT)
Copyright (c) 2017 Junegunn Choi