Giter VIP home page Giter VIP logo

aliaster's Introduction

Aliaster

What is this?

You and I both type way too much on the console. This helps us quit.

When you use an alias, you get points equal to the number of keystrokes you saved in the process. Each command you type is put in a file along with how many times you used the command. Commands are split so that partial commands are counted, as well.

For example:

make -j8 foo
make -j8 bar

After these two commands, make and make -j8 have a count of 2. But make -j8 foo and make -j8 bar have a count of only one. In this way, partial commands can be suggested for aliases, as well.

Requirements:

ZSH or you to figure out your shell's preexec analog.

Installation:

touch $HOME/.aliaster
function preexec {
  python /path/to/aliaster.py $1 "`whence -w $1 | egrep -q \"function|alias\" && whence -f $1 | wc -c`"
  export ALIASTER=$?
}

Usage:

  1. Use your shell as normal.
  2. To view suggestions, type aliaster as if it were a command.

Configure:

There are a few settings you may wish to change:

  • FREQ_FILE: In which file will the counts go?
  • FREQ_THRESHOLD: How many times should a command be used before listing it as a suggestion?
  • SUGG_LENGTH_THRESHOLD: How long must a command be to warrant keeping its counts in the file for suggestions?

Anything else I should know?

  • You can clear the count file by recreating the FREQ_FILE.
  • You can see the counts of everthing by looking in the FREQ_FILE.
  • Your current score can be found in $ALIASTER.

License:

GPLv3

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.