Added some utilities:
[dotfiles] / .bashrc
1 #!/bin/sh
2
3 # ~/.bashrc: executed by bash(1) for non-login shells.
4 # see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
5 # for examples
6
7 export PATH=$PATH:/home/nsukami/bin
8
9 # If not running interactively, don't do anything
10 case $- in
11 *i*) ;;
12 *) return;;
13 esac
14
15
16 # make less more friendly for non-text input files, see lesspipe(1)
17 #[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
18
19 # set variable identifying the chroot you work in (used in the prompt below)
20 if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then
21 debian_chroot=$(cat /etc/debian_chroot)
22 fi
23
24 # set a fancy prompt (non-color, unless we know we "want" color)
25 case "$TERM" in
26 xterm-color) color_prompt=yes;;
27 esac
28
29 # uncomment for a colored prompt, if the terminal has the capability; turned
30 # off by default to not distract the user: the focus in a terminal window
31 # should be on the output of commands, not on the prompt
32 force_color_prompt=yes
33
34 if [ -n "$force_color_prompt" ]; then
35 if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
36 # We have color support; assume it's compliant with Ecma-48
37 # (ISO/IEC-6429). (Lack of such support is extremely rare, and such
38 # a case would tend to support setf rather than setaf.)
39 color_prompt=yes
40 else
41 color_prompt=
42 fi
43 fi
44
45 # export command for coloring
46 # '\e[x;ym $PS1 \e[m' or [\033[x;ym\] $PS1 [\033[00m\] x;y being the color pair to use
47
48 if [ "$color_prompt" = yes ]; then
49 #PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\] $(__git_ps1 "[%s]") \$ '
50 #PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\] $(vcprompt -f %b%a%m%u) > '
51 if [ $USER='nsukami' ]; then
52 #PS1='${debian_chroot:+($debian_chroot)}5@\[\033[31m\]\h\[\033[00m\]:\w \[\033[1;33m\]$(vcprompt -f %b%a%m%u)\[\033[0m\] > '
53 PS1='${debian_chroot:+($debian_chroot)}5@\[\033[31m\]k\[\033[00m\]:\w \[\033[1;33m\]$(vcprompt -f %b%a%m%u)\[\033[0m\] > '
54 else
55 PS1='${debian_chroot:+($debian_chroot)}\u@\[\033[31m\]\h\[\033[00m\]:\w \[\033[1;33m\]$(vcprompt -f %b%a%m%u)\[\033[0m\] > '
56 fi
57 else
58 #PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w $(__git_ps1 "[%s]") \$ '
59 if [ $USER='nsukami']; then
60 #PS1='${debian_chroot:+($debian_chroot)}5@\[\033[31m\]\h\[\033[00m\]:\w $(vcprompt -f %b%a%m%u) > '
61 PS1='${debian_chroot:+($debian_chroot)}5@\[\033[31m\]k\[\033[00m\]:\w $(vcprompt -f %b%a%m%u) > '
62 else
63 PS1='${debian_chroot:+($debian_chroot)}\u@\[\033[31m\]\h\[\033[00m\]:\w $(vcprompt -f %b%a%m%u) > '
64 fi
65
66 fi
67 unset color_prompt force_color_prompt
68
69 # If this is an xterm set the title to user@host:dir
70 case "$TERM" in
71 xterm*|rxvt*)
72 PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w $(vcprompt -f %b%a%m%u) \a\]$PS1"
73 ;;
74 *)
75 ;;
76 esac
77
78 # enable color support of ls
79 if [ -x /usr/bin/dircolors ]; then
80 test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
81 alias ls='ls --color=auto'
82 fi
83
84
85
86 # enable programmable completion features (you don't need to enable
87 # this, if it's already enabled in /etc/bash.bashrc and /etc/profile
88 # sources /etc/bash.bashrc).
89 if ! shopt -oq posix; then
90 if [ -f /usr/share/bash-completion/bash_completion ]; then
91 . /usr/share/bash-completion/bash_completion
92 elif [ -f /etc/bash_completion ]; then
93 . /etc/bash_completion
94 fi
95 fi
96
97
98 # Alias definitions.
99 # You may want to put all your additions into a separate file like
100 # ~/.bash_aliases, instead of adding them here directly.
101 # See /usr/share/doc/bash-doc/examples in the bash-doc package.
102 [[ -f ~/.bash_aliases ]] && . ~/.bash_aliases
103
104 # git completion
105 [[ -f ~/.git_completion ]] && . ~/.git_completion
106
107 # personal customization
108 [[ -f ~/.bash_customization ]] && . ~/.bash_customization
109
110 # personal functions
111 [[ -f ~/.bash_function ]] && . ~/.bash_function
112
113 # personal export
114 [[ -f ~/.bash_export ]] && . ~/.bash_export
115
116 # personal color
117 [[ -f ~/.bash_color ]] && . ~/.bash_color
118
119 # personal shopt
120 [[ -f ~/.bash_shopt ]] && . ~/.bash_shopt
121
122 # git completion
123 [[ -f ~/.git_completion ]] && . ~/.git_completion
124
125 # is or is not
126 [[ -f ~/.bash_is ]] && . ~/.bash_is
127
128 # jump to directories
129 [[ -f ~/.bash_marks ]] && . ~/.bash_marks
130
131 # tmux completion script
132 [[ -f ~/.bash_tmux ]] && . ~/.bash_tmux
133
134 # jump completion script
135 [[ -f ~/.bash_compl ]] && . ~/.bash_compl
136
137 # jump completion script
138 [[ -f ~/.bash_base64 ]] && . ~/.bash_base64
139
140 # emacs launcher script
141 [[ -f ~/.bash_emacs ]] && . ~/.bash_emacs