aboutsummaryrefslogtreecommitdiff
path: root/.zshrc
blob: fa00dc3f5ea33dd1893483e4dfa8afde39906a3e (plain)
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
setopt histignorealldups sharehistory

# Use emacs keybindings even if our EDITOR is set to vi
bindkey -e
export VISUAL=vim
export EDITOR=vim

export LANG=en_US.UTF-8
export GPG_KEY=$(tty)

# Edit command line
autoload -U edit-command-line
zle -N edit-command-line
bindkey '^x^e' edit-command-line

# Keep 1000 lines of history within the shell and save it to ~/.zsh_history:
HISTSIZE=1000
SAVEHIST=1000
HISTFILE=~/.zsh_history

[ -d ~/bin ] && export PATH="$HOME/bin:$PATH"

[[ -s /etc/profile.d/autojump.sh ]] && source /etc/profile.d/autojump.sh

# System Specific
case `uname` in 
Darwin)
    # commands for macOS
    [ -f /usr/local/etc/profile.d/autojump.sh ] && . /usr/local/etc/profile.d/autojump.sh

    # ruby
    [ -d /usr/local/opt/ruby/bin ] && export PATH="/usr/local/opt/ruby/bin:$PATH"

    # java
    [ -d /usr/local/opt/openjdk/bin ] && export PATH="/usr/local/opt/openjdk/bin:$PATH"

    # Alias
    alias ls='ls -G'
    alias ll='ls -lhG'
    alias bug='brew upgrade --greedy'
    
    source ~/.macos
;;
Linux)
    # commands for Linux
;;
FreeBSD)
    # commands for FreeBSD
;;
esac

# zplug
if [ ! -d ~/.zplug ]; then
    echo 'Installing zplug ... '
    git clone https://github.com/zplug/zplug.git ~/.zplug
fi
source ~/.zplug/init.zsh 
zplug "plugins/git", from:oh-my-zsh
zplug "zsh-users/zsh-completions"
zplug "zsh-users/zsh-syntax-highlighting"
zplug "dracula/zsh", as:theme
if ! zplug check --verbose; then
    printf "Install? [y/N]: "
    if read -q; then
        echo; zplug install
    fi
fi
zplug load

source $HOME/.aliases
[ -f $HOME/.zsh_local ] && source $HOME/.zsh_local