]> git.sev.monster Git - dotfiles.git/blame_incremental - base/.zshenv
use xdg for vim config, add viminfo to xdg
[dotfiles.git] / base / .zshenv
... / ...
CommitLineData
1export ZDOTDIR=${XDG_CONFIG_HOME:-~/.config}/zsh
2
3### load site-specific
4[[ -f ${ZDOTDIR:-~}/.zshenv.local ]] && source ${ZDOTDIR:-~}/.zshenv.local
5
6### fix broken term
7if [[ ! -v TERM ]] {
8 TERM=xterm-256color >/dev/null 2>&1
9}
10if [[ -o interactive && $#terminfo -eq 0 ]] {
11 _oldterm=$TERM
12 export TERM=xterm >/dev/null 2>&1
13 print -P "%F{red}!!! Can't find terminfo for $_oldterm, using $TERM%f"
14 unset _oldterm
15}
16
17if [[ -o login ]] {
18 ### cd on login shell for convenience
19 # NOTE: we do this here and not in .zprofile since we occasionally might
20 # re-source .zprofile, and it's easier to just put the logic here...
21 cd ~
22} else {
23 if [[ ! -v _sev_first_display && ( -v DISPLAY || -v WAYLAND_DISPLAY ) ]] {
24 ### update gpgagent to use graphical pinentry
25 # XXX: will be sourced by every new child shell if zsh is not used to
26 # start the graphical session and the _sev_first_disaply var isn't
27 # exported; for example, this happens with sway without a display
28 # manager or launcher in front of it
29 export _sev_first_display=
30 _sev_refresh_gpgagent= source ${ZDOTDIR:-~}/.zprofile
31 } elif [[ $SHLVL == 1 ]] {
32 ### early zprofile sourcing for first shell even if not a login shell
33 # NOTE: ensure profile is loaded for toplevel shells; should hopefully be 1
34 # under some Xorg or cron implementations, which is where this would be most useful
35 source ${ZDOTDIR:-~}/.zprofile
36 }
37}
38
39# vim: et sts=4 sw=4 ts=8 tw=79
This page took 0.027076 seconds and 4 git commands to generate.