diff options
Diffstat (limited to 'bash/.bashrc')
-rw-r--r-- | bash/.bashrc | 60 |
1 files changed, 53 insertions, 7 deletions
diff --git a/bash/.bashrc b/bash/.bashrc index 7bb7790..9b23427 100644 --- a/bash/.bashrc +++ b/bash/.bashrc @@ -25,11 +25,31 @@ if [ -z "$debian_chroot" ] && [ -r /etc/debian_chroot ]; then debian_chroot=$(cat /etc/debian_chroot) fi +git_color() { + branch=$(git rev-parse --abbrev-ref HEAD 2>/dev/null) + status=$(git status --porcelain -b 2>/dev/null) + if [[ "$status" == "## ${branch}...origin/${branch}" ]]; then + echo -e "\033[0;32m" # green + else + echo -e "\033[0;31m" # red + fi +} + +git_branch() { + a=$(git rev-parse --abbrev-ref HEAD 2>/dev/null) + if [ -n "$a" ]; then + echo " [$a]" + else + echo "" + fi +} + # set fancy prompt if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then # color supported #PS1="\[\e]0;\u@\h: \w\a\]${debian_chroot:+($debian_chroot)}\[\033[32m\]╭─ \u@\h \w ─╼\n╰╼ \$\[\033[00m\] " - PS1="\[\e]0;\u@\h: \w\a\]${debian_chroot:+($debian_chroot)}\[\033[32m\]\u@\h \w\n\$\[\033[00m\] " + #PS1="\[\e]0;\u@\h: \w\a\]${debian_chroot:+($debian_chroot)}\[\033[32m\]\u@\h \w\n\$\[\033[00m\] " + PS1="\[\e]0;\u@\h: \w\a\]\[\e]0;\u@\h: \w\a\]\[\033[32m\]\u@\h \w\[\$(git_color)\]\$(git_branch)\n\[\033[0;32m\]$\[\033[00m\] " else # no color PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ ' @@ -53,6 +73,11 @@ if [ -x /usr/bin/dircolors ]; then alias egrep='egrep --color=auto' fi +# load ls_colors configuration if it exists (Arch) +if [ -f /usr/share/LS_COLORS/dircolors.sh ]; then + . /usr/share/LS_COLORS/dircolors.sh +fi + # ever seen a monochrome xterm? I sure haven't if [ "$TERM" = "xterm" ]; then export TERM=xterm-256color @@ -69,18 +94,18 @@ fi alias open='xdg-open' # environment +export LANG="en_CA.UTF-8" export LC_MEASUREMENT="en_CA.UTF-8" export LC_MONETARY="en_CA.UTF-8" export LC_NUMERIC="en_CA.UTF-8" export LC_PAPER="en_CA.UTF-8" export LC_TIME="en_DK.UTF-8" -export WINDOW_MANAGER="/usr/bin/awesome" -export CFLAGS="-O2 -march=native -fomit-frame-pointer -DNDEBUG -ftree-vectorize" -export CXXFLAGS="$CFLAGS" +export WINDOW_MANAGER="/usr/bin/bspwm" export GTK_IM_MODULE="xim" export EDITOR="emacsclient" -export CXX=/usr/lib/ccache/g++-6 -export CC=/usr/lib/ccache/gcc-6 +export PAGER="less" +export PKG_CONFIG_PATH="/usr/local/lib/pkgconfig:/usr/lib/pkgconfig" +export VAGRANT_DEFAULT_PROVIDER=libvirt # colorize man man() { @@ -95,7 +120,28 @@ man() { man "$@" } -# set PATH so it includes user's private bin if it exists +if [ -d "$HOME/.cargo/bin" ] ; then + PATH="$HOME/.cargo/bin:$PATH" +fi + +if [ -d "$HOME/.gem/ruby/2.6.0/bin" ] ; then + PATH="$HOME/.gem/ruby/2.6.0/bin:$PATH" +fi + +if [ -d "$HOME/.local/lib/node_modules/bin" ] ; then + PATH="$HOME/.local/lib/node_modules/bin:$PATH" +fi + +if [ -d "$HOME/.local/bin" ] ; then + PATH="$HOME/.local/bin:$PATH" +fi + if [ -d "$HOME/bin" ] ; then PATH="$HOME/bin:$PATH" fi + +if [ -d "/usr/lib/ccache/bin" ] ; then # Arch + PATH="/usr/lib/ccache/bin:$PATH" +elif [ -d "/usr/lib/ccache" ] ; then # Debian + PATH="/usr/lib/ccache:$PATH" +fi |