-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
.zshenv
92 lines (79 loc) · 2.34 KB
/
.zshenv
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
#!/usr/bin/env zsh
# Platform-specific configuration
function _zshenv_linux() {
# Inherit environment variables from systemd
if (($+commands[systemctl])); then
local pwd="$PWD" # save PWD
eval "$(systemctl show-environment)"
eval "$(systemctl --user show-environment)"
PWD="$pwd" # restore PWD
fi
# If running wayland, ensure programs use it
if [[ -v WAYLAND_DISPLAY ]]; then
export QT_QPA_PLATFORM=wayland
export GDK_BACKEND=wayland
export CLUTTER_BACKEND=wayland
export SDL_VIDEODRIVER=wayland
export MOZ_ENABLE_WAYLAND=1
fi
}
function _zshenv_darwin() {}
case $(uname -s) in
Linux)
_zshenv_linux
;;
Darwin)
_zshenv_darwin
;;
esac
# Load user environment
# NOTE: these variables override environment variables inherited from systemd
if [[ -r "$HOME/.env" ]]; then
emulate sh -c "$HOME/.env"
fi
### zsh options
export SAVEHIST=1000000
export HISTSIZE=1000000
export HISTFILE="${HISTFILE:-$ZDOTDIR/.zsh_history}"
export HIST_IGNORE_SPACE=1
export SHARE_HISTORY=1
export DISABLE_AUTO_UPDATE=1
export DISABLE_UPDATE_PROMPT=1
export ZSH_CACHE_DIR="$HOME/.cache/zsh"
export ZSH_BASH_COMPL_DIR="${${ZDOTDIR:+$ZDOTDIR/}:-$HOME/.zsh_}bash_completions"
export ZSH_USER_FUNCTIONS_DIR="${${ZDOTDIR:+$ZDOTDIR/}:-$HOME/.zsh_}functions"
[[ -d "$ZSH_BASH_COMPL_DIR" ]] && fpath+=("$ZSH_BASH_COMPL_DIR")
[[ -d "$ZSH_USER_FUNCTIONS_DIR" ]] && fpath+=("$ZSH_USER_FUNCTIONS_DIR")
### zsh plugins
## zinit
declare -A ZINIT
export ZINIT[HOME_DIR]="${ZDOTDIR}/zinit"
export ZINIT[PLUGINS_DIR]="${ZINIT[HOME_DIR]}/plugins"
export ZINIT[BIN_DIR]="${ZINIT[HOME_DIR]}/zinit"
export ZINIT[MUTE_WARNINGS]=1
# Display red dots while waiting for tab completion
export COMPLETION_WAITING_DOTS="true"
## zsh-autosuggestions
export ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE="fg=#777"
export ZSH_AUTOSUGGEST_STRATEGY=("history" "completion")
export ZSH_AUTOSUGGEST_USE_ASYNC=1
## comark
export COMARK_DIR="$HOME/,"
export COMARK_ALIAS=1
export COMARK_GLOBAL_ALIAS=1
export COMARK_PREFIX=","
export COMARK_ALIAS_PREFIX=","
export COMARK_GLOBAL_ALIAS_PREFIX=",,"
## last-working-dir
# export LWD_AUTO_CD=1
# export LWD_DEFAULT_DIR="$HOME"
# export LWD_IGNORE_DIRS=(
# "$HOME/.asdf"
# )
## git
export GIT_PROJECTS_DIR="$HOME/git"
## fzf
export FZF_DEFAULT_OPTS="$(printf '%s ' \
"--bind=ctrl-p:toggle+up" \
"--bind=ctrl-n:toggle+down" \
)"