-
Notifications
You must be signed in to change notification settings - Fork 1
/
zshrc
100 lines (86 loc) · 2.19 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
# Determine the operating system
os=$(uname -s)
# Check if the operating system is macOS
if [ "$os" = "Darwin" ]; then
export PATH=/opt/homebrew/bin:/opt/homebrew/sbin:$PATH
elif [ "$os" = "Linux" ]; then
if [ -f /home/linuxbrew/.linuxbrew/bin/brew ]; then
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
fi
else
echo "Unsupported operating system: $os"
fi
if command -v brew &> /dev/null
then
. `brew --prefix`/etc/profile.d/z.sh
fi
# fnm (Fast and simple Node version manager)
if command -v fnm &> /dev/null
then
eval "$(fnm env --use-on-cd)"
fi
alias typora="open -a typora"
# Use the `man` command to view Markdown files
function mat {
tempfile=$(mktemp)
pandoc --to man "$1" > "$tempfile"
man $tempfile
}
gif() {
# Based on https://gist.github.com/SheldonWangRJT/8d3f44a35c8d1386a396b9b49b43c385
output_file="${1%.*}.gif"
ffmpeg -y -i "$1" -v quiet -vf scale=iw/2:ih/2 -pix_fmt rgb8 -r 10 "$output_file" && gifsicle -O3 "$output_file" -o "$output_file"
}
# Setup path
path+=(
'/usr/bin'
'/bin'
'/usr/sbin'
'/sbin'
'/usr/local/bin'
'/usr/local/git/bin'
"$HOME/Dropbox/Projects/depot_tools"
"$HOME/bin"
"$HOME/.bin"
"$HOME/Library/Haskell/bin"
'./node_modules/.bin'
'./vendor/bin' # PHP Composer bin folder
'~/.cargo/bin' # Rust bin path
'~/.cabal/bin' # Cabal bin path
'/usr/local/heroku/bin' # Added by the Heroku Toolbelt
"$GOPATH/bin"
"$HOME/.yarn/bin"
"$HOME/.config/yarn/global/node_modules/.bin"
'/usr/local/sbin'
'/snap/bin'
)
export PATH
alias paths_debug="echo $PATH | sed 's/:/\n/g' | sort | uniq -c"
# Ensure that MANPATH have a : in the beginning
export MANPATH=":$MANPATH"
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
# Make Node prefer ipv4
export NODE_OPTIONS="--dns-result-order=ipv4first"
# https://consoledonottrack.com/
export DO_NOT_TRACK=1
# Oh my zsh
ZSH=$HOME/.oh-my-zsh
ZSH_CUSTOM=$HOME/configs/zsh_custom
ZSH_THEME="robbyrussell_theknarf_mod"
plugins=(
git-flow
zsh-autosuggestions
ssh-agent
man-color
bindkey-vim
zsh-yarn-completions
kubectl
wasmer
bun
direnv
fzf
exa
)
source $ZSH/oh-my-zsh.sh
test -e "${HOME}/.iterm2_shell_integration.zsh" && source "${HOME}/.iterm2_shell_integration.zsh"