Created
September 22, 2016 16:31
-
-
Save omar-yassin/38be7989fd4acbecca2b7fb5ff380eb2 to your computer and use it in GitHub Desktop.
bash_profile 2016
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export PS1='\e[1;35m\u\e[m@\h:\e[1;31m\w\e[m\n\$ ' | |
| export PATH="$PATH:~/bin/" | |
| # auto complete hostnames | |
| _complete_ssh_hosts () | |
| { | |
| COMPREPLY=() | |
| cur="${COMP_WORDS[COMP_CWORD]}" | |
| comp_ssh_hosts=`cat ~/.ssh/known_hosts | \ | |
| cut -f 1 -d ' ' | \ | |
| sed -e s/,.*//g | \ | |
| grep -v ^# | \ | |
| uniq | \ | |
| grep -v "\[" ; | |
| cat ~/.ssh/config | \ | |
| grep "^Host " | \ | |
| awk '{print $2}' | |
| ` | |
| COMPREPLY=( $(compgen -W "${comp_ssh_hosts}" -- $cur)) | |
| return 0 | |
| } | |
| complete -F _complete_ssh_hosts ssh | |
| complete -F _complete_ssh_hosts i2cssh | |
| # autocomplete in python shell | |
| export PYTHONSTARTUP=~/.pythonrc | |
| # On a separate file | |
| # ~/.pythonrc | |
| # enable syntax completion | |
| try: | |
| import readline | |
| except ImportError: | |
| print("Module readline not available.") | |
| else: | |
| import rlcompleter | |
| readline.parse_and_bind("tab: complete") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment