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