]> ruderich.org/simon Gitweb - config/dotfiles.git/blob - shell/env
shell/dircolors: add more README file names
[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 # Use C locale when sorting.
28 LC_COLLATE=C
29 export LC_COLLATE
30
31 # Just in case a nice administrator tries to force LC_ALL on us ...
32 unset LC_ALL
33
34 # Make sure $LANGUAGE is not set. It's a GNU extension which can overwrite
35 # variables like $LANG or $LC_ALL.
36 unset LANGUAGE
37
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"
41 fi
42 if test -d "$HOME/bin"; then
43     PATH="$HOME/bin:$PATH"
44 fi
45 if test -d "$HOME/.bin"; then
46     PATH="$HOME/.bin:$PATH"
47 fi
48
49 # Use Vim as editor.
50 EDITOR=vim
51 export EDITOR
52
53 # Set less as pager, its configuration is done through the ~/.less file.
54 PAGER=less
55 export PAGER
56
57 escape=`printf '\033'`
58 # Color man pages viewed with less, thanks to [1].
59 #
60 # [1]: http://nion.modprobe.de/blog/archives/572-less-colors-for-man-pages.html
61 #
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
74
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
78     TMP=$HOME/.tmp
79     TEMP=$TMP
80     TMPDIR=$TMP
81     export TMP TEMP TMPDIR
82 # Also try ~/tmp as fallback.
83 elif test -O "$HOME/tmp" && test -d "$HOME/tmp"; then
84     TMP=$HOME/tmp
85     TEMP=$TMP
86     TMPDIR=$TMP
87     export TMP TEMP TMPDIR
88 fi
89
90 # Change rlwrap's home directory to prevent cluttering ~/.
91 RLWRAP_HOME="$HOME/.shell/rlwrap"
92 export RLWRAP_HOME
93
94 # Set colors for GNU ls (and Zsh completions).
95 if test -f "$HOME/.shell/dircolors"; then
96     . "$HOME/.shell/dircolors"
97 fi
98 # Set the same colors for non GNU ls, except for special cases which aren't
99 # supported.
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
114 export LSCOLORS
115
116
117 source_debug ". ~/.shell/env (done)"
118
119 # vim: ft=sh