dotfiles/bash/.bashrc

50 lines
1.1 KiB
Bash
Raw Normal View History

2023-07-25 11:45:32 +02:00
#
# ~/.bashrc
#
# If not running interactively, don't do anything
[[ $- != *i* ]] && return
alias ls='ls --color=auto'
alias grep='grep --color=auto'
2023-07-25 13:57:30 +02:00
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
colorize() {
echo -e "\[\033[1;$1\]$2\[\033[0m\]"
2023-07-25 13:57:30 +02:00
}
PS1='['
2023-07-25 17:04:11 +02:00
PS1+=$(colorize '92m' '\u@\h')
2023-07-25 13:57:30 +02:00
PS1+=':'
2023-07-25 17:04:11 +02:00
PS1+=$(colorize '94m' '\w')
2023-07-25 13:57:30 +02:00
PS1+=']'
PS1+=$(colorize '93m' '$(parse_git_branch)')
PS1+='\$ '
2023-07-25 11:45:32 +02:00
# Configure GPG
# This is needed to sign git commits
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)"
2024-01-17 18:35:10 +01:00
[ -x "$(command -v nvim 2> /dev/null)" ] && alias vim='nvim'
[ -x "$(command -v neovide 2> /dev/null)" ] && alias nvim='WINIT_X11_SCALE_FACTOR=1.0 neovide'
2023-07-25 11:45:32 +02:00
# ghcup (Haskell)
[ -f "$HOME/.ghcup/env" ] && source "$HOME/.ghcup/env" # ghcup-env
2023-09-26 21:21:34 +02:00
# NodeJS
export npm_config_prefix="$HOME/.local"
export PATH="$HOME/.local/bin:$PATH"
2023-09-26 21:21:34 +02:00
# Bun
export BUN_INSTALL="$HOME/.bun"
export PATH="$BUN_INSTALL/bin:$PATH"
2024-01-09 18:14:03 +01:00
# Julia
export PATH="$HOME/.juliaup/bin:$PATH"