dotfiles

dot files
git clone git://git.rr3.xyz/dotfiles
Log | Files | Refs

.bashrc (1547B)


      1 # If not running interactively, don't do anything
      2 [[ $- != *i* ]] && return
      3 
      4 alias ls='ls --color=auto'
      5 alias e=vis
      6 alias o=xdg-open
      7 alias ..='cd ..'
      8 
      9 PROMPT_COMMAND='PS1EXIT=$?;'                                                     # Store previous exit code in PS1EXIT
     10 PROMPT_COMMAND+='printf "\e[6n";'                                                # Query cursor position (format: \e[<row>;<col>R)
     11 PROMPT_COMMAND+='read -sd";";'                                                   # Ignore upto ";"
     12 PROMPT_COMMAND+='read -sdR PS1COL;'                                              # Store column number in PS1COL
     13 PROMPT_COMMAND+='PS1="";'                                                        # Initialize PS1
     14 PROMPT_COMMAND+='[ ${PS1COL:-1} -ne 1 ] && PS1+="\[\e[31;1m\]◆\[\e[m\]\n";'      # If current row is nonempty, add newline to PS1
     15 PROMPT_COMMAND+='PS1+="\[\e[36m\]\w\[\e[m\]";'                                   # Add working directory to PS1
     16 PROMPT_COMMAND+='git rev-parse --git-dir >/dev/null 2>&1'                        # Check if inside git repo;
     17 PROMPT_COMMAND+=' && PS1+="  \[\e[35m\] $(git branch --show-current)\[\e[m\]";' #   if so, add branch name to PS1
     18 PROMPT_COMMAND+='PS1+="  \[\e[31m\]$PS1EXIT\[\e[m\]";'                           # Add previous exit code to PS1
     19 PROMPT_COMMAND+='PS1+="\n\[\e[32m\]▶\[\e[m\] ";'                                 # Add actual prompt to PS1
     20 
     21 PS2='\[\e[32m\]▷\[\e[m\] '
     22 
     23 source ~/app/z/z.sh
     24 
     25 [ -f "/home/rob/.ghcup/env" ] && . "/home/rob/.ghcup/env" # ghcup-env
     26 . "$HOME/.cargo/env"