Git Product home page Git Product logo

fzh's Introduction


$\textcolor{inherit}{\textsf{F}}\textcolor{grey}{\textsf{u}}\textcolor{inherit}{\textsf{z}}\textcolor{grey}{\textsf{zy}}$ $\textcolor{inherit}{\textsf{H}}\textcolor{grey}{\textsf{istory}}$

Fzh is a simple shell history search engine that replaces ctrl-r. Fuzzy find with ordering taking into account the current directory, exit status, datetime, and number of times ran for a command.

Regular shell history is not affected as the search index is kept entirely separate.

Table of Contents

Installation

  1. To install Fzh, you can download the binary from the Github Releases page and move it to /usr/local/bin/.
$ cd ~/Downloads
$ mv fzh /usr/local/bin/
  1. Add the initializer to ~/.zshrc.
# Setup Fzh keybinds and event hooks. Removing this will
# restore previous `ctrl+r` behaviour.
eval "$(fzh init zsh)"
  1. Restart your terminal or run . ~/.zshrc.

Usage

Populate the database with your current history by running an import:

$ fzh import zsh

This will index your Zsh command history and store it in ~/.fzh. Only Zsh is currently supported.

Search with the keybind ctrl-r (^R).

Commands

  • import <shell> [<path>] Index command history for a shell (path defaults to ~/.zsh_history)
  • init <shell> Prints the init script (source with eval \"$(fzh init zsh)\")
  • delete_index Remove all indexed command history

Developer Commands

Fzh includes a few developer options that can be used to add commands to the index manually or start the search client manually:

  • search <text> Start a search client, the same as what's invoked from the keybind ^R.
  • add <exit_code>:<text> Write a command to the index.

Remaining Work

  • Duplicates in command history.
  • Handle signals like cmd+backspace, cmd+left_arrow, etc.
  • Eat cake!

fzh's People

Contributors

pheen avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.