Better bash prompt
This commit is contained in:
parent
04271572a1
commit
e7c084c11d
20
bash/.bashrc
20
bash/.bashrc
|
@ -7,7 +7,24 @@
|
|||
|
||||
alias ls='ls --color=auto'
|
||||
alias grep='grep --color=auto'
|
||||
PS1='[\u@\h \W]\$ '
|
||||
|
||||
parse_git_branch() {
|
||||
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
|
||||
}
|
||||
|
||||
colorize() {
|
||||
echo -e "\e[$1$2\e[m"
|
||||
}
|
||||
|
||||
PS1='['
|
||||
PS1+=$(colorize '92m' '\u')
|
||||
PS1+='@'
|
||||
PS1+=$(colorize '92m' '\h')
|
||||
PS1+=':'
|
||||
PS1+=$(colorize '94m' '\W')
|
||||
PS1+=']'
|
||||
PS1+=$(colorize '93m' '$(parse_git_branch)')
|
||||
PS1+='\$ '
|
||||
|
||||
# Configure GPG
|
||||
# This is needed to sign git commits
|
||||
|
@ -16,6 +33,7 @@ export GPG_TTY=$(tty)
|
|||
# Configure editor
|
||||
export VISUAL="$(command -v nvim 2>/dev/null)"
|
||||
export EDITOR="$(command -v nvim 2>/dev/null || command -v vim 2>/dev/null || command -v nano)"
|
||||
alias vim='nvim'
|
||||
|
||||
# ghcup (Haskell)
|
||||
[ -f "$HOME/.ghcup/env" ] && source "$HOME/.ghcup/env" # ghcup-env
|
||||
|
|
Loading…
Reference in a new issue