This commit is contained in:
Peder Bergebakken Sundt 2025-01-26 16:14:38 +01:00
parent 36188d39b7
commit 67d34d9ee5
2 changed files with 13 additions and 5 deletions

View 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\] '

View File

@ -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