Giter Club home page Giter Club logo

aliaser's Introduction

shellcheck

aliaser

An alias management / directory navigation tool.

Demo

Installation

Aliaser is a single bash function, so you can clone / download this repo and source the file directly:

$ git clone https://github.com/unforswearing/aliaser.git .
$ cd aliaser
$ source aliaser

Or using npm:

$ npm install -g aliaser-bash

For persistent use you may source aliaser from your .bashrc, .bash_profile or other config. For more information, see the "Usage" section below.


Usage

When aliaser is run for the first time it will create a .aliaser directory that contains the alias text file. Use aliaser open to view the this file in your default .txt file editor. You may also use aliaser edit to edit this file in your terminal.

Add source ~/.aliaser/aliaser.txt to your bash_profile before creating your first alias. Aliases created via aliaser are available immediately.

Typing aliaser help produces the following help text:

aliaser <option> [alias name]

options:
  -h|help         display this help message
  -o|open         open the alias file with the default gui editor (e.g. TextEdit)
  -l|list         list aliases saved in alias file
  -e|edit         edit alias file in $EDITOR
  -r|rm           remove alias from alias file
  -d|dir          create an alias from the current directory (alias name is basename)
  -n|name         create an alias from the current directory with a user defined name
  -s|search       search alias file and execute selection
  -a|searchall    search all aliases system wide and execute selection
  -c|command      create an alias from the previous command with a user defined name

examples:
  aliaser rm "aliasname"      remove alias named "aliasname" from alias file
  aliaser -n "favoritedir"    add an alias for the current directory named
                              "favoritedir" to alias file

be sure to source the alias file in your .bashrc or .bash_profile

After sourcing aliaser, you can navigate to a directory and make some aliases:

$ cd ~/scripts
$ aliaser -d myscripts

Or create an alias for the previously executed command:

# execute a command command
$ b=1 && \
> while [ $b -le 2 ]; do
>   tput flash; sleep .02;
>   b=$((b + 1));
> done

# create alias for previously executed command
$ aliaser -c "flash_terminal"

aliaser will use fzf if it is installed and in your $PATH. Otherwise, aliaser will default to listbox which is embedded in the aliaser script.


aliaser's People

Contributors

unforswearing avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

aliaser's Issues

Aliaser will not accept any path for alias file on Ubuntu

related: #4

Attempting to run aliaser for the first time on Ubuntu does not correctly retrieve the file at the user-specified path. Will likely have to create an alias file in a default location and then allow this default location to be updated in aliaser.conf

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.