aslpavel / sweep.py

sweep.py is yet another command line fuzzy finder (fzf analog)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Sweep.py

sweep.py is yet another command line fuzzy finder (fzf analog)

NOTE: that this project in maintanence mode, I've switched to rust based implementation sweep-rs which looks and works very simplarly to this one so check it out.

Features

  • single source file
  • no dependencies apart from python
  • true/256 color support
  • beautifull defaults
  • easy to specify custom theme colors

Installation

Just copy sweep.py to your PATH

Bash history lookup

Put this in your .bashrc file

__sweep_history__() (
  local line
  shopt -u nocaseglob nocasematch
  line=$(
    HISTTIMEFORMAT= history |
    sweep.py --reversed --nth=2.. --prompt='HISTORY' |
    command grep '^ *[0-9]') &&
    if [[ $- =~ H ]]; then
      sed 's/^ *\([0-9]*\)\** .*/!\1/' <<< "$line"
    else
      sed 's/^ *\([0-9]*\)\** *//' <<< "$line"
    fi
)

bind '"\C-r": " \C-e\C-u\C-y\ey\C-u`__sweep_history__`\e\C-e\er\e^"'

Demo

Dark/Light themes, 100000 words lookup: demo

About

sweep.py is yet another command line fuzzy finder (fzf analog)

License:MIT License


Languages

Language:Python 100.0%