-
Notifications
You must be signed in to change notification settings - Fork 1
/
_zshrc
executable file
·114 lines (90 loc) · 1.99 KB
/
_zshrc
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
114
# -*- mode: sh; -*-
# * hand configuration
# ** helper function
function has() {
which "$@" > /dev/null 2>&1
}
# ** disable ^S ^Q
stty stop ""
stty start ""
# ** emacs bindings for zle
bindkey -e
# ** Set EDITOR and vi alias to point at the 'best' vi available
if has nvim ; then
alias vi=nvim
export EDITOR=nvim
elif has vim ; then
alias vi=vim
export EDITOR=vim
fi
# ** path
# check results with print -l $path
#
# make path unique
typeset -U path
if [[ -v NIX_PATH ]]; then
# NixOS, for now just prepend ~/bin to $path
path=(~/bin $path)
# Rust stuff via rustup
path+=($HOME/.cargo/bin)
else
# reset
path=()
# personal scripts
path=(~/bin)
# Rust stuff via rustup
path+=($HOME/.cargo/bin)
# MacPorts
path+=(/opt/local/bin)
# standard paths
path+=(
/usr/local/bin
/usr/bin
/bin
/usr/local/sbin
/usr/sbin
/sbin
)
# MacTex
path+=(/Library/TeX/texbin)
# PuppetLabs pdk and bolt
path+=(
/opt/puppetlabs/pdk/bin
/opt/puppetlabs/bin
)
# XQuartz
path+=(/opt/X11/bin)
# dotnet core
path+=(/usr/local/share/dotnet)
fi
# ** environment managers
# pyenv
if has pyenv; then
eval "$(pyenv init -)"
fi
# perl local::lib - installs under ~/perl5
[ -d "$HOME/perl5" ] && eval "$(perl -I$HOME/perl5/lib/perl5 -Mlocal::lib)"
# asdf vm manager
[ -d "$HOME/.asdf" ] && . "$HOME/.asdf/asdf.sh"
# GoLang plugin
[ -d "$HOME/.asdf/plugins/golang" ] && . ~/.asdf/plugins/golang/set-env.zsh
# ** aliases
# miniverse with a non-default miniverse root, and a semi-secret api token
alias miniverse='miniverse --token "$(cat ~/.miniverse-token)" --miniverse ~/src/3d-printing/things'
alias ms='miniverse store'
# ** History management
HISTFILE="$HOME/.zsh_history"
setopt append_history
setopt extended_history
setopt hist_expire_dups_first
setopt hist_ignore_dups
setopt hist_ignore_space
setopt share_history
HISTSIZE=50000
SAVEHIST=10000
# ** Other zsh features
setopt extended_glob # extended globbing
# ** Bootstrap starship
if has starship ; then
eval "$(starship init zsh)"
fi