-
Notifications
You must be signed in to change notification settings - Fork 0
/
.zshrc
executable file
·86 lines (73 loc) · 2.73 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
80
81
82
83
84
85
86
if type brew &> /dev/null; then
HOMEBREW_PREFIX="$(brew --prefix)"
fi
# Setup aliases ###############################################################
alias g='git status'
alias ga='git add .'
alias gc='git commit'
alias gp='git push'
alias ls='ls -F --color=always'
alias ll='ls -l'
alias lg=lazygit
if type nvim &> /dev/null; then
alias vim=nvim
export EDITOR='nvim'
fi
# General settings ############################################################
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
autoload -Uz compinit
compinit -C
zstyle ':completion:*' menu select=1
setopt COMPLETE_ALIASES
setopt autocd
unsetopt BEEP
bindkey -s ^a "tmux a\n"
bindkey -s ^f "tmux-sessionizer\n"
[ -d "$HOME/.local/bin" ] && export PATH="$PATH:$HOME/.local/bin"
[ -d "$HOME/.npm/bin" ] && export PATH="$PATH:$HOME/.npm/bin" && \
export NPM_CONFIG_PREFIX="$HOME/.npm"
# History #####################################################################
HISTFILE=$HOME/.zsh_history
HISTSIZE=9999999
SAVEHIST=9999999
setopt INC_APPEND_HISTORY # immediately append the history file
setopt EXTENDED_HISTORY # record timestamp in history
setopt HIST_IGNORE_DUPS # don't record an entry that was just recorded again
setopt HIST_IGNORE_ALL_DUPS # ignore all duplicate entries
setopt HIST_FIND_NO_DUPS # do not display a line previously found
setopt HIST_IGNORE_SPACE # ignore commands that start with space
setopt HIST_SAVE_NO_DUPS # don't write duplicate entries
setopt SHARE_HISTORY # share history between sessions
bindkey '^R' history-incremental-pattern-search-backward # fzf fallback
# Setup fzf ###################################################################
if type fzf &> /dev/null; then
eval "$(fzf --zsh)"
else
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
fi
# Setup completions & autosuggestions #########################################
[ -f /usr/share/zsh-autosuggestions/zsh-autosuggestions.zsh ] && \
source /usr/share/zsh-autosuggestions/zsh-autosuggestions.zsh
[ -f $HOMEBREW_PREFIX/share/zsh-autosuggestions/zsh-autosuggestions.zsh ] && \
source $HOMEBREW_PREFIX/share/zsh-autosuggestions/zsh-autosuggestions.zsh
fpath=($HOME/.local/share/zsh/completions $fpath)
# Setup YubiKey Agent #########################################################
case $OSTYPE in
linux*)
export SSH_AUTH_SOCK="${XDG_RUNTIME_DIR}/yubikey-agent/yubikey-agent.sock"
;;
darwin*)
export SSH_AUTH_SOCK="$HOMEBREW_PREFIX/var/run/yubikey-agent.sock"
;;
esac
# Setup Go ####################################################################
export GOPATH="$HOME/code/go"
export GOBIN="$GOPATH/bin"
export PATH="$GOBIN:$PATH"
if type starship &> /dev/null; then
eval "$(starship init zsh)"
fi
if type direnv &> /dev/null; then
eval "$(direnv hook zsh)"
fi