hauntedhost / fzf-ex

Fuzzy Elixir module search

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

fzf-ex

fzf-ex is a command-line fuzzy finder for all module names in an Elixir Mix project. It's powered by fzf and bat.

screenshot

fzf-ex-preview.mp4

Installation

  1. Ensure that fzf and bat are installed:

    brew install fzf bat
    
  2. Clone repo to ~/.fzf-ex

    git clone https://github.com/hauntedhost/fzf-ex.git ~/.fzf-ex
  3. Add PATH to .zshrc or .bashrc, etc

    PATH="~/.fzf-ex:$PATH"
  4. (Optional) Bind CTRL+S to launch search

    # ~/.zshrc
    run-fzf-ex() {
      echo ""
      fzf-ex
      echo "\n"
      zle reset-prompt
    }
    zle -N run-fzf-ex
    bindkey '^S' run-fzf-ex
    # ~/.bashrc (untested)
    run_fzf_ex() {
      echo ""
      fzf-ex
      echo -e "\n"
      PS1="$PS1"
    }
    bind -x '"\C-s": run_fzf_ex'

Usage

In the root of any Elixir Mix project press your bind key from step #3 above, or manually run:

$ fzf-ex

On the first run it will create the index. After 24 hours it will prompt you to reindex. You can reindex manually anytime with:

$ fzf-index

About

Fuzzy Elixir module search


Languages

Language:Shell 54.2%Language:Elixir 45.8%