forked from AdamVig/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.exports
104 lines (79 loc) · 2.79 KB
/
.exports
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
if [ -v BASH_SOURCE ]; then
_dir_exports="$(dirname "$(realpath "${BASH_SOURCE[0]}")")"
else
_dir_exports="$(dirname "$(realpath "${(%):-%x}")")"
fi
prepend_path() {
if [[ "$PATH" != *"$1"* ]]; then
# https://unix.stackexchange.com/a/415028/288259
PATH="$1${PATH:+:${PATH}}"
fi
}
append_path() {
if [[ "$PATH" != *"$1"* ]]; then
# https://unix.stackexchange.com/a/415028/288259
PATH="${PATH:+${PATH}:}$1"
fi
}
# Force brew cask to symlink applications to global dir
export HOMEBREW_CASK_OPTS="--appdir=/Applications"
# Prevent Nodenv from storing data in ~/.nodenv
export NODENV_ROOT="${XDG_DATA_HOME:-$HOME/.local/share}"/nodenv
if "$_dir_exports"/bin/is-linux; then
# Prevent Docker from storing configuration in ~/.docker
export DOCKER_CONFIG="${XDG_CONFIG_HOME:-$HOME/.config}"/docker
append_path "$NODENV_ROOT"/bin
fi
if "$_dir_exports"/bin/is-macos; then
# https://stackoverflow.com/a/5084892/1850656
export XDG_CONFIG_HOME="$HOME"/Library/Preferences
export XDG_DATA_HOME="$HOME"/Library
export XDG_CACHE_HOME="$HOME"/Library/Caches
# Prefer GNU utilities over built-in BSD variants
if [ -d /usr/local/opt/gnu-getopt ]; then
prepend_path '/usr/local/opt/gnu-getopt/bin'
fi
if [ -d /usr/local/opt/coreutils ]; then
prepend_path '/usr/local/opt/coreutils/libexec/gnubin'
fi
if [ -d /usr/local/opt/gnu-sed ]; then
prepend_path '/usr/local/opt/gnu-sed/libexec/gnubin'
fi
# Add libpq's psql CLI to PATH
if [ -d /usr/local/opt/libpq/bin ]; then
prepend_path '/usr/local/opt/libpq/bin'
fi
fi
# Set golang workspace directory
export GOPATH="$HOME/code/go"
# Add golang directory to PATH
append_path "$GOPATH/bin"
if command -v python3 > /dev/null; then
# Add Python package executable directory to PATH
prepend_path "$(python3 -m site --user-base)"/bin
fi
# Add user bin directories to PATH
prepend_path "$HOME"/.local/bin
prepend_path "$_dir_exports"/bin
# Default editor
export VISUAL='emacsclient --create-frame'
export EDITOR='emacsclient --tty'
# Allow GPG to make prompts
export GPG_TTY
GPG_TTY=$(tty)
# Fix ansi-term support in emacs
export TERM=xterm-256color
# Make word-related macros observe special characters
export WORDCHARS=''
# Tell ripgrep where to load config from
export RIPGREP_CONFIG_PATH="${XDG_CONFIG_HOME:-$HOME/.config}"/ripgrep/config
# Use ripgrep for fzf search
export FZF_DEFAULT_COMMAND='rg --files'
# Prevent Postgres from storing history in ~/.psql_history
export PSQL_HISTORY="${XDG_CACHE_HOME:-$HOME/.cache}"/psql-history
# Prevent npm from storing config in ~/.npmrc
export NPM_CONFIG_USERCONFIG="${XDG_CONFIG_HOME:-$HOME/.config}"/npmrc
# Prevent less from storing history in ~/.lesshst
export LESSHISTFILE="${XDG_CACHE_HOME:-$HOME/.cache}"/lesshst
export PAGER='bat'
export MANPAGER="sh -c 'col -bx | bat -l man -p'"