]> ruderich.org/simon Gitweb - config/dotfiles.git/blob - shell/env
f11e687adf53c0663fcb5571377ee46d6437a58c
[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 # Add ~/bin and ~/.bin and ~/.shell/bin to PATH if available.
29 if test -d "$HOME/.shell/bin"; then
30     PATH="$HOME/.shell/bin:$PATH"
31 fi
32 if test -d "$HOME/bin"; then
33     PATH="$HOME/bin:$PATH"
34 fi
35 if test -d "$HOME/.bin"; then
36     PATH="$HOME/.bin:$PATH"
37 fi
38
39 # Use Vim as editor.
40 EDITOR=vim
41 export EDITOR
42
43 # Set less as pager, its configuration is done through the ~/.less file.
44 PAGER=less
45 export PAGER
46
47 # Use ~/.tmp as directory for temporary files if available to reduce security
48 # problems on multi-user systems.
49 if test -O "$HOME/.tmp" && test -d "$HOME/.tmp"; then
50     TMP=$HOME/.tmp
51     TEMP=$TMP
52     TMPDIR=$TMP
53     export TMP TEMP TMPDIR
54 # Also try ~/tmp as fallback.
55 elif test -O "$HOME/tmp" && test -d "$HOME/tmp"; then
56     TMP=$HOME/tmp
57     TEMP=$TMP
58     TMPDIR=$TMP
59     export TMP TEMP TMPDIR
60 fi
61
62 # Change rlwrap's home directory to prevent cluttering ~/.
63 RLWRAP_HOME="$HOME/.shell/rlwrap"
64 export RLWRAP_HOME
65
66 # Set colors for GNU ls (and Zsh completions).
67 if test -f "$HOME/.shell/dircolors"; then
68     . "$HOME/.shell/dircolors"
69 fi
70 # Set the same colors for non GNU ls, except for special cases which aren't
71 # supported.
72 LSCOLORS='ExgxxxxxBxxxxxBdBdExEb'
73 #         ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^
74 #         | | | | | | | | | | |
75 #         | | | | | | | | | | *- directory writable to others, without sticky bit
76 #         | | | | | | | | | *--- directory writable to others, with sticky bit
77 #         | | | | | | | | *----- executable with setgid bit set
78 #         | | | | | | | *------- executable with setuid bit set
79 #         | | | | | | *--------- character special
80 #         | | | | | *----------- block special
81 #         | | | | *------------- executable
82 #         | | | *--------------- pipe
83 #         | | *----------------- socket
84 #         | *------------------- symbolic link
85 #         *--------------------- directory
86 export LSCOLORS
87
88
89 source_debug ". ~/.shell/env (done)"
90
91 # vim: ft=sh