1 # Configuration file for environment related options for all shells.
3 # Copyright (C) 2011-2015 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 # Use UTF-8 encoding in the terminal. Don't use LC_ALL as it's used for
20 # debugging purposes. Thanks to twb in #screen on Freenode (2009-10-02 10:25
24 # Use C locale when sorting.
28 # Just in case a nice administrator tries to force LC_ALL on us ...
30 # Also reset the rest just in case.
33 unset LC_IDENTIFICATION
42 # Make sure $LANGUAGE is not set. It's a GNU extension which can overwrite
43 # variables like $LANG or $LC_ALL.
46 # Add ~/bin, ~/.bin and ~/.shell/bin to PATH if available.
47 if test -d "$HOME/.shell/bin"; then
48 PATH="$HOME/.shell/bin:$PATH"
50 if test -d "$HOME/.bin"; then
51 PATH="$HOME/.bin:$PATH"
53 if test -d "$HOME/bin"; then
54 PATH="$HOME/bin:$PATH"
61 # Set less as pager, its configuration is done through the ~/.less file.
65 escape=`printf '\033'`
66 # Color man pages viewed with less, thanks to [1]. Groff versions >= 1.23 also
67 # need GROFF_NO_SGR=1 for this to work.
69 # [1]: http://nion.modprobe.de/blog/archives/572-less-colors-for-man-pages.html
71 # Color bold strings in bold blue.
72 LESS_TERMCAP_md="${escape}[01;34m"
73 LESS_TERMCAP_me="${escape}[0m"
74 export LESS_TERMCAP_md LESS_TERMCAP_me
75 # Color underlined strings in bold yellow and underlined.
76 LESS_TERMCAP_us="${escape}[01;4;33m"
77 LESS_TERMCAP_ue="${escape}[0m"
78 export LESS_TERMCAP_us LESS_TERMCAP_ue
79 # Color standout mode in bold black with yellow background.
80 LESS_TERMCAP_so="${escape}[01;30;43m"
81 LESS_TERMCAP_se="${escape}[0m"
82 export LESS_TERMCAP_so LESS_TERMCAP_se
84 # Prefer a private and most likely fast directory (tmpfs) for temporary files
85 # to reduce security problems on multi-user systems.
86 if test -n "$XDG_RUNTIME_DIR" && test -d "$XDG_RUNTIME_DIR"; then
87 TMP="$XDG_RUNTIME_DIR"
88 # Use ~/.tmp and ~/.tmp as fallback.
89 elif test -d "$HOME/.tmp"; then
91 elif test -d "$HOME/tmp"; then
96 if test -n "$TMP"; then
99 export TMP TEMP TMPDIR
102 # Change rlwrap's home directory to prevent cluttering ~/.
103 RLWRAP_HOME="$HOME/.shell/rlwrap"
106 # Set colors for GNU ls (and Zsh completions).
107 if test -f "$HOME/.shell/dircolors"; then
108 . "$HOME/.shell/dircolors"
110 # Set the same colors for non GNU ls, except for special cases which aren't
112 LSCOLORS='ExgxxxxxBxxxxxBdBdExEb'
113 # ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^
114 # | | | | | | | | | | |
115 # | | | | | | | | | | *- directory writable to others, without sticky bit
116 # | | | | | | | | | *--- directory writable to others, with sticky bit
117 # | | | | | | | | *----- executable with setgid bit set
118 # | | | | | | | *------- executable with setuid bit set
119 # | | | | | | *--------- character special
120 # | | | | | *----------- block special
121 # | | | | *------------- executable
122 # | | | *--------------- pipe
123 # | | *----------------- socket
124 # | *------------------- symbolic link
125 # *--------------------- directory
128 # Setup lesspipe to view multiple file-types (like .gz, .zip, etc.) with less.
129 # Useful in combination with the "p" alias. Inspired by Debian's default bash
131 if test -x /usr/bin/lesspipe; then
132 # Don't use eval $(lesspipe) which breaks on a few systems (e.g. Gentoo)
133 # due to a different lesspipe implementation.
134 LESSOPEN='| /usr/bin/lesspipe %s'
135 LESSCLOSE='/usr/bin/lesspipe %s %s'
136 export LESSOPEN LESSCLOSE
139 # Additional command line options for `mtr`.
140 MTR_OPTIONS='--show-ips'
143 # Additional command line options for `valgrind`.
145 VALGRIND_OPTS="$VALGRIND_OPTS --quiet"
146 VALGRIND_OPTS="$VALGRIND_OPTS --error-exitcode=1"
147 VALGRIND_OPTS="$VALGRIND_OPTS --memcheck:leak-check=full"
148 VALGRIND_OPTS="$VALGRIND_OPTS --memcheck:show-reachable=yes"
149 VALGRIND_OPTS="$VALGRIND_OPTS --memcheck:track-fds=yes"
152 # Use short SSH timeout for Git commands so remote fetches/pushes fail
153 # quickly. Thanks to ceddral for the idea.
154 GIT_SSH_COMMAND='ssh -o ConnectTimeout=3'
155 export GIT_SSH_COMMAND
158 GOPATH="$HOME/development/go:/usr/share/gocode"
160 # Prevent privacy issues by disabling the use of https://proxy.golang.org
161 # which is the default since Go 1.13.
164 # Same for https://sum.golang.org/
168 # Tell `ip -color` to use colors suitable for a dark terminal. Not sure if
169 # this variable is also used by other programs.