-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathvariables
More file actions
113 lines (90 loc) · 3.18 KB
/
variables
File metadata and controls
113 lines (90 loc) · 3.18 KB
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
105
106
107
108
109
110
111
112
113
# setting some default values
NOCOR=${NOCOR:-0}
NOMENU=${NOMENU:-0}
NOPRECMD=${NOPRECMD:-0}
COMMAND_NOT_FOUND=${COMMAND_NOT_FOUND:-0}
GRML_ZSH_CNF_HANDLER=${GRML_ZSH_CNF_HANDLER:-/usr/share/command-not-found/command-not-found}
BATTERY=${BATTERY:-0}
GRMLSMALL_SPECIFIC=${GRMLSMALL_SPECIFIC:-1}
GRML_ALWAYS_LOAD_ALL=${GRML_ALWAYS_LOAD_ALL:-0}
ZSH_NO_DEFAULT_LOCALE=${ZSH_NO_DEFAULT_LOCALE:-0}
# needed for locale support in nix on other distros
export LOCALE_ARCHIVE=/usr/lib/locale/locale-archive
# Fix gibberish characters in bat if used as manpager, https://github.com/sharkdp/bat/issues/2593#issuecomment-1636468711
export MANROFFOPT='-c'
# make sure manpath only contains existing folders
if [ -n "${MANPATH:-}" ]; then
clean_manpath=""
for mp in $(sed 's/:/\n/g' <<<"$MANPATH:$(unset MANPATH; manpath):$(unset MANPATH; manpath -g)"); do
if [ -e "$mp" ]; then
clean_manpath="${clean_manpath:+${clean_manpath}:}${mp}"
fi
done
export MANPATH="${clean_manpath}"
unset clean_manpath
fi
if command -v bat>/dev/null; then
# Have manpages colored
export MANPAGER="sh -c 'col -bx | bat -l man -p'"
fi
# Enable SudoWrite in neovim:
if [ -z "${SUDO_ASKPASS:-}" ] && [ -e /usr/lib/ssh/ssh-askpass ]; then
export SUDO_ASKPASS=/usr/lib/ssh/ssh-askpass
fi
if command -v bat >/dev/null; then
export BAT_PAGER="less -RF"
export MANPAGER="sh -c 'col -b | bat -l man -p'"
fi
# # switch modes in 0.1 seconds
# export KEYTIMEOUT=1
export KEYTIMEOUT=20
if [ -f "$(command -v nvim)" ]; then
export EDITOR="nvim"
else
export EDITOR="vim"
fi
export VIRTUAL_ENV_DISABLE_PROMPT="true"
# force zsh to be looked up (useful for singularity containers)
if command -v zsh >/dev/null; then
export SHELL=$(command -v zsh)
else
export SHELL="/opt/shell/zsh"
fi
# Set GPG TTY
export GPG_TTY=$(tty)
# Refresh gpg-agent tty in case user switches into an X session
if pgrep gpg-agent >/dev/null && command -v gpg-connect-agent 2>&1 >/dev/null; then
gpg-connect-agent updatestartuptty /bye >/dev/null
fi
if [[ "${COLORTERM:-}" == "rxvt" ]]\
&& command -v pacman 2>&1 >/dev/null\
&& pacman -Qsq rxvt-unicode-truecolor >/dev/null; then
export COLORTERM=truecolor
elif [[ "${TERM:-}" == "alacritty" ]]; then
export COLORTERM=truecolor
fi
if command -v readlink>/dev/null && [[ "$(readlink -m /etc/locatime)" == "/usr/share/zoneinfo/Etc/UTC" ]] && [ -z "${TZ:-}" ]; then
export TZ=/usr/share/zoneinfo/Europe/Berlin
fi
if command -v fasd &>/dev/null && command -v fzf &>/dev/null; then
# show recent folders on ctrl-t
export FZF_CTRL_T_COMMAND="fasd -al"
fi
# explicitly add ~/.local/bin
prepend_path PATH "$HOME/.local/bin"
# setup ccache if exists
if command -v ccache >/dev/null; then
prepend_path PATH /usr/lib/ccache/bin
fi
if [ -d "$HOME/.ghcup/bin" ]; then
prepend_path PATH "$HOME/.ghcup/bin"
fi
if [ -d $HOME/.local/share/gem/ruby/3.0.0/bin ]; then
prepend_path PATH $HOME/.local/share/gem/ruby/3.0.0/bin
fi
if [ -e "$HOME/.nix-profile/share/zsh/site-functions" ]; then
fpath+=( "$HOME/.nix-profile/share/zsh/site-functions" )
fi
# vidir arguments
export VIDIR_EDITOR_ARGS='-c :set nolist | :set ft=vidir-ls'
# vim: ft=zsh