maint: misc env cleanup
This commit is contained in:
parent
fce3b73fbb
commit
7721652200
2 changed files with 25 additions and 60 deletions
52
zsh/zshenv
52
zsh/zshenv
|
@ -1,41 +1,19 @@
|
||||||
#
|
|
||||||
# Defines environment variables.
|
|
||||||
#
|
|
||||||
|
|
||||||
#
|
|
||||||
# Nix
|
|
||||||
#
|
|
||||||
|
|
||||||
export NIX_IGNORE_SYMLINK_STORE=1
|
|
||||||
|
|
||||||
#
|
|
||||||
# Browser
|
# Browser
|
||||||
#
|
|
||||||
|
|
||||||
if [[ "$OSTYPE" == darwin* ]]; then
|
if [[ "$OSTYPE" == darwin* ]]; then
|
||||||
export BROWSER='open'
|
export BROWSER='open'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#
|
|
||||||
# Editors
|
# Editors
|
||||||
#
|
export EDITOR='nvim'
|
||||||
|
export VISUAL='nvim'
|
||||||
export EDITOR='vim'
|
|
||||||
export VISUAL='vim'
|
|
||||||
export PAGER='less'
|
export PAGER='less'
|
||||||
|
|
||||||
#
|
|
||||||
# Language
|
# Language
|
||||||
#
|
|
||||||
|
|
||||||
if [[ -z "$LANG" ]]; then
|
if [[ -z "$LANG" ]]; then
|
||||||
export LANG='en_US.UTF-8'
|
export LANG='en_US.UTF-8'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#
|
|
||||||
# Less
|
# Less
|
||||||
#
|
|
||||||
|
|
||||||
# Set the default Less options.
|
# Set the default Less options.
|
||||||
# Mouse-wheel scrolling has been disabled by -X (disable screen clearing).
|
# Mouse-wheel scrolling has been disabled by -X (disable screen clearing).
|
||||||
# Remove -X and -F (exit if the content fits on one screen) to enable it.
|
# Remove -X and -F (exit if the content fits on one screen) to enable it.
|
||||||
|
@ -46,10 +24,7 @@ if (( $+commands[lesspipe.sh] )); then
|
||||||
export LESSOPEN='| /usr/bin/env lesspipe.sh %s 2>&-'
|
export LESSOPEN='| /usr/bin/env lesspipe.sh %s 2>&-'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#
|
|
||||||
# Temporary Files
|
# Temporary Files
|
||||||
#
|
|
||||||
|
|
||||||
if [[ ! -d "$TMPDIR" ]]; then
|
if [[ ! -d "$TMPDIR" ]]; then
|
||||||
export TMPDIR="/tmp/$USER"
|
export TMPDIR="/tmp/$USER"
|
||||||
mkdir -p -m 700 "$TMPDIR"
|
mkdir -p -m 700 "$TMPDIR"
|
||||||
|
@ -59,21 +34,13 @@ TMPPREFIX="${TMPDIR%/}/zsh"
|
||||||
if [[ ! -d "$TMPPREFIX" ]]; then
|
if [[ ! -d "$TMPPREFIX" ]]; then
|
||||||
mkdir -p "$TMPPREFIX"
|
mkdir -p "$TMPPREFIX"
|
||||||
fi
|
fi
|
||||||
|
# Necessary for tmux on WSL, shouldn't impact macos
|
||||||
|
export TMUX_TMPDIR='/tmp'
|
||||||
|
|
||||||
#
|
|
||||||
# Paths
|
# Paths
|
||||||
#
|
|
||||||
|
|
||||||
typeset -gU cdpath fpath mailpath path
|
typeset -gU cdpath fpath mailpath path
|
||||||
|
|
||||||
# Set the the list of directories that cd searches.
|
check_paths=(
|
||||||
# cdpath=(
|
|
||||||
# .
|
|
||||||
# $cdpath
|
|
||||||
# )
|
|
||||||
|
|
||||||
# Set the list of directories that Zsh searches for programs.
|
|
||||||
path=(
|
|
||||||
# miniconda
|
# miniconda
|
||||||
/opt/miniconda3/bin
|
/opt/miniconda3/bin
|
||||||
|
|
||||||
|
@ -81,8 +48,6 @@ path=(
|
||||||
/opt/local/bin
|
/opt/local/bin
|
||||||
/opt/local/sbin
|
/opt/local/sbin
|
||||||
|
|
||||||
$path
|
|
||||||
|
|
||||||
# npm
|
# npm
|
||||||
$HOME/.npm-packages/bin
|
$HOME/.npm-packages/bin
|
||||||
|
|
||||||
|
@ -98,7 +63,12 @@ path=(
|
||||||
/Applications/Visual\ Studio\ Code.app/Contents/Resources/app/bin/
|
/Applications/Visual\ Studio\ Code.app/Contents/Resources/app/bin/
|
||||||
)
|
)
|
||||||
|
|
||||||
export -U PATH
|
for fp in $check_paths; do
|
||||||
|
if [[ -s "$fp" ]]; then
|
||||||
|
path+=("$fp")
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
export -U PATH
|
||||||
export CONDA_ENVS_PATH=$HOME/.conda/envs:/opt/miniconda3/envs
|
export CONDA_ENVS_PATH=$HOME/.conda/envs:/opt/miniconda3/envs
|
||||||
export CONDA_PKGS_DIRS=$HOME/.conda/pkgs
|
export CONDA_PKGS_DIRS=$HOME/.conda/pkgs
|
||||||
|
|
33
zsh/zshrc
33
zsh/zshrc
|
@ -1,30 +1,25 @@
|
||||||
# Matthew Dillon
|
# Matthew Dillon
|
||||||
# matthewrdillon@gmail.com
|
# matthewrdillon@gmail.com
|
||||||
#
|
|
||||||
# source Prezto.
|
|
||||||
if [[ -s "${ZDOTDIR:-$HOME}/.zprezto/init.zsh" ]]; then
|
|
||||||
source "${ZDOTDIR:-$HOME}/.zprezto/init.zsh"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ -s "${HOME}/.nix-profile/etc/profile.d/nix.sh" ]]; then
|
srcs=(
|
||||||
source $HOME/.nix-profile/etc/profile.d/nix.sh
|
"${ZDOTDIR:-$HOME}/.zprezto/init.zsh"
|
||||||
fi
|
"/opt/miniconda3/etc/profile.d/conda.sh"
|
||||||
|
"$HOME/.cargo/env"
|
||||||
|
)
|
||||||
|
|
||||||
if [[ -s "/opt/miniconda3/etc/profile.d/conda.sh" ]]; then
|
for fp in $srcs; do
|
||||||
source /opt/miniconda3/etc/profile.d/conda.sh
|
if [[ -s "$fp" ]]; then
|
||||||
fi
|
source "$fp"
|
||||||
|
fi
|
||||||
source "$HOME/.cargo/env"
|
done
|
||||||
|
|
||||||
# shortcuts
|
|
||||||
alias q="conda activate q2dev"
|
|
||||||
alias i="ipython3"
|
|
||||||
alias greg="grep"
|
|
||||||
alias vim="nvim"
|
|
||||||
|
|
||||||
BASE16_SHELL=$HOME/.config/base16-shell/
|
BASE16_SHELL=$HOME/.config/base16-shell/
|
||||||
[ -n "$PS1" ] && [ -s $BASE16_SHELL/profile_helper.sh ] && eval "$($BASE16_SHELL/profile_helper.sh)"
|
[ -n "$PS1" ] && [ -s $BASE16_SHELL/profile_helper.sh ] && eval "$($BASE16_SHELL/profile_helper.sh)"
|
||||||
|
|
||||||
|
alias q="conda activate q2dev"
|
||||||
|
alias i="ipython3"
|
||||||
|
alias vim="nvim"
|
||||||
|
|
||||||
# Backup shortcuts (borrowed parts from https://github.com/laurent22/rsync-time-backup
|
# Backup shortcuts (borrowed parts from https://github.com/laurent22/rsync-time-backup
|
||||||
function prune_backups() {
|
function prune_backups() {
|
||||||
dest_root="/Volumes/field_on_fire/$HOST"
|
dest_root="/Volumes/field_on_fire/$HOST"
|
||||||
|
|
Loading…
Add table
Reference in a new issue