GithubHelp home page GithubHelp logo

leomichalski / smart-bash-history Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jan-warchol/smart-bash-history

0.0 0.0 0.0 110 KB

Interactive, synchronized and resilient shell history for modern developer

Shell 100.00%

smart-bash-history's Introduction

Smart history

Default shell history behaviour was designed in the 90s. A lot has changed since then - time to catch up!

Features:

  • fast, interactive search interface using fzf
  • synchronization across multiple terminals (entries from current session stay on top!)
  • unlimited history (plus a command to remove duplicates)
  • automatic backup and protection against terminal crashes

All of this using less than 100 lines of shell script, without changing history file format.

Installation

  1. Clone the repo and make sure bash will load 01-main-settings.sh on startup (Note: Mac users should update ~/.bash_profile instead of ~/.bashrc):

    git clone https://github.com/jan-warchol/smart-bash-history.git
    echo 'source $HOME/smart-bash-history/01-main-settings.sh' >> ~/.bashrc
    
  2. Download fzf into smart-bash-history. Assuming 64-bit Linux:

    cd smart-bash-history
    wget https://github.com/junegunn/fzf-bin/releases/download/0.18.0/fzf-0.18.0-linux_amd64.tgz -O- | tar xz
    
  3. New shell sessions should have smart history enabled.

Usage

Press Ctrl-R and start typing to interactively search history (you can use arrows). Confirm selection by pressing return. history command itself works the same as before.

To filter your history file, removing trivial commands and keeping only one occurrence of each entry, run filter_bash_history.

Gotchas

  • History entry numbers change on each reload (by default on each prompt)
  • multiline commands aren't well tested

smart-bash-history's People

Contributors

jan-warchol 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.