-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.zshrc
79 lines (59 loc) · 2.37 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
# Path to your oh-my-zsh installation.
export ZSH=~/.oh-my-zsh
export ZSH_CUSTOM=~/.oh-my-zsh-custom
# ~/.oh-my-zsh/themes/
ZSH_THEME="raethkcj"
# ripgrep configuration file
export RIPGREP_CONFIG_PATH=~/.rgconfig
# _ and - will be interchangeable.
HYPHEN_INSENSITIVE="true"
# Plugins can be found in ~/.oh-my-zsh/plugins
# Example format: plugins=(rails git textmate ruby lighthouse)
plugins=(git zsh-vi-mode)
# User configuration
ZSH_PROMPT="%m"
# Linux, Darwin, or WSL
if grep -qi microsoft /proc/version; then
platform="WSL"
else
platform=$(uname)
fi
export PATH="$PATH:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:~/.rvm/bin:/Library/TeX/texbin"
# export MANPATH="/usr/local/man:$MANPATH"
source $ZSH/oh-my-zsh.sh
alias redshift-toggle="pkill -USR1 redshift"
alias init-submodules="git submodule update --init --recursive"
alias pull-submodules="git pull --recurse-submodules"
# git add --patch (discard whitespace changes) https://stackoverflow.com/questions/6571643
alias gapdw="git diff -w --no-color | git apply --cached --ignore-whitespace && git checkout -- . && git reset && git add -p"
alias colortest='for i in {1..256}; do echo "\e[38;5;${i}m██████$( printf '%3d' $i )██████"; done'
alias mycolors='for i in 178 67 108 15 248 235; do echo "\e[38;5;${i}m██████$( printf '%3d' $i )██████"; done'
alias ffmpeg="ffmpeg -hide_banner"
if [[ $platform == "Linux" ]]; then
alias open="gvfs-open"
fi
eval $(ssh-agent) > /dev/null
# GPG needs this manually set in some combination of WSL+tmux
export GPG_TTY=$(tty)
# enable copying to Windows clipboard via VcXsrv
if [[ $platform == "WSL" ]]; then
export DISPLAY=$(route.exe print | grep 0.0.0.0 | head -1 | awk '{print $4}'):0.0
# WSL hangs if the xsrv is not running, so set a short timeout and query the server
if ! timeout 0.25s xset q &>/dev/null; then
unset DISPLAY
fi
export BROWSER=explorer.exe
fi
export PATH="/usr/local/sbin:$PATH"
# Set 256 color terminal (for tmux)
export TERM=xterm-256color
# Use vim as default editor
export VISUAL=vim
export EDITOR="$VISUAL"
export PATH="$PATH:$HOME/.rvm/bin" # Add RVM to PATH for scripting
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm
export PATH=$PATH:/usr/local/go/bin
export GOPATH=$HOME/go
export PATH=$PATH:$GOPATH/bin