GithubHelp home page GithubHelp logo

fillu87gyc / history Goto Github PK

View Code? Open in Web Editor NEW

This project forked from babarot/history

0.0 1.0 0.0 6.36 MB

A CLI to provide enhanced history for your shell

Go 63.81% Makefile 2.73% Shell 33.47%

history's Introduction

history Build Status

A CLI to provide enhanced history for your shell

  • Submatch & Fuzzy search
  • Share the history among multiple machines
  • Easy to customize with the config file in TOML
  • Run immediately when just selecting command on the screen via interactive filters
  • Customizable what information as a column is displayed on the screen line
  • Filter the directory and/or branch that the command was executed
  • Text database based on LTSV
  • Automatically backup
  • and more...

Installation

  • Get binaries

  • (Additional) if you're zsh user, it's better to intergrate your shell

    $ git clone https://github.com/b4b4r07/history && cd history
    $ source misc/zsh/init.zsh

Usage

You should specify some enviroment variables for using this tool.

ZSH_HISTORY_KEYBIND_GET

You can set keybind for getting history.

Example:

export ZSH_HISTORY_KEYBIND_GET="^r"
export ZSH_HISTORY_FILTER_OPTIONS="--filter-branch --filter-dir"

In fact, when you invoke that keybind (in this example, ^r), the following command will be executed and supplemented to your ZLE (on shell).

command history search $ZSH_HISTORY_FILTER_OPTIONS --query "$LBUFFER"

If you set ZSH_HISTORY_FILTER_OPTIONS like above, it's equals to $ZSH_HISTORY_KEYBIND_GET's function behavior.

ZSH_HISTORY_FILTER_OPTIONS

It should be set history search option. See also command history help search.

ZSH_HISTORY_KEYBIND_GET_BY_DIR

It's equals to $ZSH_HISTORY_KEYBIND_GET with ZSH_HISTORY_FILTER_OPTIONS="--filter-branch --filter-dir".

ZSH_HISTORY_KEYBIND_GET_ALL

Ignore ZSH_HISTORY_FILTER_OPTIONS and search all history.

Example:

export ZSH_HISTORY_KEYBIND_GET_ALL="^r^a"
ZSH_HISTORY_COLUMNS_GET_ALL

Specify the screen column when displaying with ZSH_HISTORY_KEYBIND_GET_ALL

Defaults to "{{.Time}},{{.Status}},{{.Command}},({{.Base}}:{{.Branch}})"

ZSH_HISTORY_KEYBIND_ARROW_UP

Example:

export ZSH_HISTORY_KEYBIND_ARROW_UP="^p"
ZSH_HISTORY_KEYBIND_ARROW_DOWN

Example:

export ZSH_HISTORY_KEYBIND_ARROW_DOWN="^n"
ZSH_HISTORY_AUTO_SYNC

Example:

export ZSH_HISTORY_AUTO_SYNC=true

If you set sync option (for more datail, see and run history config)

ZSH_HISTORY_AUTO_SYNC_INTERVAL

Example:

export ZSH_HISTORY_AUTO_SYNC_INTERVAL="1h"

Anyway, if you want to use it immediately please copy and paste the following into your zshrc:

alias hs="command history"    # as you like

ZSH_HISTORY_KEYBIND_GET="^r"
ZSH_HISTORY_FILTER_OPTIONS="--filter-branch --filter-dir"
ZSH_HISTORY_KEYBIND_ARROW_UP="^p"
ZSH_HISTORY_KEYBIND_ARROW_DOWN="^n"

and invoke that zle function with typing Ctrl-R after reloading your zsh, of cource ;)

For more info and customization, see also wiki pages in this project:

https://github.com/b4b4r07/history/wiki

License

MIT

Author

b4b4r07

history's People

Contributors

babarot avatar kampka avatar b4b4r07 avatar ryotako avatar

Watchers

James Cloos 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.