Merge remote branch 'upstream/master'
commit
cbf081d2a0
|
|
@ -54,6 +54,7 @@ If you are submitting a pull request, please add your name to the list.
|
||||||
* [Simon H. Eskildsen][sirupsen]
|
* [Simon H. Eskildsen][sirupsen]
|
||||||
* [Mark Szymanski][mrman208]
|
* [Mark Szymanski][mrman208]
|
||||||
* [Florian Baumann][noqqe]
|
* [Florian Baumann][noqqe]
|
||||||
|
* [Andy Shen][shenie]
|
||||||
|
|
||||||
[revans]: http://github.com/revans
|
[revans]: http://github.com/revans
|
||||||
[zerobearing2]: http://github.com/zerobearing2
|
[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
|
[sirupsen]: http://github.com/sirupsen
|
||||||
[mrman208]: http://github.com/mrman208
|
[mrman208]: http://github.com/mrman208
|
||||||
[noqqe]: http://github.com/noqqe
|
[noqqe]: http://github.com/noqqe
|
||||||
|
[shenie]: http://github.com/shenie
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
|
|
@ -1,8 +1,18 @@
|
||||||
prompt_setter() {
|
prompt_setter() {
|
||||||
if [[ $? -eq 0 ]]; then
|
if [[ $? -eq 0 ]]; then
|
||||||
PS1="\W "
|
if [ ! $VIMRUNTIME = "" ]
|
||||||
|
then
|
||||||
|
PS1="{vim} \W "
|
||||||
|
else
|
||||||
|
PS1="\W "
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
PS1="${bold_red}\W ${normal}"
|
if [ ! $VIMRUNTIME = "" ]
|
||||||
|
then
|
||||||
|
PS1="{vim} ${bold_red}\W ${normal}"
|
||||||
|
else
|
||||||
|
PS1="${bold_red}\W ${normal}"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
Loading…
Reference in New Issue