]> ruderich.org/simon Gitweb - config/dotfiles.git/blob - shell/env
*: License under GPL v3+.
[config/dotfiles.git] / shell / env
1 # Configuration file for environment related options for all shells.
2
3 # Copyright (C) 2011-2012  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 Freenode/#screen (2009-10-02 10:25).
24 LANG=en_US.UTF-8
25 export LANG
26
27 # Add ~/bin and ~/.bin and ~/.shell/bin to PATH if available.
28 if [ -d ~/.shell/bin ]; then
29     PATH=~/.shell/bin:$PATH
30 fi
31 if [ -d ~/bin ]; then
32     PATH=~/bin:$PATH
33 fi
34 if [ -d ~/.bin ]; then
35     PATH=~/.bin:$PATH
36 fi
37
38 # Use Vim as editor.
39 EDITOR=vim
40 export EDITOR
41
42 # Set less as pager, its configuration is done through the .less file.
43 PAGER=less
44 export PAGER
45
46 # Use ~/.tmp as directory for temporary files if available to reduce security
47 # problems on multi-user systems.
48 if [ -O ~/.tmp -a -d ~/.tmp ]; then
49     TMP=~/.tmp
50     TEMP=$TMP
51     TMPDIR=$TMP
52     export TMP TEMP TMPDIR
53 # Also try ~/tmp as fallback.
54 elif [ -O ~/tmp -a -d ~/tmp ]; then
55     TMP=~/tmp
56     TEMP=$TMP
57     TMPDIR=$TMP
58     export TMP TEMP TMPDIR
59 fi
60
61 # Change rlwrap's home directory to prevent cluttering ~.
62 RLWRAP_HOME=~/.shell/rlwrap
63 export RLWRAP_HOME
64
65 # Set colors for GNU ls (and zsh completions).
66 # See `dircolors --print-database` for possible colors.
67 LS_COLORS='no=00'
68 LS_COLORS=$LS_COLORS':fi=00'       # normal files: normal
69 LS_COLORS=$LS_COLORS':di=34;01'    # directories: blue bold
70 LS_COLORS=$LS_COLORS':ln=36'       # symbolic links: cyan
71 LS_COLORS=$LS_COLORS':pi=00'       # named pipes: normal
72 LS_COLORS=$LS_COLORS':so=00'       # sockets: normal
73 LS_COLORS=$LS_COLORS':bd=00'       # block devices: normal
74 LS_COLORS=$LS_COLORS':cd=00'       # character devices: normal
75 LS_COLORS=$LS_COLORS':or=36;41'    # orphaned links: red background
76 LS_COLORS=$LS_COLORS':su=31;01;43' # setuid files: yellow background
77 LS_COLORS=$LS_COLORS':sg=31;01;43' # setgid files: yellow background
78 LS_COLORS=$LS_COLORS':ow=34;01;41' # directories writable by others: blue background
79 LS_COLORS=$LS_COLORS':ex=31;01'    # executables: bold red
80 export LS_COLORS
81 # Set the same colors for non GNU ls, except for orphaned links which aren't
82 # supported.
83 LSCOLORS='ExgxxxxxBxxxxxBdBdExEb'
84 #         ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^
85 #         | | | | | | | | | | |
86 #         | | | | | | | | | | *- directory writable to others, without sticky bit
87 #         | | | | | | | | | *--- directory writable to others, with sticky bit
88 #         | | | | | | | | *----- executable with setgid bit set
89 #         | | | | | | | *------- executable with setuid bit set
90 #         | | | | | | *--------- character special
91 #         | | | | | *----------- block special
92 #         | | | | *------------- executable
93 #         | | | *--------------- pipe
94 #         | | *----------------- socket
95 #         | *------------------- symbolic link
96 #         *--------------------- directory
97 export LSCOLORS
98
99
100 source_debug ". ~/.shell/env (done)"
101
102 # vim: ft=sh