summaryrefslogtreecommitdiffstats
path: root/.zshrc
blob: e46a26f9463ce15b4f6beef31c51e961c5d89553 (plain) (blame)
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
# Always pull in profile, if you didn't already
source ~/.profile

# for ZSH
case "$OSTYPE" in
    darwin*)
        # ZSH Settings
        zstyle ':completion:*' completer _complete _ignored
        zstyle :compinstall filename '/Users/tydavis/.zshrc'
        # == OSX Settings ==

        if [ $(command -v python3) ]; then
            export PATH=$(python3 -m site --user-base)/bin:$PATH
        fi

	set -o emacs

        ;;
    linux*)
        # ZSH Settings
        zstyle ':completion:*' completer _complete _ignored
        zstyle :compinstall filename '/home/tydavis/.zshrc'
        autoload -U compinit
        compinit -i

        # The next line updates PATH for the Google Cloud SDK.
        if [ -f '/home/tydavis/.gcloud/google-cloud-sdk/path.zsh.inc' ]; then . '/home/tydavis/.gcloud/google-cloud-sdk/path.zsh.inc'; fi
        # The next line enables shell command completion for gcloud.
        if [ -f '/home/tydavis/.gcloud/google-cloud-sdk/completion.zsh.inc' ]; then . '/home/tydavis/.gcloud/google-cloud-sdk/completion.zsh.inc'; fi

        ;;
    dragonfly* | freebsd* | netbsd* | openbsd*)
        # No BSD yet
        ;;
esac

if [ "$(command -v fzf)" ]; then
    eval "$(fzf --zsh)"
fi

autoload -Uz compinit
compinit
# End of lines added by compinstall
# Lines configured by zsh-newuser-install

export HISTFILE=~/.histfile
export HISTSIZE=10000
export SAVEHIST=10000

setopt appendhistory
unsetopt autocd beep extendedglob
bindkey -e
#bindkey -v
# End of lines configured by zsh-newuser-install

# ZSH VIM MODE
export KEYTIMEOUT=1
# https://github.com/jeffreytse/zsh-vi-mode
if [ -e "$HOME/.local/share/zsh/zsh-vi-mode.plugin.zsh" ]; then
   source $HOME/.local/share/zsh/zsh-vi-mode.plugin.zsh
fi
###

## == Prompt ==
export PS1="%c$ "

# Add jwt-decode option
if [ "$(command -v jq)" ]; then
  jwt-decode() {
    jq -R 'split(".") |.[0:2] | map(@base64d) | map(fromjson)' <<< $1
  }
fi