summaryrefslogtreecommitdiff
path: root/zsh/.zshrc
blob: 8fb638cacc034e7e7c8ce7dee57d6b71e94ef6be (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
# Write tmp file if it doesn't exist
[[ ! -f ~/.zsh/tmp ]] && echo "export COLORSCHEME=dark" > ~/.zsh/tmp

# Source configuration files
source "$HOME/.zsh/plugins"
source "$HOME/.zsh/functions"
source "$HOME/.zsh/alias"

# Custom key bindings for built-in widgets
bindkey -a 'k' history-beginning-search-backward
bindkey -a 'j' history-beginning-search-forward
bindkey '^P' history-beginning-search-backward
bindkey '^N' history-beginning-search-forward

# Paths of executables
export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/bin/core_perl:$HOME/bin"

# Editor
export EDITOR=/usr/bin/nvim

# Fix tmux colors
if [[ -n ${TMUX} && -n ${commands[tmux]} ]];then
    case $(tmux showenv TERM 2>/dev/null) in
        *256color) ;&
        TERM=fbterm)
            TERM=screen-256color ;;
        *)
            TERM=screen
    esac
fi

# Export GPG-agent related
if [[ -f "${HOME}/.gpg-agent-info" ]]; then
    source ${HOME}/.gpg-agent-info
    export GPG_AGENT_INFO
    export SSH_AUTH_SOCK
fi


# Tmux colors fix
if [[ -n ${TMUX} && -n ${commands[tmux]} ]];then
    case $(tmux showenv TERM 2>/dev/null) in
        *256color) ;&
        TERM=fbterm)
            TERM=screen-256color ;;
        *)
            TERM=screen
    esac
fi

[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh