pimp ps1
This commit is contained in:
parent
36188d39b7
commit
67d34d9ee5
13
users/pbsds/home/profiles/bashrc.d/ps1.sh
Normal file
13
users/pbsds/home/profiles/bashrc.d/ps1.sh
Normal file
@ -0,0 +1,13 @@
|
||||
ps1_parse_git_branch() {
|
||||
local retcode=$?
|
||||
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
|
||||
return $retcode
|
||||
}
|
||||
ps1_retcode_color() {
|
||||
local retcode=$?
|
||||
[ $? -eq 0 ] \
|
||||
&& echo -e '\e[32m' \
|
||||
|| echo -e '\e[33m'
|
||||
return $retcode
|
||||
}
|
||||
export PS1='\[\033[01;32m\]\u@\h\[\033[01;37m\] \[\033[01;34m\]\W\[\033[33m\]$(ps1_parse_git_branch)$(ps1_retcode_color)\$\[\033[00m\] '
|
@ -26,11 +26,6 @@ in
|
||||
programs.bash.initExtra = ''
|
||||
bind 'set completion-ignore-case on'
|
||||
|
||||
parse_git_branch() {
|
||||
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
|
||||
}
|
||||
export PS1='\[\033[01;32m\]\u@\h\[\033[01;37m\] \[\033[01;34m\]\W\[\033[33m\]$(parse_git_branch)\[\033[01;32m\]\$\[\033[00m\] '
|
||||
|
||||
# tldr
|
||||
if command -v tldr >/dev/null; then
|
||||
complete -F _command tldr
|
||||
|
Loading…
Reference in New Issue
Block a user