]> ruderich.org/simon Gitweb - config/dotfiles.git/blob - shell/shell/env
shell/env: add Go settings
[config/dotfiles.git] / shell / shell / env
1 # Configuration file for environment related options for all shells.
2
3 # Copyright (C) 2011-2015  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 # 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
21 # CET).
22 LANG=en_US.UTF-8
23 export LANG
24 # Use C locale when sorting.
25 LC_COLLATE=C
26 export LC_COLLATE
27
28 # Just in case a nice administrator tries to force LC_ALL on us ...
29 unset LC_ALL
30 # Also reset the rest just in case.
31 unset LC_ADDRESS
32 unset LC_CTYPE
33 unset LC_IDENTIFICATION
34 unset LC_MEASUREMENT
35 unset LC_MESSAGES
36 unset LC_MONETARY
37 unset LC_NAME
38 unset LC_NUMERIC
39 unset LC_PAPER
40 unset LC_TELEPHONE
41 unset LC_TIME
42 # Make sure $LANGUAGE is not set. It's a GNU extension which can overwrite
43 # variables like $LANG or $LC_ALL.
44 unset LANGUAGE
45
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"
49 fi
50 if test -d "$HOME/.bin"; then
51     PATH="$HOME/.bin:$PATH"
52 fi
53 if test -d "$HOME/bin"; then
54     PATH="$HOME/bin:$PATH"
55 fi
56
57 # Use Vim as editor.
58 EDITOR=vim
59 export EDITOR
60
61 # Set less as pager, its configuration is done through the ~/.less file.
62 PAGER=less
63 export PAGER
64
65 escape=`printf '\033'`
66 # Color man pages viewed with less, thanks to [1].
67 #
68 # [1]: http://nion.modprobe.de/blog/archives/572-less-colors-for-man-pages.html
69 #
70 # Color bold strings in bold blue.
71 LESS_TERMCAP_md="${escape}[01;34m"
72 LESS_TERMCAP_me="${escape}[0m"
73 export LESS_TERMCAP_md LESS_TERMCAP_me
74 # Color underlined strings in bold yellow and underlined.
75 LESS_TERMCAP_us="${escape}[01;4;33m"
76 LESS_TERMCAP_ue="${escape}[0m"
77 export LESS_TERMCAP_us LESS_TERMCAP_ue
78 # Color standout mode in bold black with yellow background.
79 LESS_TERMCAP_so="${escape}[01;30;43m"
80 LESS_TERMCAP_se="${escape}[0m"
81 export LESS_TERMCAP_so LESS_TERMCAP_se
82
83 # Prefer a private and most likely fast directory (tmpfs) for temporary files
84 # to reduce security problems on multi-user systems.
85 if test -n "$XDG_RUNTIME_DIR" && test -d "$XDG_RUNTIME_DIR"; then
86     TMP="$XDG_RUNTIME_DIR"
87 # Use ~/.tmp and ~/.tmp as fallback.
88 elif test -d "$HOME/.tmp"; then
89     TMP="$HOME/.tmp"
90 elif test -d "$HOME/tmp"; then
91     TMP="$HOME/tmp"
92 else
93     TMP=
94 fi
95 if test -n "$TMP"; then
96     TEMP="$TMP"
97     TMPDIR="$TMP"
98     export TMP TEMP TMPDIR
99 fi
100
101 # Change rlwrap's home directory to prevent cluttering ~/.
102 RLWRAP_HOME="$HOME/.shell/rlwrap"
103 export RLWRAP_HOME
104
105 # Set colors for GNU ls (and Zsh completions).
106 if test -f "$HOME/.shell/dircolors"; then
107     . "$HOME/.shell/dircolors"
108 fi
109 # Set the same colors for non GNU ls, except for special cases which aren't
110 # supported.
111 LSCOLORS='ExgxxxxxBxxxxxBdBdExEb'
112 #         ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^
113 #         | | | | | | | | | | |
114 #         | | | | | | | | | | *- directory writable to others, without sticky bit
115 #         | | | | | | | | | *--- directory writable to others, with sticky bit
116 #         | | | | | | | | *----- executable with setgid bit set
117 #         | | | | | | | *------- executable with setuid bit set
118 #         | | | | | | *--------- character special
119 #         | | | | | *----------- block special
120 #         | | | | *------------- executable
121 #         | | | *--------------- pipe
122 #         | | *----------------- socket
123 #         | *------------------- symbolic link
124 #         *--------------------- directory
125 export LSCOLORS
126
127 # Setup lesspipe to view multiple file-types (like .gz, .zip, etc.) with less.
128 # Useful in combination with the "p" alias. Inspired by Debian's default bash
129 # files. Thanks.
130 if test -x /usr/bin/lesspipe; then
131     # Don't use eval $(lesspipe) which breaks on a few systems (e.g. Gentoo)
132     # due to a different lesspipe implementation.
133     LESSOPEN='| /usr/bin/lesspipe %s'
134     LESSCLOSE='/usr/bin/lesspipe %s %s'
135     export LESSOPEN LESSCLOSE
136 fi
137
138 # Additional command line options for `mtr`.
139 MTR_OPTIONS='--show-ips'
140 export MTR_OPTIONS
141
142 # Additional command line options for `valgrind`.
143 VALGRIND_OPTS=
144 VALGRIND_OPTS="$VALGRIND_OPTS --quiet"
145 VALGRIND_OPTS="$VALGRIND_OPTS --error-exitcode=1"
146 VALGRIND_OPTS="$VALGRIND_OPTS --memcheck:leak-check=full"
147 VALGRIND_OPTS="$VALGRIND_OPTS --memcheck:show-reachable=yes"
148 VALGRIND_OPTS="$VALGRIND_OPTS --memcheck:track-fds=yes"
149 export VALGRIND_OPTS
150
151 # Use short SSH timeout for Git commands so remote fetches/pushes fail
152 # quickly. Thanks to ceddral for the idea.
153 GIT_SSH_COMMAND='ssh -o ConnectTimeout=3'
154 export GIT_SSH_COMMAND
155
156 # Go settings
157 GOPATH="$HOME/development/go:/usr/share/gocode"
158 export GOPATH
159 # Prevent privacy issues by disabling the use of https://proxy.golang.org
160 # which is the default since Go 1.13.
161 GOPROXY=direct
162 export GOPROXY
163 # Same for https://sum.golang.org/
164 GOSUMDB=off
165 export GOSUMDB
166
167 # vim: ft=sh