diff --git a/README.md b/README.md index 5137588..206e7f6 100644 --- a/README.md +++ b/README.md @@ -29,6 +29,8 @@ The perfect tool to optimize the JavaScript developer command line. - [x] More tools, like time, battery and readOnly... - [x] Extendable...you can customize your theme with any extra string, allowing you to use JavaScript to decide what to show - [x] Create aditional, customizable parts for _$PS1_ +- [x] Ignore duplicate commands in history +- [x] New terminal windows will have the history from brevious bash ## Installing it @@ -400,6 +402,8 @@ And the results would be one of: | desktop/desk | Equivalent to `cd ~/Desktop` | | docs/d/documents | Equivalent to `cd ~/Documents` | | downloads/down | Equivalent to `cd ~/Downloads` | +| emptytrash | Empty the Trash on all mounted volumes and the main HDD | +| pubkey | Copies your public key to clipboard | ### Functions @@ -417,6 +421,7 @@ And the results would be one of: | about | Shows info on the current serve/session/user | | | targz | Create a .tar.gz archive, using `zopfli`, `pigz` or `gzip` for compression | `path`: The path for the file to be compressed | | googl/short | Shortens a URL using goo.gl service | `path`: The path for the file to be compressed`path`: The path for the file to be shrinked | +| datauri | Create a data URI from a file and copy it to the pasteboard | `path`: The file to be copied as base64 | ### Safety @@ -441,6 +446,27 @@ Ask your questions in our issues with the title starting with "[QUESTION]". Be sure your searched for similar issues that might also have been already closed by then. Send suggestions opening issues with the title starting with "[SUGGESTION]". +### Influences + +We noticed many well known developers share some of their aliases and customizations for terminal. +This has inspired us as well, bringing some of the best ideas to termtools. +Feel free to submit new ideas as well, by using the issues in this repository. + +Some ideas for the aliases and functions were inspired by (or brought from): + +- [@addyosmani](https://github.com/addyosmani) (Addy Osmani) + [https://github.com/addyosmani/dotfiles](https://github.com/addyosmani/dotfiles) +- [@alrra](https://github.com/alrra) (Cãtãlin Mariş) + [https://github.com/alrra/dotfiles](https://github.com/alrra/dotfiles) +- [@cowboy](https://github.com/cowboy) (Ben Alman) + [https://github.com/cowboy/dotfiles](https://github.com/cowboy/dotfiles) +- [@mathiasbynens](https://github.com/mathiasbynens) (Mathias Bynens) + [https://github.com/mathiasbynens/dotfiles](https://github.com/mathiasbynens/dotfiles) +- [@necolas](https://github.com/necolas) (Nicolas Gallagher) + [https://github.com/necolas/dotfiles](https://github.com/necolas/dotfiles) +- [@paulirish](https://github.com/paulirish) (Paul Irish) + [https://github.com/paulirish/dotfiles](https://github.com/paulirish/dotfiles) + ### Contribute We are welcoming new themes and all the help we might get. diff --git a/aliases.sh b/aliases.sh index e0b255d..6dad2bc 100644 --- a/aliases.sh +++ b/aliases.sh @@ -177,9 +177,36 @@ alias amioffline="ping www.google.com -c 1 2>/dev/null >/dev/null && echo \"No\" alias ifactive="ifconfig | pcregrep -M -o '^[^\t:]+:([^\n]|\n\t)*status: active'" alias flush="dscacheutil -flushcache && killall -HUP mDNSResponder" +# Empty the Trash on all mounted volumes and the main HDD +alias emptytrash="sudo rm -rfv /Volumes/*/.Trashes; sudo rm -rfv ~/.Trash;" +alias pubkey="more ~/.ssh/id_rsa.pub | pbcopy | printf '=> Public key copied to pasteboard.\n'" command -v md5sum > /dev/null || alias md5sum="md5" command -v sha1sum > /dev/null || alias sha1sum="shasum" +# Ignore duplicate commands in the history +export HISTCONTROL=ignoredups +# Make new shells get the history lines from all previous +# shells instead of the default "last window closed" history +export PROMPT_COMMAND="history -a; $PROMPT_COMMAND" + +# imported from @necolas's dotfiles +# Create a data URI from a file and copy it to the pasteboard +datauri() { + local mimeType=$(file -b --mime-type "$1") + if [[ $mimeType == text/* ]]; then + mimeType="${mimeType};charset=utf-8" + fi + printf "data:${mimeType};base64,$(openssl base64 -in "$1" | tr -d '\n')" | pbcopy | printf "=> data URI copied to pasteboard.\n" +} +# Autocorrect typos in path names when using `cd` +shopt -s cdspell + +# Check the window size after each command and, if necessary, update the values +# of LINES and COLUMNS. +shopt -s checkwinsize + + + function dog () { cat $@ | less -FRNX }