Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The crazy thing about this is how simple the code is.

    _sysz_list_units |
      fzf \
        --exact \
        --multi \
        --ansi \
        --reverse \
        --no-sort \
        --history="$SYSZ_HISTORY" \
        --prompt="Units: " \
        --bind "ctrl-v:preview('${BASH_SOURCE[0]}' _fzf_cat {})" \
        --preview="'${BASH_SOURCE[0]}' _fzf_preview {}" \
        --preview-window=70% |
  readarray -t PICKS
This is the whole UI. Just give it a list of things to search through, a prompt, and a command for previewing the thing and fzf handles literally all the rest of the UI for you.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: