-
Notifications
You must be signed in to change notification settings - Fork 1
/
zshrc
72 lines (56 loc) · 2.16 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
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi
# Path to your oh-my-zsh installation.
export ZSH="$HOME/.oh-my-zsh"
ZSH_THEME="powerlevel10k/powerlevel10k"
HIST_STAMPS="yyyy-mm-dd"
# zsh plugins
plugins=(macos git gh web-search npm volta)
source $ZSH/oh-my-zsh.sh
# Put /usr/local/{sbin,bin} first
export PATH=/usr/local/bin:$PATH
export PATH=$HOME/bin:$PATH
export PATH=$HOME/Library/Python/3.9/bin:$PATH
export PATH=$HOME/.esvu/bin:$PATH
export PATH=$HOME/dev/WebKit/Tools/Scripts:$PATH
# No ._ files in archives please
export COPYFILE_DISABLE=true
eval "$(/opt/homebrew/bin/brew shellenv)"
# Forward git agent
ssh-add --apple-use-keychain $HOME/.ssh/id_ed25519 &>/dev/null
## Aliases
alias cls='clear'
alias edit='open -a "Sublime Text"'
alias code='open -a "Visual Studio Code"'
alias tree='tree -Ca -I ".git|.svn|*.pyc|*.swp|node_modules"'
alias sizes='du -h -d1'
alias hljs='pbpaste | highlight --syntax=js -O rtf | pbcopy'
alias today="cal | grep -C6 --color \"$(date +%e)\""
alias psync="npm install && npm prune && npm update"
alias flushdns='dscacheutil -flushcache'
# Homebrew wontfix workaround
alias python=python3
alias pip=pip3
## Tab Completions
set completion-ignore-case On
function pgrep {
local exclude="\.svn|\.git|\.swp|\.coverage|\.pyc|_build"
find . -maxdepth 1 -mindepth 1 | egrep -v "$exclude" | xargs egrep -lir "$1" | egrep -v "$exclude" | xargs egrep -Hin --color "$1"
}
# Brew completions
# https://docs.brew.sh/Shell-Completion
if command -v brew &>/dev/null; then
FPATH="$(brew --prefix)/share/zsh/site-functions:$FPATH"
source "$(brew --prefix)/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh"
source "$(brew --prefix)/share/zsh-autosuggestions/zsh-autosuggestions.zsh"
autoload -Uz compinit
compinit
fi
# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
export VOLTA_HOME="$HOME/.volta"
export PATH="$VOLTA_HOME/bin:$PATH"
export GPG_TTY=$(tty)
# gpgconf --launch gpg-agent