Testing post commit hook
[dotfiles] / .bashrc
1 #!/bin/sh
2
3 # python setup.py --command-packages=stdeb.command sdist_dsc
4
5 # TODO: automatically set the dns server on boot
6 # dns servers 80.67.169.12 || 2001:910:800::12
7
8 # unicode characters https://en.wikipedia.org/wiki/List_of_Unicode_characters
9
10 # remember to copy interesting bash customizations,
11 # under /etc/profile.d/my_customizations.sh
12 # and set the permissions of this file to 644
13 # all users will benefit
14
15 # ~/.bashrc: executed by bash(1) for non-login shells.
16 # see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
17 # for examples
18
19 # vcprompt & other things
20 export PATH=$PATH:$HOME/bin
21
22 # nim lang
23 export PATH=$PATH:$HOME/bin/nim-0.10.2/bin
24
25 # If not running interactively, don't do anything
26 case $- in
27 *i*) ;;
28 *) return;;
29 esac
30
31
32 # make less more friendly for non-text input files, see lesspipe(1)
33 #[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
34
35 # set variable identifying the chroot you work in (used in the prompt below)
36 if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then
37 debian_chroot=$(cat /etc/debian_chroot)
38 fi
39
40 # set a fancy prompt (non-color, unless we know we "want" color)
41 case "$TERM" in
42 xterm-color) color_prompt=yes;;
43 esac
44
45 # uncomment for a colored prompt, if the terminal has the capability; turned
46 # off by default to not distract the user: the focus in a terminal window
47 # should be on the output of commands, not on the prompt
48 force_color_prompt=yes
49
50 if [ -n "$force_color_prompt" ]; then
51 if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
52 # We have color support; assume it's compliant with Ecma-48
53 # (ISO/IEC-6429). (Lack of such support is extremely rare, and such
54 # a case would tend to support setf rather than setaf.)
55 color_prompt=yes
56 else
57 color_prompt=
58 fi
59 fi
60
61 # export command for coloring
62 # '\e[x;ym $PS1 \e[m' or [\033[x;ym\] $PS1 [\033[00m\] x;y being the color pair to use
63
64 if [ "$color_prompt" = yes ]; then
65 #PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\] $(__git_ps1 "[%s]") \$ '
66 #PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\] $(vcprompt -f %b%a%m%u) > '
67 if [ $USER='nsukami' ]; then
68 #PS1='${debian_chroot:+($debian_chroot)}5@\[\033[31m\]\h\[\033[00m\]:\w \[\033[1;33m\]$(vcprompt -f %b%a%m%u)\[\033[0m\] > '
69 #PS1='${debian_chroot:+($debian_chroot)}5@\[\033[31m\]k\[\033[00m\]:\w \[\033[1;33m\]$(vcprompt -f %b%a%m%u)\[\033[0m\] \n > '
70 #PS1='${debian_chroot:+($debian_chroot)}\[\033[31m\]\[\033[00m\]:\w \[\033[1;33m\]$(vcprompt -f %b%a%m%u)\[\033[0m\] \n '
71 #PS1=$'\u03c6 \w \[\033[1;33m\]$(vcprompt -f %b%a%m%u)\[\033[0m\] \n '
72 PS1=$'\w \[\033[1;33m\]$(vcprompt -f %b%a%m%u)\[\033[0m\] \n\u21D2 '
73 else
74 PS1='${debian_chroot:+($debian_chroot)}\u@\[\033[31m\]\h\[\033[00m\]:\w \[\033[1;33m\]$(vcprompt -f %b%a%m%u)\[\033[0m\] \n > '
75 fi
76 else
77 #PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w $(__git_ps1 "[%s]") \$ '
78 if [ $USER='nsukami']; then
79 #PS1='${debian_chroot:+($debian_chroot)}5@\[\033[31m\]\h\[\033[00m\]:\w $(vcprompt -f %b%a%m%u) > '
80 PS1='${debian_chroot:+($debian_chroot)}5@\[\033[31m\]k\[\033[00m\]:\w $(vcprompt -f %b%a%m%u) \n > '
81 else
82 PS1='${debian_chroot:+($debian_chroot)}\u@\[\033[31m\]\h\[\033[00m\]:\w $(vcprompt -f %b%a%m%u) \n > '
83 fi
84
85 fi
86 unset color_prompt force_color_prompt
87
88 # If this is an xterm set the title to user@host:dir
89 case "$TERM" in
90 xterm*|rxvt*)
91 PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w $(vcprompt -f %b%a%m%u) \a\]$PS1"
92 ;;
93 *)
94 ;;
95 esac
96
97 # enable color support of ls
98 if [ -x /usr/bin/dircolors ]; then
99 test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
100 alias ls='ls --color=auto'
101 fi
102
103
104
105 # enable programmable completion features (you don't need to enable
106 # this, if it's already enabled in /etc/bash.bashrc and /etc/profile
107 # sources /etc/bash.bashrc).
108 if ! shopt -oq posix; then
109 if [ -f /usr/share/bash-completion/bash_completion ]; then
110 . /usr/share/bash-completion/bash_completion
111 elif [ -f /etc/bash_completion ]; then
112 . /etc/bash_completion
113 fi
114 fi
115
116 # start gpg agent
117 # be sure to have done apt install gpg-agent pinentry-curses first
118 eval `gpg-agent --daemon`
119
120 # Alias definitions.
121 # You may want to put all your additions into a separate file like
122 # ~/.bash_aliases, instead of adding them here directly.
123 # See /usr/share/doc/bash-doc/examples in the bash-doc package.
124 [[ -f ~/.bash_aliases ]] && . ~/.bash_aliases
125
126 # git completion
127 [[ -f ~/.git_completion ]] && . ~/.git_completion
128
129 # personal customization
130 [[ -f ~/.bash_customization ]] && . ~/.bash_customization
131
132 # personal functions
133 [[ -f ~/.bash_function ]] && . ~/.bash_function
134
135 # personal export
136 [[ -f ~/.bash_export ]] && . ~/.bash_export
137
138 # personal color
139 [[ -f ~/.bash_color ]] && . ~/.bash_color
140
141 # personal shopt
142 [[ -f ~/.bash_shopt ]] && . ~/.bash_shopt
143
144 # git completion
145 [[ -f ~/.git_completion ]] && . ~/.git_completion
146
147 # is or is not
148 [[ -f ~/.bash_is ]] && . ~/.bash_is
149
150 # jump to directories
151 [[ -f ~/.bash_marks ]] && . ~/.bash_marks
152
153 # tmux completion script
154 [[ -f ~/.bash_tmux ]] && . ~/.bash_tmux
155
156 # jump completion script
157 [[ -f ~/.bash_compl ]] && . ~/.bash_compl
158
159 # jump completion script
160 [[ -f ~/.bash_base64 ]] && . ~/.bash_base64
161
162 # emacs launcher script
163 [[ -f ~/.bash_emacs ]] && . ~/.bash_emacs
164
165 # memo
166 [[ -f ~/.bash_memo ]] && . ~/.bash_memo
167
168 # custom bindings
169 [[ -f ~/.bash_bind ]] && . ~/.bash_bind
170
171 # custom filters
172 [[ -f ~/.bash_filters ]] && . ~/.bash_filters
173
174 # if autoenv is present
175 # usage:
176 # $ touch project/.env
177 # $ echo "echo 'woah'" > project/.env
178 # $ cd project
179 # woah
180 [[ -f ~/.autoenv/activate.sh ]] && . ~/.autoenv/activate.sh
181
182 # print available tmux sessions if available
183 tmux list-sessions 2> /dev/null
184
185 # always put prompt at bottom
186 # PS1="\[$(tput cup "$LINES")\]"$PS1
187
188
189 # if [ -z "$VIRTUAL_ENV" ]; then
190 # PS1="$VIRTUAL_ENV"'\[\e[$LINES;1H\]'$PS1
191 # else
192 # PS1='\[\e[$LINES;1H\]'$PS1
193 # fi