nixos/.bashrc

55 lines
1.3 KiB
Bash
Raw Normal View History

2023-03-01 17:18:32 +00:00
#!/bin/bash
# vim: ft=sh
# Return if called by load leveller
# if [[ -n "$LOADL_ACTIVE" ]] ; then
# return
# fi
# If not running interactively, don't do anything
# case $- in
# *i*) ;;
# *) return;;
# esac
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
# set PATH so it includes user's private bin if it exists
grep "$HOME/.local/bin" "$PATH" > /dev/null 2>&1 || export PATH="$HOME/.local/bin:$PATH"
# enable color support of ls and also add handy aliases
if [ -x /usr/bin/dircolors ]; then
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
alias ls='ls --color=auto'
alias dir='dir --color=auto'
alias vdir='vdir --color=auto'
alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
fi
# colored GCC warnings and errors
export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01'
# set LANG to be something sensible
export LANG="en_GB.utf-8"
# some more ls aliases
alias ll='ls -alF'
alias la='ls -A'
alias l='ls -CF'
command -v nvim && export EDITOR=nvim || export EDITOR=vi
command -v xed && export VISUAL=xed || export VISUAL=vi
if [ -d "$HOME/.bashrc.local" ] ; then
source "$HOME/.bashrc.local"
fi
eval "$(starship init bash)"