diff options
| author | jason | 2019-07-08 11:06:27 -0600 |
|---|---|---|
| committer | jason | 2019-07-08 11:06:27 -0600 |
| commit | 15289567d1d5a27e7aba219aa0bfc13b32d8cb68 (patch) | |
| tree | 4ea62fa9ae77ace2baa539a8dd27623e6e9805c9 /zsh | |
| parent | 97322f1510b97561e353aa5adb90458c02453e0f (diff) | |
| download | dotfiles-15289567d1d5a27e7aba219aa0bfc13b32d8cb68.tar.gz dotfiles-15289567d1d5a27e7aba219aa0bfc13b32d8cb68.zip | |
zsh update
Diffstat (limited to 'zsh')
| -rw-r--r-- | zsh/.zshrc | 71 |
1 files changed, 48 insertions, 23 deletions
| @@ -53,24 +53,28 @@ plugins=(git git-extras docker fabric gpg-agent pep8 pip pyenv pylint python vag | |||
| 53 | ZSH=~/.oh-my-zsh | 53 | ZSH=~/.oh-my-zsh |
| 54 | 54 | ||
| 55 | source $ZSH/oh-my-zsh.sh | 55 | source $ZSH/oh-my-zsh.sh |
| 56 | export LANG=en_US.UTF-8 | ||
| 57 | export MANPATH="/usr/local/man:$MANPATH" | ||
| 56 | 58 | ||
| 57 | # maybe this stuff should go in .profile. Emacs seems to read from that | 59 | # PATH setup |
| 58 | export RUST_SRC_PATH="$HOME/Code/rust-lang/src" | ||
| 59 | if [ -f $HOME/.cargo/env ]; then | ||
| 60 | source $HOME/.cargo/env | ||
| 61 | fi | ||
| 62 | |||
| 63 | export GOROOT=/usr/local/go/ | ||
| 64 | export GOPATH=$HOME/Code/go | ||
| 65 | |||
| 66 | export PATH="$HOME/bin:$HOME/.cargo/bin:/usr/local/go/bin/:$PATH" | 60 | export PATH="$HOME/bin:$HOME/.cargo/bin:/usr/local/go/bin/:$PATH" |
| 67 | if [ -f /usr/local/go/bin/go ]; then | 61 | if [ -f /usr/local/go/bin/go ]; then |
| 68 | export PATH="$PATH:$GOROOT/bin:$(go env GOPATH)/bin" | 62 | export PATH="$PATH:$GOROOT/bin:$(go env GOPATH)/bin" |
| 69 | fi | 63 | fi |
| 70 | 64 | ||
| 71 | export MANPATH="/usr/local/man:$MANPATH" | 65 | # Rust |
| 66 | if [ -f $HOME/.cargo/env ]; then | ||
| 67 | source $HOME/.cargo/env | ||
| 68 | fi | ||
| 72 | 69 | ||
| 73 | export LANG=en_US.UTF-8 | 70 | # maybe this stuff should go in .profile. Emacs seems to read from that |
| 71 | if [ -x $HOME/.cargo/bin/rustup ]; then | ||
| 72 | export RUST_SRC_PATH="$(rustc --print sysroot)/lib/rustlib/src/rust/src" | ||
| 73 | fi | ||
| 74 | |||
| 75 | # Golang | ||
| 76 | #export GOROOT=/usr/local/go/ | ||
| 77 | #export GOPATH=$HOME/Code/go | ||
| 74 | 78 | ||
| 75 | # Preferred editor for local and remote sessions | 79 | # Preferred editor for local and remote sessions |
| 76 | # if [[ -n $SSH_CONNECTION ]]; then | 80 | # if [[ -n $SSH_CONNECTION ]]; then |
| @@ -79,7 +83,8 @@ export LANG=en_US.UTF-8 | |||
| 79 | # export EDITOR='mvim' | 83 | # export EDITOR='mvim' |
| 80 | # fi | 84 | # fi |
| 81 | #export EDITOR='/Applications/Emacs\ 25.app/Contents/MacOS/bin/emacsclient' | 85 | #export EDITOR='/Applications/Emacs\ 25.app/Contents/MacOS/bin/emacsclient' |
| 82 | export EDITOR='emacsclient' | 86 | export _TERM_EMACS='emacsclient -nw -a "emacs -nw"' |
| 87 | export EDITOR=$_TERM_EMACS | ||
| 83 | 88 | ||
| 84 | # Compilation flags | 89 | # Compilation flags |
| 85 | # export ARCHFLAGS="-arch x86_64" | 90 | # export ARCHFLAGS="-arch x86_64" |
| @@ -89,34 +94,35 @@ export VAGRANT_DOTFILE_PATH=~/.vagrant.d/projects | |||
| 89 | #export SSL_CERT_FILE=/usr/local/opt/curl-ca-bundle/share/ca-bundle.crt | 94 | #export SSL_CERT_FILE=/usr/local/opt/curl-ca-bundle/share/ca-bundle.crt |
| 90 | 95 | ||
| 91 | # Aliases | 96 | # Aliases |
| 92 | alias fixfileperm='find /music -type f -exec chmod 0644 {} \;' | 97 | #alias fixfileperm='find /music -type f -exec chmod 0644 {} \;' |
| 93 | alias cleanbranches='git branch --merged | grep -v "\*" | xargs -n 1 git branch -d; git branch -r --merged master | grep -iv "master" | sed "s/origin\///" | xargs -n 1 git push --delete origin' | 98 | alias cleanbranches='git branch --merged | grep -v "\*" | xargs -n 1 git branch -d; git branch -r --merged master | grep -iv "master" | sed "s/origin\///" | xargs -n 1 git push --delete origin' |
| 94 | alias ducks='du -cks * |sort -rn |head -11' | 99 | alias ducks='du -cks * |sort -rn |head -11' |
| 100 | alias dc='docker-compose' | ||
| 101 | alias define='sdcv' | ||
| 102 | alias emacs=$_TERM_EMACS | ||
| 103 | alias java18='/usr/local/java/jdk1.8.0_191/bin/java' | ||
| 104 | alias javac18='/usr/local/java/jdk1.8.0_191/bin/javac' | ||
| 95 | 105 | ||
| 106 | # Python | ||
| 96 | if [ -f /usr/local/bin/virtualenvwrapper.sh ]; then | 107 | if [ -f /usr/local/bin/virtualenvwrapper.sh ]; then |
| 97 | source /usr/local/bin/virtualenvwrapper.sh | 108 | source /usr/local/bin/virtualenvwrapper.sh |
| 98 | elif [ -f /usr/share/virtualenvwrapper/virtualenvwrapper_lazy.sh ]; then | 109 | elif [ -f /usr/share/virtualenvwrapper/virtualenvwrapper_lazy.sh ]; then |
| 99 | source /usr/share/virtualenvwrapper/virtualenvwrapper_lazy.sh | 110 | source /usr/share/virtualenvwrapper/virtualenvwrapper_lazy.sh |
| 100 | fi | 111 | fi |
| 101 | 112 | ||
| 102 | 113 | # direnv | |
| 103 | |||
| 104 | # emacsclient is a script located in ~/bin | ||
| 105 | # alias emacs='emacsclient' | ||
| 106 | |||
| 107 | alias dc='docker-compose' | ||
| 108 | alias define='sdcv' | ||
| 109 | |||
| 110 | DIRENV=`whereis -b direnv | awk {'print $2'}` | 114 | DIRENV=`whereis -b direnv | awk {'print $2'}` |
| 111 | if [[ -f $DIRENV && -x $DIRENV ]]; then | 115 | if [[ -f $DIRENV && -x $DIRENV ]]; then |
| 112 | eval "$(direnv hook zsh)" | 116 | eval "$(direnv hook zsh)" |
| 113 | fi | 117 | fi |
| 114 | 118 | ||
| 119 | # GPG ssh key | ||
| 115 | export SSH_AUTH_SOCK="$(gpgconf --list-dirs agent-ssh-socket)" | 120 | export SSH_AUTH_SOCK="$(gpgconf --list-dirs agent-ssh-socket)" |
| 116 | 121 | ||
| 117 | export GPG_TTY=$(tty) | 122 | export GPG_TTY=$(tty) |
| 118 | export COMPOSE_HTTP_TIMEOUT=600 | 123 | |
| 119 | export DOCKER_CLIENT_TIMEOUT=120 | 124 | #export COMPOSE_HTTP_TIMEOUT=600 |
| 125 | #export DOCKER_CLIENT_TIMEOUT=120 | ||
| 120 | 126 | ||
| 121 | show_virtual_env() { | 127 | show_virtual_env() { |
| 122 | if [ -n "$VIRTUAL_ENV" ]; then | 128 | if [ -n "$VIRTUAL_ENV" ]; then |
| @@ -127,3 +133,22 @@ show_virtual_env() { | |||
| 127 | #PS1='$(show_virtual_env)'$PS1 | 133 | #PS1='$(show_virtual_env)'$PS1 |
| 128 | 134 | ||
| 129 | [ -f ~/.fzf.zsh ] && source ~/.fzf.zsh | 135 | [ -f ~/.fzf.zsh ] && source ~/.fzf.zsh |
| 136 | |||
| 137 | dg() { | ||
| 138 | // credit: doug tolton | ||
| 139 | dg_res=$(ls -1p \ | ||
| 140 | | gawk -v target=$1 '$0 ~ target') | ||
| 141 | dg_res_count=$(echo $dg_res \ | ||
| 142 | | gawk 'length($0) > 0' \ | ||
| 143 | | wc -l) | ||
| 144 | |||
| 145 | if [[ "$dg_res_count" -eq 1 ]] | ||
| 146 | then | ||
| 147 | cd $(echo $dg_res) | ||
| 148 | elif [[ "$dg_res_count" -eq 0 ]]; then | ||
| 149 | echo "NO MATCHES" | ||
| 150 | else | ||
| 151 | echo $dg_res | ||
| 152 | echo "MATCHES: "$dg_res_count | ||
| 153 | fi | ||
| 154 | } | ||