diff options
author | David Robillard <d@drobilla.net> | 2014-12-18 14:54:18 -0500 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2014-12-18 14:54:18 -0500 |
commit | eb02a21a866affe555218befcfb3684bb01a517b (patch) | |
tree | f80558c55ae6e67e50a2edc626faff30fc4b32ec | |
parent | 114ee9aa4f683ed8b16c4ae09027daf248362774 (diff) | |
download | dotfiles-eb02a21a866affe555218befcfb3684bb01a517b.tar.gz dotfiles-eb02a21a866affe555218befcfb3684bb01a517b.tar.bz2 dotfiles-eb02a21a866affe555218befcfb3684bb01a517b.zip |
Add bashrc.
-rw-r--r-- | bashrc | 85 |
1 files changed, 85 insertions, 0 deletions
@@ -0,0 +1,85 @@ +# ~/.bashrc: executed by bash(1) for non-login shells. + +# If not running interactively, don't do anything +[ -z "$PS1" ] && return + +# don't put duplicate lines in the history. +HISTCONTROL=ignoreboth + +# append to the history file, don't overwrite it +shopt -s histappend + +# set big history +export HISTSIZE=100000 +export HISTFILESIZE=$HISTSIZE + +# append to history after each command finishes +export PROMPT_COMMAND="history -a; $PROMPT_COMMAND" + +# check the window size after each command and, if necessary, +# update the values of LINES and COLUMNS. +shopt -s checkwinsize + +# set variable identifying the chroot you work in (used in the prompt below) +if [ -z "$debian_chroot" ] && [ -r /etc/debian_chroot ]; then + debian_chroot=$(cat /etc/debian_chroot) +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\] " +else + # no color + PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ ' +fi + +# set xterm title to user@host:dir +case "$TERM" in +xterm*|rxvt*) + PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1" + ;; +*) + ;; +esac + +# enable color support of various utilities +if [ -x /usr/bin/dircolors ]; then + test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)" + alias ls='ls --color=auto' + alias grep='grep --color=auto' + alias fgrep='fgrep --color=auto' + alias egrep='egrep --color=auto' +fi + +# enable programmable completion features (you don't need to enable +# this, if it's already enabled in /etc/bash.bashrc and /etc/profile +# sources /etc/bash.bashrc). +if [ -f /etc/bash_completion ] && ! shopt -oq posix; then + . /etc/bash_completion +fi + +# aliases +alias svn='colorsvn' + +# environment +export LC_TIME="en_DK.UTF-8" +export WINDOW_MANAGER="/usr/bin/awesome" +export CFLAGS="-O2 -march=corei7-avx -fomit-frame-pointer -DNDEBUG -ftree-vectorize" +export CXXFLAGS="$CFLAGS" +export GTK_IM_MODULE="xim" +export EDITOR="emacsclient" + +# colorize man +man() { + env \ + LESS_TERMCAP_mb=$(printf "\e[31m") \ + LESS_TERMCAP_md=$(printf "\e[1;32m") \ + LESS_TERMCAP_me=$(printf "\e[0m") \ + LESS_TERMCAP_se=$(printf "\e[0m") \ + LESS_TERMCAP_so=$(printf "\e[36m") \ + LESS_TERMCAP_ue=$(printf "\e[0m") \ + LESS_TERMCAP_us=$(printf "\e[33m") \ + man "$@" +} |