annotate .bashrc @ 100:a4cd935561d4 dml-dockerised tip

small updates and version pin for cliopatria
author wolffd <wolffd.mail@googlemail.com>
date Fri, 29 Jun 2018 17:48:41 +0100
parents 3255717f4e6b
children
rev   line source
samer@2 1 # ~/.bashrc: executed by bash(1) for non-login shells.
samer@2 2 # see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
samer@2 3 # for examples
samer@2 4
samer@2 5 # If not running interactively, don't do anything
samer@2 6 case $- in
samer@2 7 *i*) ;;
samer@2 8 *) return;;
samer@2 9 esac
samer@2 10
samer@2 11 # don't put duplicate lines or lines starting with space in the history.
samer@2 12 # See bash(1) for more options
samer@2 13 HISTCONTROL=ignoreboth
samer@2 14
samer@2 15 # append to the history file, don't overwrite it
samer@2 16 shopt -s histappend
samer@2 17
samer@2 18 # for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
samer@2 19 HISTIGNORE="?:ls:bg:fg:cd"
samer@2 20 HISTSIZE=10000
samer@2 21 HISTFILESIZE=10000
samer@2 22
samer@2 23 # check the window size after each command and, if necessary,
samer@2 24 # update the values of LINES and COLUMNS.
samer@2 25 shopt -s checkwinsize
samer@2 26
samer@2 27 # If set, the pattern "**" used in a pathname expansion context will
samer@2 28 # match all files and zero or more directories and subdirectories.
samer@2 29 #shopt -s globstar
samer@2 30
samer@2 31 # make less more friendly for non-text input files, see lesspipe(1)
samer@2 32 [ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
samer@2 33
samer@2 34 # set variable identifying the chroot you work in (used in the prompt below)
samer@2 35 if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then
samer@2 36 debian_chroot=$(cat /etc/debian_chroot)
samer@2 37 fi
samer@2 38
samer@2 39 # set a fancy prompt (non-color, unless we know we "want" color)
samer@2 40 case "$TERM" in
samer@2 41 xterm-color) color_prompt=yes;;
samer@2 42 esac
samer@2 43 color_prompt=yes
samer@2 44
samer@2 45 # uncomment for a colored prompt, if the terminal has the capability; turned
samer@2 46 # off by default to not distract the user: the focus in a terminal window
samer@2 47 # should be on the output of commands, not on the prompt
samer@2 48 #force_color_prompt=yes
samer@2 49
samer@2 50 if [ -n "$force_color_prompt" ]; then
samer@2 51 if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
samer@2 52 # We have color support; assume it's compliant with Ecma-48
samer@2 53 # (ISO/IEC-6429). (Lack of such support is extremely rare, and such
samer@2 54 # a case would tend to support setf rather than setaf.)
samer@2 55 color_prompt=yes
samer@2 56 else
samer@2 57 color_prompt=
samer@2 58 fi
samer@2 59 fi
samer@2 60
samer@2 61 #if [ "$color_prompt" = yes ]; then
samer@2 62 # PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
samer@2 63 #else
samer@2 64 # PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
samer@2 65 #fi
samer@2 66 PS1='\[\e[1m\]\t \u@\h:\w$\[\e[0m\] '
samer@2 67 unset color_prompt force_color_prompt
samer@2 68
samer@2 69 # If this is an xterm set the title to user@host:dir
samer@2 70 case "$TERM" in
samer@2 71 xterm*|rxvt*|screen)
samer@2 72 PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
samer@2 73 ;;
samer@2 74 *)
samer@2 75 ;;
samer@2 76 esac
samer@2 77
samer@2 78 # enable color support of ls and also add handy aliases
samer@2 79 if [ -x /usr/bin/dircolors ]; then
samer@2 80 test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
samer@2 81 alias ls='ls --color=auto'
samer@2 82 #alias dir='dir --color=auto'
samer@2 83 #alias vdir='vdir --color=auto'
samer@2 84
samer@2 85 alias grep='grep --color=auto'
samer@2 86 alias fgrep='fgrep --color=auto'
samer@2 87 alias egrep='egrep --color=auto'
samer@2 88 fi
samer@2 89
samer@2 90 # some more ls aliases
samer@2 91 alias ll='ls -alF'
samer@2 92 alias la='ls -A'
samer@2 93 alias l='ls -CF'
samer@2 94
samer@2 95 # Add an "alert" alias for long running commands. Use like so:
samer@2 96 # sleep 10; alert
samer@2 97 alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'
samer@2 98
samer@2 99 # Alias definitions.
samer@2 100 # You may want to put all your additions into a separate file like
samer@2 101 # ~/.bash_aliases, instead of adding them here directly.
samer@2 102 # See /usr/share/doc/bash-doc/examples in the bash-doc package.
samer@2 103
samer@2 104 if [ -f ~/.bash_aliases ]; then
samer@2 105 . ~/.bash_aliases
samer@2 106 fi
samer@2 107
samer@2 108 # enable programmable completion features (you don't need to enable
samer@2 109 # this, if it's already enabled in /etc/bash.bashrc and /etc/profile
samer@2 110 # sources /etc/bash.bashrc).
samer@2 111 if ! shopt -oq posix; then
samer@2 112 if [ -f /usr/share/bash-completion/bash_completion ]; then
samer@2 113 . /usr/share/bash-completion/bash_completion
samer@2 114 elif [ -f /etc/bash_completion ]; then
samer@2 115 . /etc/bash_completion
samer@2 116 fi
samer@2 117 fi
samer@2 118
samer@2 119