dotfiles

Personal dotfiles
git clone https://git.bracken.jp/dotfiles.git
Log | Files | Refs | LICENSE

.zshenv (2447B)


      1 # .zshenv
      2 #
      3 # Despite setting ZDOTDIR, this file will likely need to be symlinked to
      4 # ~/.zshenv, unless the OS itself defaults ZDOTDIR to the specified location.
      5 
      6 # Default read-only permissions for group/other.
      7 umask 022
      8 
      9 # If not running under a FreeDesktop session manager, set XDG variables.
     10 if [[ -z "$XDG_CONFIG_HOME" ]]; then
     11   export XDG_CONFIG_HOME="$HOME/.config"
     12 fi
     13 if [[ -z "$XDG_CACHE_HOME" ]]; then
     14   export XDG_CACHE_HOME="$HOME/.cache"
     15 fi
     16 if [[ -z "$XDG_DATA_HOME" ]]; then
     17   export XDG_DATA_HOME="$HOME/.local/share"
     18 fi
     19 if [[ -z "$XDG_STATE_HOME" ]]; then
     20   export XDG_STATE_HOME="$HOME/.local/state"
     21 fi
     22 if [[ -z "$XDG_RUNTIME_DIR" ]]; then
     23   export XDG_RUNTIME_DIR="/tmp/user/$(id -u)"
     24   mkdir -p "$XDG_RUNTIME_DIR"
     25   chmod 0700 "$XDG_RUNTIME_DIR"
     26 fi
     27 
     28 # Set location for remainder of zsh config files to avoid cluttering $HOME.
     29 export ZDOTDIR="$XDG_CONFIG_HOME/zsh"
     30 
     31 # Basics
     32 export EDITOR=nvim
     33 export PAGER=less
     34 export LESS="-FRX"
     35 
     36 # Set language, date/time, currency, etc. to Japanese.
     37 export LANG=ja_JP.UTF-8
     38 export LANGUAGE=ja_JP.UTF-8
     39 export LC_COLLATE=ja_JP.UTF-8
     40 export LC_CTYPE=ja_JP.UTF-8
     41 export LC_MEASUREMENT=ja_JP.UTF-8
     42 export LC_MESSAGES=ja_JP.UTF-8
     43 export LC_MONETARY=ja_JP.UTF-8
     44 export LC_NUMERIC=ja_JP.UTF-8
     45 export LC_PAPER=ja_JP.UTF-8
     46 export LC_TIME=ja_JP.UTF-8
     47 
     48 # GPG directory and TTY used for pinentry.
     49 export GNUPGHOME="$HOME/.gnupg"
     50 export GPG_TTY="$(tty)"
     51 
     52 # Lynx browser.
     53 export LYNX_CFG="$XDG_CONFIG_HOME/lynx/lynx.cfg"
     54 
     55 # Notmuch email indexer.
     56 export NOTMUCH_CONFIG="$XDG_CONFIG_HOME/notmuch/config"
     57 
     58 # Google stuff.
     59 export P4CONFIG=.p4config
     60 export P4EDITOR=nvim
     61 export GEM_HOME="$HOME/.gem"
     62 
     63 # Platform-specific source directory.
     64 [[ -d "$HOME/src" ]] && SRC_ROOT="$HOME/src"
     65 [[ -d "$HOME/Developer" ]] && SRC_ROOT="$HOME/Developer"
     66 
     67 # Flutter/Fuchsia stuff.
     68 [[ "$(uname)" == "Linux" ]] && export GOMA_DIR="$SRC_ROOT/flutter/engine/src/buildtools/linux-x64/goma"
     69 [[ "$(uname)" == "Darwin" ]] && export GOMA_DIR="$SRC_ROOT/flutter/engine/src/buildtools/mac-x64/goma"
     70 [[ "$(uname)" == "Darwin" ]] && export FLUTTER_GOMA_CREATE_XCODE_SYMLINKS=1
     71 
     72 # Set GOPATH.
     73 export GOPATH="$SRC_ROOT/go"
     74 
     75 # If a local python3 directory exists, add PYTHONPATH.
     76 if [[ -d "$HOME/.local/lib/python3" ]]; then
     77   export PYTHONPATH="$HOME/.local/lib/python3:$PYTHONPATH"
     78 fi
     79 
     80 # If a local perl5 directory exists, add PERL5LIB.
     81 if [[ -d "$HOME/.perl5/lib/perl5" ]]; then
     82   export PERL5LIB="$HOME/.perl5/lib/perl5:$PERL5LIB"
     83 fi