Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/unforswearing/aliaser
An alias management / directory traversal tool for the command line
https://github.com/unforswearing/aliaser
aliases bash directory-traversal shell
Last synced: 25 days ago
JSON representation
An alias management / directory traversal tool for the command line
- Host: GitHub
- URL: https://github.com/unforswearing/aliaser
- Owner: unforswearing
- Created: 2015-04-22T15:49:03.000Z (over 9 years ago)
- Default Branch: main
- Last Pushed: 2023-05-22T17:25:40.000Z (over 1 year ago)
- Last Synced: 2024-10-03T11:41:44.529Z (about 1 month ago)
- Topics: aliases, bash, directory-traversal, shell
- Language: Lua
- Homepage:
- Size: 794 KB
- Stars: 5
- Watchers: 2
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[![shellcheck](https://github.com/unforswearing/aliaser/actions/workflows/shellcheck.yml/badge.svg)](https://github.com/unforswearing/aliaser/actions/workflows/shellcheck.yml)
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:
```bash
$ git clone https://github.com/unforswearing/aliaser.git .
$ cd aliaser
$ source aliaser```
Or using `npm`:
```bash
$ 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 [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 nameexamples:
aliaser rm "aliasname" remove alias named "aliasname" from alias file
aliaser -n "favoritedir" add an alias for the current directory named
"favoritedir" to alias filebe 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:
```bash
$ cd ~/scripts
$ aliaser -d myscripts
```Or create an alias for the previously executed command:
```bash
# 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`](https://github.com/junegunn/fzf) if it is installed and in your $PATH. Otherwise, `aliaser` will default to [`listbox`](https://github.com/gko/listbox) which is embedded in the aliaser script.