]> ruderich.org/simon Gitweb - config/dotfiles.git/blob - shell/env
shell/env: unset LC_ALL
[config/dotfiles.git] / shell / env
1 # Configuration file for environment related options for all shells.
2
3 # Copyright (C) 2011-2013  Simon Ruderich
4 #
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.
9 #
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.
14 #
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/>.
17
18
19 source_debug ". ~/.shell/env"
20
21
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
24 # CET).
25 LANG=en_US.UTF-8
26 export LANG
27
28 # Just in case a nice administrator tries to force LC_ALL on us ...
29 unset LC_ALL
30
31 # Make sure $LANGUAGE is not set. It's a GNU extension which can overwrite
32 # variables like $LANG or $LC_ALL.
33 unset LANGUAGE
34
35 # Add ~/bin and ~/.bin and ~/.shell/bin to PATH if available.
36 if test -d "$HOME/.shell/bin"; then
37     PATH="$HOME/.shell/bin:$PATH"
38 fi
39 if test -d "$HOME/bin"; then
40     PATH="$HOME/bin:$PATH"
41 fi
42 if test -d "$HOME/.bin"; then
43     PATH="$HOME/.bin:$PATH"
44 fi
45
46 # Use Vim as editor.
47 EDITOR=vim
48 export EDITOR
49
50 # Set less as pager, its configuration is done through the ~/.less file.
51 PAGER=less
52 export PAGER
53
54 escape=`printf '\033'`
55 # Color man pages viewed with less, thanks to [1].
56 #
57 # [1]: http://nion.modprobe.de/blog/archives/572-less-colors-for-man-pages.html
58 #
59 # Color bold strings in bold blue.
60 LESS_TERMCAP_md="${escape}[01;34m"
61 LESS_TERMCAP_me="${escape}[0m"
62 export LESS_TERMCAP_md LESS_TERMCAP_me
63 # Color underlined strings in bold yellow and underlined.
64 LESS_TERMCAP_us="${escape}[01;4;33m"
65 LESS_TERMCAP_ue="${escape}[0m"
66 export LESS_TERMCAP_us LESS_TERMCAP_ue
67 # Color standout mode in bold black with yellow background.
68 LESS_TERMCAP_so="${escape}[01;30;43m"
69 LESS_TERMCAP_se="${escape}[0m"
70 export LESS_TERMCAP_so LESS_TERMCAP_se
71
72 # Use ~/.tmp as directory for temporary files if available to reduce security
73 # problems on multi-user systems.
74 if test -O "$HOME/.tmp" && test -d "$HOME/.tmp"; then
75     TMP=$HOME/.tmp
76     TEMP=$TMP
77     TMPDIR=$TMP
78     export TMP TEMP TMPDIR
79 # Also try ~/tmp as fallback.
80 elif test -O "$HOME/tmp" && test -d "$HOME/tmp"; then
81     TMP=$HOME/tmp
82     TEMP=$TMP
83     TMPDIR=$TMP
84     export TMP TEMP TMPDIR
85 fi
86
87 # Change rlwrap's home directory to prevent cluttering ~/.
88 RLWRAP_HOME="$HOME/.shell/rlwrap"
89 export RLWRAP_HOME
90
91 # Set colors for GNU ls (and Zsh completions).
92 if test -f "$HOME/.shell/dircolors"; then
93     . "$HOME/.shell/dircolors"
94 fi
95 # Set the same colors for non GNU ls, except for special cases which aren't
96 # supported.
97 LSCOLORS='ExgxxxxxBxxxxxBdBdExEb'
98 #         ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^
99 #         | | | | | | | | | | |
100 #         | | | | | | | | | | *- directory writable to others, without sticky bit
101 #         | | | | | | | | | *--- directory writable to others, with sticky bit
102 #         | | | | | | | | *----- executable with setgid bit set
103 #         | | | | | | | *------- executable with setuid bit set
104 #         | | | | | | *--------- character special
105 #         | | | | | *----------- block special
106 #         | | | | *------------- executable
107 #         | | | *--------------- pipe
108 #         | | *----------------- socket
109 #         | *------------------- symbolic link
110 #         *--------------------- directory
111 export LSCOLORS
112
113
114 source_debug ". ~/.shell/env (done)"
115
116 # vim: ft=sh