Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 128 lines (100 sloc) 3.885 kb
302f9b3 The great reorganizing
Tyler Ball authored
1 # == [ .bashrc ] ================================================
2 #
3 # Mostly bash preferences
4 #
5 # ===============================================================
b2de74a Initial commit
Tyler Ball authored
6
486c8e9 editor to vim
Tyler Ball authored
7 export EDITOR=vim
8
302f9b3 The great reorganizing
Tyler Ball authored
9 # Bash History
10 # ------------
b2de74a Initial commit
Tyler Ball authored
11
302f9b3 The great reorganizing
Tyler Ball authored
12 # don't put duplicate lines in the history. See bash(1) for more options
13 # ... or force ignoredups and ignorespace
14 HISTCONTROL=ignoredups:ignorespace
b2de74a Initial commit
Tyler Ball authored
15
302f9b3 The great reorganizing
Tyler Ball authored
16 # append to the history file, don't overwrite it
17 shopt -s histappend
282b565 support for advanced blobs
Tyler Ball authored
18
302f9b3 The great reorganizing
Tyler Ball authored
19 # allow for advanced globbing
20 shopt -s extglob
b2de74a Initial commit
Tyler Ball authored
21
302f9b3 The great reorganizing
Tyler Ball authored
22 # for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
23 HISTSIZE=1000
24 HISTFILESIZE=2000
b2de74a Initial commit
Tyler Ball authored
25
302f9b3 The great reorganizing
Tyler Ball authored
26 # UI
27 # --
b2de74a Initial commit
Tyler Ball authored
28
2a1952b vi key bindings
Tyler Ball authored
29 # Use vi key bindings
30 set -o vi
31
302f9b3 The great reorganizing
Tyler Ball authored
32 # check the window size after each command and, if necessary,
33 # update the values of LINES and COLUMNS.
34 shopt -s checkwinsize
b2de74a Initial commit
Tyler Ball authored
35
302f9b3 The great reorganizing
Tyler Ball authored
36 # make less more friendly for non-text input files, see lesspipe(1)
37 [ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
4b35975 OS X colours
Tyler Ball authored
38
302f9b3 The great reorganizing
Tyler Ball authored
39 # set variable identifying the chroot you work in (used in the prompt below)
40 if [ -z "$debian_chroot" ] && [ -r /etc/debian_chroot ]; then
41 debian_chroot=$(cat /etc/debian_chroot)
42 fi
43
44 # Colours and Command line
45 # ------------------------
46
04b1d95 the pretty colourssss
Tyler Ball authored
47 function fgcolor {
48 echo "\\[\\033[38;5;"$1"m\\]"
49 }
50
51 function boldtext {
52 echo "\\[\\033[1m\\]"$1"\\[\\033[0m\\]"
53 }
54 function resetcolor {
55 echo "\\[\\e[0m\\]"
56 }
57
302f9b3 The great reorganizing
Tyler Ball authored
58 #colour in OS X
04b1d95 the pretty colourssss
Tyler Ball authored
59 export CLICOLOR=2
302f9b3 The great reorganizing
Tyler Ball authored
60 export LSCOLORS="ExGxBxDxCxEgEdxbxgxcxd"
61
62 # set a fancy prompt (non-color, unless we know we "want" color)
63 case "$TERM" in
64 xterm-color) color_prompt=yes;;
65 esac
66
67 # uncomment for a colored prompt, if the terminal has the capability; turned
68 # off by default to not distract the user: the focus in a terminal window
69 # should be on the output of commands, not on the prompt
70 force_color_prompt=yes
71
72 if [ -n "$force_color_prompt" ]; then
73 if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
74 # We have color support; assume it's compliant with Ecma-48
75 # (ISO/IEC-6429). (Lack of such support is extremely rare, and such
76 # a case would tend to support setf rather than setaf.)
77 color_prompt=yes
78 else
79 color_prompt=
80 fi
81 fi
82
83 # Setup colours with git branch
84 if [ "$color_prompt" = yes ]; then
04b1d95 the pretty colourssss
Tyler Ball authored
85 #PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]$(__git_ps1 ":\[\033[01;32m\](%s)")\[\033[00m\]$ '
06c9bac colours
Tyler Ball authored
86 PS1="${debian_chroot:+($debian_chroot)}$(fgcolor 172)\h$(resetcolor) $(boldtext :) $(fgcolor 111)\w$(fgcolor 7)\$(__git_ps1 '$(resetcolor) $(boldtext :) $(fgcolor 154)(%s)')$(fgcolor 7) $ "
302f9b3 The great reorganizing
Tyler Ball authored
87 else
88 PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
89 fi
90 unset color_prompt force_color_prompt
91
92 # If this is an xterm set the title to user@host:dir
93 case "$TERM" in
94 xterm*|rxvt*)
95 PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
96 ;;
97 *)
98 ;;
99 esac
100
101 # enable color support of ls and also add handy aliases
102 if [ -x /usr/bin/dircolors ]; then
103 test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
104 fi
105
106 # Django highlighting
107 export DJANGO_COLORS="light"
b2de74a Initial commit
Tyler Ball authored
108
302f9b3 The great reorganizing
Tyler Ball authored
109 # Aliases and completion
110 # ----------------------
111
112 # Import aliases
113 if [ -f ~/.bash_aliases ]; then
114 . ~/.bash_aliases
115 fi
b2de74a Initial commit
Tyler Ball authored
116
302f9b3 The great reorganizing
Tyler Ball authored
117 # Enable bash and git completion
118 if [[ "$(uname)" = "Darwin" ]]; then
119 . `brew --prefix`/etc/bash_completion && . `brew --prefix`/etc/bash_completion.d/git-completion.bash
b2de74a Initial commit
Tyler Ball authored
120 else
302f9b3 The great reorganizing
Tyler Ball authored
121 . /etc/bash_completion
122 source /etc/bash_completion.d/git
b2de74a Initial commit
Tyler Ball authored
123 fi
8138ff0 rvm
Tyler Ball authored
124
125 PATH=$PATH:$HOME/.rvm/bin # Add RVM to PATH for scripting
788e7f5 trying out this scm_breeze thing
Tyler Ball authored
126
127 [ -s "$HOME/.scm_breeze/scm_breeze.sh" ] && source "$HOME/.scm_breeze/scm_breeze.sh"
Something went wrong with that request. Please try again.