Skip to content

Commit

Permalink
updated .bashrc
Browse files Browse the repository at this point in the history
  • Loading branch information
andreas säterås committed Jun 19, 2014
1 parent 86b2ea3 commit 934dccf
Show file tree
Hide file tree
Showing 2 changed files with 90 additions and 114 deletions.
202 changes: 89 additions & 113 deletions .bashrc
Original file line number Diff line number Diff line change
@@ -1,132 +1,108 @@
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
#-------------------------------------------------------------
# BOA-2.2.5 default .bashrc
#-------------------------------------------------------------

# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac

# don't put duplicate lines or lines starting with space in the history.
# See bash(1) for more options
HISTCONTROL=ignoreboth

# append to the history file, don't overwrite it
shopt -s histappend
ulimit -S -c 0

# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
HISTSIZE=1000
HISTFILESIZE=2000
set -o notify
set -o ignoreeof

# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s cdspell
shopt -s cdable_vars
shopt -s checkhash
shopt -s checkwinsize
shopt -s sourcepath
shopt -s no_empty_cmd_completion
shopt -s cmdhist
shopt -s histappend histreedit histverify
shopt -u mailwarn
unset MAILCHECK

# If set, the pattern "**" used in a pathname expansion context will
# match all files and zero or more directories and subdirectories.
#shopt -s globstar

# make less more friendly for non-text input files, see lesspipe(1)
[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"

# 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 a fancy prompt (non-color, unless we know we "want" color)
case "$TERM" in
xterm-color) color_prompt=yes;;
esac

# uncomment for a colored prompt, if the terminal has the capability; turned
# off by default to not distract the user: the focus in a terminal window
# should be on the output of commands, not on the prompt
#force_color_prompt=yes
HISTCONTROL=ignoredups:ignorespace

if [ -n "$force_color_prompt" ]; then
if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
# We have color support; assume it's compliant with Ecma-48
# (ISO/IEC-6429). (Lack of such support is extremely rare, and such
# a case would tend to support setf rather than setaf.)
color_prompt=yes
else
color_prompt=
fi
fi
#export TERM=xterm-color

if [ "$color_prompt" = yes ]; then
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
else
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
fi
unset color_prompt force_color_prompt
export PATH=$PATH:/usr/local/bin:/opt/local/bin

# If this is an xterm set the title to user@host:dir
case "$TERM" in
xterm*|rxvt*)
PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
;;
*)
;;
xterm*|rxvt*|vt100)
export PS1='\h:\w\$ '
;;
*)
;;
esac

# 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'
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
alias ll="ls -l --group-directories-first --color=auto"
alias ls='ls -hF --color=auto' # add colors for filetype recognition
alias la='ls -Al --color=auto' # show hidden files
alias lx='ls -lXB --color=auto' # sort by extension
alias lk='ls -lSr --color=auto' # sort by size, biggest last
alias lc='ls -ltcr --color=auto' # sort by and show change time, most recent last
alias lu='ls -ltur --color=auto' # sort by and show access time, most recent last
alias lt='ls -ltr --color=auto' # sort by date, most recent last
alias lr='ls -lR --color=auto' # recursive ls
alias dir='dir --color=auto' # add colors
alias vdir='vdir --color=auto' # add colors
alias grep='grep --color=auto' # add colors
alias fgrep='fgrep --color=auto' # add colors
alias egrep='egrep --color=auto' # add colors
else
alias ll="ls -l --group-directories-first"
alias ls='ls -hF' # filetype recognition
alias la='ls -Al' # show hidden files
alias lx='ls -lXB' # sort by extension
alias lk='ls -lSr' # sort by size, biggest last
alias lc='ls -ltcr' # sort by and show change time, most recent last
alias lu='ls -ltur' # sort by and show access time, most recent last
alias lt='ls -ltr' # sort by date, most recent last
alias lr='ls -lR' # recursive ls
fi

# some more ls aliases
alias ll='ls -alF'
alias la='ls -A'
alias l='ls -CF'

# Add an "alert" alias for long running commands. Use like so:
# sleep 10; alert
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$//'\'')"'
alias df='df -kTh'
alias wget='wget --no-check-certificate'

# Custom Aliases
alias ..="cd .."
alias ..2="cd ../.."
alias ..3="cd ../../.."
alias ..4="cd ../../../.."
alias ..5="cd ../../../../.."
alias ..="cd .."
alias ...="cd ../.."
alias ....="cd ../../.."
alias .....="cd ../../../.."
alias ......="cd ../../../../.."
alias cd..="cd .."
alias cd...="cd ../.."
alias cd....="cd ../../.."
alias cd.....="cd ../../../.."
alias cd......="cd ../../../../.."


# Alias definitions.
# You may want to put all your additions into a separate file like
# ~/.bash_aliases, instead of adding them here directly.
# See /usr/share/doc/bash-doc/examples in the bash-doc package.
function xtitle()
{
case "$TERM" in
xterm*|rxvt*)
echo -n -e "\033]0;$*\007" ;;
*)
;;
esac
}

_L_HOST=`uname -n`
alias top='xtitle $_L_HOST System Monitor && top'
alias htop='xtitle $_L_HOST System Monitor && htop'
alias mytop='xtitle $_L_HOST SQL Monitor && mytop'
alias make='xtitle Making $(basename $PWD) ; make'

function extract()
{
if [ -f $1 ] ; then
case $1 in
*.tar.bz2) tar xjf $1 ;;
*.tar.gz) tar xzf $1 ;;
*.bz2) bunzip2 $1 ;;
*.rar) unrar x $1 ;;
*.gz) gunzip -q $1 ;;
*.tar) tar xf $1 ;;
*.tbz2) tar xjf $1 ;;
*.tgz) tar xzf $1 ;;
*.zip) unzip -qq $1 ;;
*.Z) uncompress $1 ;;
*.7z) 7z x $1 ;;
*) echo "'$1' cannot be extracted via >extract<" ;;
esac
else
echo "'$1' is not a valid file"
fi
}

if [ -f ~/.bash_aliases ]; then
. ~/.bash_aliases
. ~/.bash_aliases
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 ! shopt -oq posix; then
if [ -f /usr/share/bash-completion/bash_completion ]; then
. /usr/share/bash-completion/bash_completion
elif [ -f /etc/bash_completion ]; then
. /etc/bash_completion
fi
fi
umask 022
2 changes: 1 addition & 1 deletion .vimrc_withdebug
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ au BufNewFile,BufRead *.info set filetype=php
" defscrollback 10000
let g:vdebug_options = {
\ 'server': '0.0.0.0',
\ 'break_on_open': 0
\ 'break_on_open': 1
\}
let g:vdebug_keymap = {
\ 'step_into': '<F8>'
Expand Down

0 comments on commit 934dccf

Please sign in to comment.