1 # Configuration file for environment related options for all shells.
3 # Copyright (C) 2011-2013 Simon Ruderich
5 # This file is free software: you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation, either version 3 of the License, or
8 # (at your option) any later version.
10 # This file is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this file. If not, see <http://www.gnu.org/licenses/>.
19 source_debug ". ~/.shell/env"
22 # Use UTF-8 encoding in the terminal. Don't use LC_ALL as it's used for
23 # debugging purposes. Thanks to twb in #screen on Freenode (2009-10-02 10:25
27 # Use C locale when sorting.
31 # Just in case a nice administrator tries to force LC_ALL on us ...
34 # Make sure $LANGUAGE is not set. It's a GNU extension which can overwrite
35 # variables like $LANG or $LC_ALL.
38 # Add ~/bin and ~/.bin and ~/.shell/bin to PATH if available.
39 if test -d "$HOME/.shell/bin"; then
40 PATH="$HOME/.shell/bin:$PATH"
42 if test -d "$HOME/bin"; then
43 PATH="$HOME/bin:$PATH"
45 if test -d "$HOME/.bin"; then
46 PATH="$HOME/.bin:$PATH"
53 # Set less as pager, its configuration is done through the ~/.less file.
57 escape=`printf '\033'`
58 # Color man pages viewed with less, thanks to [1].
60 # [1]: http://nion.modprobe.de/blog/archives/572-less-colors-for-man-pages.html
62 # Color bold strings in bold blue.
63 LESS_TERMCAP_md="${escape}[01;34m"
64 LESS_TERMCAP_me="${escape}[0m"
65 export LESS_TERMCAP_md LESS_TERMCAP_me
66 # Color underlined strings in bold yellow and underlined.
67 LESS_TERMCAP_us="${escape}[01;4;33m"
68 LESS_TERMCAP_ue="${escape}[0m"
69 export LESS_TERMCAP_us LESS_TERMCAP_ue
70 # Color standout mode in bold black with yellow background.
71 LESS_TERMCAP_so="${escape}[01;30;43m"
72 LESS_TERMCAP_se="${escape}[0m"
73 export LESS_TERMCAP_so LESS_TERMCAP_se
75 # Use ~/.tmp as directory for temporary files if available to reduce security
76 # problems on multi-user systems.
77 if test -O "$HOME/.tmp" && test -d "$HOME/.tmp"; then
81 export TMP TEMP TMPDIR
82 # Also try ~/tmp as fallback.
83 elif test -O "$HOME/tmp" && test -d "$HOME/tmp"; then
87 export TMP TEMP TMPDIR
90 # Change rlwrap's home directory to prevent cluttering ~/.
91 RLWRAP_HOME="$HOME/.shell/rlwrap"
94 # Set colors for GNU ls (and Zsh completions).
95 if test -f "$HOME/.shell/dircolors"; then
96 . "$HOME/.shell/dircolors"
98 # Set the same colors for non GNU ls, except for special cases which aren't
100 LSCOLORS='ExgxxxxxBxxxxxBdBdExEb'
101 # ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^
102 # | | | | | | | | | | |
103 # | | | | | | | | | | *- directory writable to others, without sticky bit
104 # | | | | | | | | | *--- directory writable to others, with sticky bit
105 # | | | | | | | | *----- executable with setgid bit set
106 # | | | | | | | *------- executable with setuid bit set
107 # | | | | | | *--------- character special
108 # | | | | | *----------- block special
109 # | | | | *------------- executable
110 # | | | *--------------- pipe
111 # | | *----------------- socket
112 # | *------------------- symbolic link
113 # *--------------------- directory
117 source_debug ". ~/.shell/env (done)"