Blame


1 b62145bf 2013-11-28 schmidt.m # ~/.bashrc: executed by bash(1) for non-login shells.
2 b62145bf 2013-11-28 schmidt.m # see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
3 b62145bf 2013-11-28 schmidt.m # for examples
4 b62145bf 2013-11-28 schmidt.m
5 b62145bf 2013-11-28 schmidt.m # If not running interactively, don't do anything
6 b62145bf 2013-11-28 schmidt.m case $- in
7 b62145bf 2013-11-28 schmidt.m *i*) ;;
8 b62145bf 2013-11-28 schmidt.m *) return;;
9 b62145bf 2013-11-28 schmidt.m esac
10 b62145bf 2013-11-28 schmidt.m
11 b62145bf 2013-11-28 schmidt.m # don't put duplicate lines or lines starting with space in the history.
12 b62145bf 2013-11-28 schmidt.m # See bash(1) for more options
13 b62145bf 2013-11-28 schmidt.m HISTCONTROL=ignoreboth
14 b62145bf 2013-11-28 schmidt.m
15 b62145bf 2013-11-28 schmidt.m # append to the history file, don't overwrite it
16 b62145bf 2013-11-28 schmidt.m shopt -s histappend
17 b62145bf 2013-11-28 schmidt.m
18 b62145bf 2013-11-28 schmidt.m # for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
19 f8f36a6d 2017-01-16 matthias. HISTSIZE=3000
20 b62145bf 2013-11-28 schmidt.m HISTFILESIZE=8000
21 b62145bf 2013-11-28 schmidt.m
22 b62145bf 2013-11-28 schmidt.m # check the window size after each command and, if necessary,
23 b62145bf 2013-11-28 schmidt.m # update the values of LINES and COLUMNS.
24 b62145bf 2013-11-28 schmidt.m shopt -s checkwinsize
25 b62145bf 2013-11-28 schmidt.m
26 b62145bf 2013-11-28 schmidt.m # If set, the pattern "**" used in a pathname expansion context will
27 b62145bf 2013-11-28 schmidt.m # match all files and zero or more directories and subdirectories.
28 b62145bf 2013-11-28 schmidt.m #shopt -s globstar
29 b62145bf 2013-11-28 schmidt.m
30 b62145bf 2013-11-28 schmidt.m case "$TERM" in
31 b62145bf 2013-11-28 schmidt.m xterm)
32 b62145bf 2013-11-28 schmidt.m # Try to ensure we have 256 colors
33 b62145bf 2013-11-28 schmidt.m export TERM="xterm-256color"
34 b62145bf 2013-11-28 schmidt.m ;;
35 b62145bf 2013-11-28 schmidt.m esac
36 b62145bf 2013-11-28 schmidt.m
37 066c060c 2014-06-01 xhr # Set visual bell
38 066c060c 2014-06-01 xhr set bell-style visible
39 066c060c 2014-06-01 xhr
40 b4c7075a 2016-01-07 xhr # Set selection for pass password-manager
41 b4c7075a 2016-01-07 xhr PASSWORD_STORE_X_SELECTION=primary
42 b4c7075a 2016-01-07 xhr
43 b62145bf 2013-11-28 schmidt.m ##############################################################################
44 b62145bf 2013-11-28 schmidt.m # Color
45 b62145bf 2013-11-28 schmidt.m ##############################################################################
46 b62145bf 2013-11-28 schmidt.m
47 b62145bf 2013-11-28 schmidt.m # byobu's bashrc -- colorize the prompt
48 b62145bf 2013-11-28 schmidt.m # Copyright (C) 2013 Dustin Kirkland
49 b62145bf 2013-11-28 schmidt.m #
50 b62145bf 2013-11-28 schmidt.m # Authors: Dustin Kirkland <kirkland@byobu.co>
51 b62145bf 2013-11-28 schmidt.m #
52 b62145bf 2013-11-28 schmidt.m # This program is free software: you can redistribute it and/or modify
53 b62145bf 2013-11-28 schmidt.m # it under the terms of the GNU General Public License as published by
54 b62145bf 2013-11-28 schmidt.m # the Free Software Foundation, version 3 of the License.
55 b62145bf 2013-11-28 schmidt.m # Ensure that we're in bash, in a byobu environment
56 b62145bf 2013-11-28 schmidt.m # Use Ubuntu colors (grey / aubergine / orange)
57 b62145bf 2013-11-28 schmidt.m
58 1314ba3e 2014-01-18 xhr if [ -z "$SSH_CLIENT" ]; then
59 8ce5b956 2016-10-24 xhr PS1_TRENNER="!"
60 1314ba3e 2014-01-18 xhr else
61 8ce5b956 2016-10-24 xhr PS1_TRENNER="@"
62 1314ba3e 2014-01-18 xhr fi
63 3091b421 2015-01-09 xhr txtrst='\e[0m' # Text Reset
64 1314ba3e 2014-01-18 xhr
65 b62145bf 2013-11-28 schmidt.m if [ `id -u` -eq 0 ]; then
66 8ce5b956 2016-10-24 xhr PS1_USER="\[\e[0;101m\]\u\[${txtrst}\]"
67 b62145bf 2013-11-28 schmidt.m else
68 8ce5b956 2016-10-24 xhr PS1_USER="\[\e[38;5;245m\]\u\[${txtrst}\]"
69 3091b421 2015-01-09 xhr
70 b62145bf 2013-11-28 schmidt.m fi
71 b62145bf 2013-11-28 schmidt.m
72 83950ddd 2017-07-11 xhr PS1="\[\e[38;5;202m\]\[\e[38;5;5m\]\h\[${txtrst}\]${PS1_TRENNER}"
73 8ce5b956 2016-10-24 xhr PS1+="${PS1_USER}"
74 8ce5b956 2016-10-24 xhr PS1+="${PS1_VCS}"
75 83950ddd 2017-07-11 xhr PS1+=" \[\e[38;5;172m\]\w\[${txtrst}\] [\j] \$ "
76 8ce5b956 2016-10-24 xhr
77 b62145bf 2013-11-28 schmidt.m export GREP_COLORS="ms=01;38;5;202:mc=01;31:sl=:cx=:fn=01;38;5;132:ln=32:bn=32:se=00;38;5;242"
78 b62145bf 2013-11-28 schmidt.m
79 8bce8623 2014-06-24 xhr # UBUNTU COLORS
80 8bce8623 2014-06-24 xhr #export LESS_TERMCAP_mb=$(printf '\e[01;31m') # enter blinking mode – red
81 8bce8623 2014-06-24 xhr #export LESS_TERMCAP_md=$(printf '\e[01;38;5;180m') # enter double-bright mode – bold light orange
82 8bce8623 2014-06-24 xhr #export LESS_TERMCAP_me=$(printf '\e[0m') # turn off all appearance modes (mb, md, so, us)
83 8bce8623 2014-06-24 xhr #export LESS_TERMCAP_se=$(printf '\e[0m') # leave standout mode
84 8bce8623 2014-06-24 xhr #export LESS_TERMCAP_so=$(printf '\e[03;38;5;202m') # enter standout mode – orange background highlight (or italics)
85 8bce8623 2014-06-24 xhr #export LESS_TERMCAP_ue=$(printf '\e[0m') # leave underline mode
86 8bce8623 2014-06-24 xhr #export LESS_TERMCAP_us=$(printf '\e[04;38;5;139m') # enter underline mode – underline aubergine
87 8bce8623 2014-06-24 xhr
88 8bce8623 2014-06-24 xhr # Less Colors for Man Pages
89 8bce8623 2014-06-24 xhr export LESS_TERMCAP_mb=$'\E[01;31m' # begin blinking
90 8bce8623 2014-06-24 xhr export LESS_TERMCAP_md=$'\E[01;38;5;74m' # begin bold
91 8bce8623 2014-06-24 xhr export LESS_TERMCAP_me=$'\E[0m' # end mode
92 8bce8623 2014-06-24 xhr export LESS_TERMCAP_se=$'\E[0m' # end standout-mode
93 8bce8623 2014-06-24 xhr export LESS_TERMCAP_so=$'\E[38;5;246m' # begin standout-mode - info box
94 8bce8623 2014-06-24 xhr export LESS_TERMCAP_ue=$'\E[0m' # end underline
95 8bce8623 2014-06-24 xhr export LESS_TERMCAP_us=$'\E[04;38;5;146m' # begin underline
96 8bce8623 2014-06-24 xhr
97 b62145bf 2013-11-28 schmidt.m # If this is an xterm set the title to user@host:dir
98 b62145bf 2013-11-28 schmidt.m case "$TERM" in
99 b62145bf 2013-11-28 schmidt.m xterm*|rxvt*)
100 3091b421 2015-01-09 xhr PS1="\[\e]0;\h!\u: \w\a\]$PS1"
101 b62145bf 2013-11-28 schmidt.m ;;
102 b62145bf 2013-11-28 schmidt.m *)
103 b62145bf 2013-11-28 schmidt.m ;;
104 b62145bf 2013-11-28 schmidt.m esac
105 b62145bf 2013-11-28 schmidt.m
106 b62145bf 2013-11-28 schmidt.m # enable color support of ls and also add handy aliases
107 b62145bf 2013-11-28 schmidt.m if [ -x /usr/bin/dircolors ]; then
108 b62145bf 2013-11-28 schmidt.m test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
109 b62145bf 2013-11-28 schmidt.m alias grep='grep --color=auto'
110 b62145bf 2013-11-28 schmidt.m alias fgrep='fgrep --color=auto'
111 b62145bf 2013-11-28 schmidt.m alias egrep='egrep --color=auto'
112 b62145bf 2013-11-28 schmidt.m fi
113 b62145bf 2013-11-28 schmidt.m
114 b62145bf 2013-11-28 schmidt.m ##############################################################################
115 b62145bf 2013-11-28 schmidt.m # Exports
116 b62145bf 2013-11-28 schmidt.m ##############################################################################
117 b62145bf 2013-11-28 schmidt.m
118 b62145bf 2013-11-28 schmidt.m export EDITOR=vim
119 17bc0af8 2014-06-08 xhr export PATH=$HOME/Documents/bin:$PATH
120 b62145bf 2013-11-28 schmidt.m
121 d22b0766 2014-11-08 xhr export XDG_CONFIG_HOME="$HOME/.config"
122 d22b0766 2014-11-08 xhr export XDG_DATA_HOME="$HOME/.local/share"
123 d22b0766 2014-11-08 xhr export XDG_CACHE_HOME="$HOME/.cache"
124 d22b0766 2014-11-08 xhr
125 b62145bf 2013-11-28 schmidt.m ##############################################################################
126 b62145bf 2013-11-28 schmidt.m # Aliases
127 b62145bf 2013-11-28 schmidt.m ##############################################################################
128 b62145bf 2013-11-28 schmidt.m
129 b62145bf 2013-11-28 schmidt.m if [ -f ~/.aliasrc ]; then
130 b62145bf 2013-11-28 schmidt.m . ~/.aliasrc
131 b62145bf 2013-11-28 schmidt.m fi
132 b62145bf 2013-11-28 schmidt.m
133 bc48c913 2013-11-29 schmidt.m if [ -f ~/.aliasrc.private ]; then
134 bc48c913 2013-11-29 schmidt.m . ~/.aliasrc.private
135 bc48c913 2013-11-29 schmidt.m fi
136 bc48c913 2013-11-29 schmidt.m
137 a4fca2f0 2013-11-29 schmidt.m if [ -f ~/.aliasrc.work ]; then
138 a4fca2f0 2013-11-29 schmidt.m . ~/.aliasrc.work
139 a4fca2f0 2013-11-29 schmidt.m fi
140 a4fca2f0 2013-11-29 schmidt.m
141 b62145bf 2013-11-28 schmidt.m ##############################################################################
142 b62145bf 2013-11-28 schmidt.m
143 b62145bf 2013-11-28 schmidt.m # enable programmable completion features (you don't need to enable
144 b62145bf 2013-11-28 schmidt.m # this, if it's already enabled in /etc/bash.bashrc and /etc/profile
145 b62145bf 2013-11-28 schmidt.m # sources /etc/bash.bashrc).
146 b62145bf 2013-11-28 schmidt.m if ! shopt -oq posix; then
147 b62145bf 2013-11-28 schmidt.m if [ -f /usr/share/bash-completion/bash_completion ]; then
148 b62145bf 2013-11-28 schmidt.m . /usr/share/bash-completion/bash_completion
149 b62145bf 2013-11-28 schmidt.m elif [ -f /etc/bash_completion ]; then
150 b62145bf 2013-11-28 schmidt.m . /etc/bash_completion
151 b62145bf 2013-11-28 schmidt.m fi
152 b62145bf 2013-11-28 schmidt.m fi
153 b62145bf 2013-11-28 schmidt.m
154 9571b779 2015-06-23 xhr # Git completion
155 9571b779 2015-06-23 xhr if [ -f /usr/share/git/completion/git-prompt.sh ]; then
156 9571b779 2015-06-23 xhr source /usr/share/git/completion/git-prompt.sh
157 9571b779 2015-06-23 xhr fi
158 9571b779 2015-06-23 xhr
159 b62145bf 2013-11-28 schmidt.m # Compression
160 b62145bf 2013-11-28 schmidt.m complete -f -o default -X '*.+(zip|ZIP)' zip
161 b62145bf 2013-11-28 schmidt.m complete -f -o default -X '!*.+(zip|ZIP)' unzip
162 b62145bf 2013-11-28 schmidt.m complete -f -o default -X '*.+(z|Z)' compress
163 b62145bf 2013-11-28 schmidt.m complete -f -o default -X '!*.+(z|Z)' uncompress
164 b62145bf 2013-11-28 schmidt.m complete -f -o default -X '*.+(gz|GZ)' gzip
165 b62145bf 2013-11-28 schmidt.m complete -f -o default -X '!*.+(gz|GZ)' gunzip
166 b62145bf 2013-11-28 schmidt.m complete -f -o default -X '*.+(bz2|BZ2)' bzip2
167 b62145bf 2013-11-28 schmidt.m complete -f -o default -X '!*.+(bz2|BZ2)' bunzip2
168 b62145bf 2013-11-28 schmidt.m complete -f -o default -X '!*.+(zip|ZIP|z|Z|gz|GZ|bz2|BZ2)' extract
169 2cfdd087 2014-06-08 xhr
170 69c8b2d0 2014-10-31 xhr _completemarks() {
171 69c8b2d0 2014-10-31 xhr local curw=${COMP_WORDS[COMP_CWORD]}
172 69c8b2d0 2014-10-31 xhr local wordlist=$(find $MARKPATH -type l -printf "%f\n")
173 69c8b2d0 2014-10-31 xhr COMPREPLY=($(compgen -W '${wordlist[@]}' -- "$curw"))
174 69c8b2d0 2014-10-31 xhr return 0
175 69c8b2d0 2014-10-31 xhr }
176 69c8b2d0 2014-10-31 xhr
177 69c8b2d0 2014-10-31 xhr complete -F _completemarks jump unmark j
178 69c8b2d0 2014-10-31 xhr
179 3ec48ec4 2014-11-01 xhr [ -f /usr/share/git/completion/git-completion.bash ] && source /usr/share/git/completion/git-completion.bash
180 3ec48ec4 2014-11-01 xhr
181 95f81fe5 2014-06-24 xhr ##############################################################################
182 ced2f335 2014-10-31 xhr # Functions
183 ced2f335 2014-10-31 xhr ##############################################################################
184 ced2f335 2014-10-31 xhr
185 ced2f335 2014-10-31 xhr source $HOME/.functions
186 ced2f335 2014-10-31 xhr
187 ced2f335 2014-10-31 xhr ##############################################################################
188 95f81fe5 2014-06-24 xhr # SSH/GPG Agent stuff
189 95f81fe5 2014-06-24 xhr ##############################################################################
190 95f81fe5 2014-06-24 xhr
191 2cfdd087 2014-06-08 xhr # Suck in GPG agent vars
192 95f81fe5 2014-06-24 xhr if [ -e "$HOME"/.gpgssh.env ]; then
193 95f81fe5 2014-06-24 xhr source ~/.gpgssh.env
194 95f81fe5 2014-06-24 xhr fi
195 d0435f38 2014-06-24 xhr
196 d0435f38 2014-06-24 xhr alias sshclose='pkill -u $USER ssh-agent && echo "SSH-Agents killed."; rm -f "$HOME"/.ssh/`hostname`.agent'
197 d0435f38 2014-06-24 xhr
198 d0435f38 2014-06-24 xhr if [ -e "$HOME"/.ssh/`hostname`.agent ]; then
199 d0435f38 2014-06-24 xhr source "$HOME"/.ssh/`hostname`.agent ;
200 d0435f38 2014-06-24 xhr fi