/fzf2nd

:cherry_blossom: A command-line fuzzy finder written in Go

Primary LanguageGoMIT LicenseMIT

fzf - a command-line fuzzy finder travis-ci Donate via PayPal

fzf2nd is a general-purpose command-line fuzzy finder for bash.

top

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.

Installation

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

Upgrading fzf2nd

cd ~/.fzf && git pull && ./install

Usage - fzf2nd's new functions

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

completion

cd with fzf2nd

fzf_d

fzf_d1 fzf_d2

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.

example1
example2

fzf default README.md

https://github.com/junegunn/fzf

License

The MIT License (MIT)

Copyright (c) 2017 Junegunn Choi