diff --git a/README.md b/README.md index 8b8994ef..e305eb8d 100644 --- a/README.md +++ b/README.md @@ -54,6 +54,7 @@ If you are submitting a pull request, please add your name to the list. * [Simon H. Eskildsen][sirupsen] * [Mark Szymanski][mrman208] * [Florian Baumann][noqqe] +* [Andy Shen][shenie] [revans]: http://github.com/revans [zerobearing2]: http://github.com/zerobearing2 @@ -62,4 +63,5 @@ If you are submitting a pull request, please add your name to the list. [sirupsen]: http://github.com/sirupsen [mrman208]: http://github.com/mrman208 [noqqe]: http://github.com/noqqe +[shenie]: http://github.com/shenie diff --git a/completion/ssh.completion.bash b/completion/ssh.completion.bash new file mode 100644 index 00000000..30fd65d6 --- /dev/null +++ b/completion/ssh.completion.bash @@ -0,0 +1,23 @@ +#!/bin/bash +# Bash completion support for ssh. + +export COMP_WORDBREAKS=${COMP_WORDBREAKS/\:/} + +_sshcomplete() { + + # parse all defined hosts from .ssh/config + if [ -r $HOME/.ssh/config ]; then + COMPREPLY=($(compgen -W "$(grep ^Host $HOME/.ssh/config | awk '{print $2}' )" -- ${COMP_WORDS[COMP_CWORD]})) + fi + + # parse all hosts found in .ssh/known_hosts + if [ -r $HOME/.ssh/known_hosts ]; then + if grep -v -q -e '^ ssh-rsa' $HOME/.ssh/known_hosts ; then + COMPREPLY=( $COMPREPLY $(compgen -W "$( awk '{print $1}' $HOME/.ssh/known_hosts | cut -d, -f 1 | sed -e 's/\[//g' | sed -e 's/\]//g' | cut -d: -f1 | grep -v ssh-rsa)" -- ${COMP_WORDS[COMP_CWORD]} )) + fi + fi + + return 0 +} + +complete -o default -o nospace -F _sshcomplete ssh diff --git a/themes/minimal/minimal.theme.bash b/themes/minimal/minimal.theme.bash index 2f9b926e..a94c4536 100644 --- a/themes/minimal/minimal.theme.bash +++ b/themes/minimal/minimal.theme.bash @@ -1,8 +1,18 @@ prompt_setter() { if [[ $? -eq 0 ]]; then - PS1="\W " + if [ ! $VIMRUNTIME = "" ] + then + PS1="{vim} \W " + else + PS1="\W " + fi else - PS1="${bold_red}\W ${normal}" + if [ ! $VIMRUNTIME = "" ] + then + PS1="{vim} ${bold_red}\W ${normal}" + else + PS1="${bold_red}\W ${normal}" + fi fi } diff --git a/themes/modern/modern.theme.bash b/themes/modern/modern.theme.bash new file mode 100644 index 00000000..f0dbccce --- /dev/null +++ b/themes/modern/modern.theme.bash @@ -0,0 +1,35 @@ +SCM_THEME_PROMPT_PREFIX="" +SCM_THEME_PROMPT_SUFFIX="" + +SCM_THEME_PROMPT_DIRTY=' ${bold_red}✗${normal}' +SCM_THEME_PROMPT_CLEAN=' ${bold_green}✓${normal}' +SCM_GIT_CHAR='${bold_green}±${normal}' +SCM_SVN_CHAR='${bold_cyan}⑆${normal}' +SCM_HG_CHAR='${bold_red}☿${normal}' + +modern_scm_prompt() { + CHAR=$(scm_char) + if [ $CHAR = $SCM_NONE_CHAR ] + then + return + else + echo "[$(scm_char)][$(scm_prompt_info)]" + fi +} + +prompt() { + if [ $? -ne 0 ] + then + PS1="${bold_red}┌─${reset_color}$(modern_scm_prompt)[${cyan}\W${normal}] +${bold_red}└─▪${normal} " + else + PS1="┌─$(modern_scm_prompt)[${cyan}\W${normal}] +└─▪ " + fi +} + +PS2="└─▪ " + + + +PROMPT_COMMAND=prompt