-
Notifications
You must be signed in to change notification settings - Fork 0
/
.zshrc
70 lines (56 loc) · 1.64 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
export ZSH=/usr/share/oh-my-zsh # from aur repo
export DISABLE_MAGIC_FUNCTIONS=true
export DISABLE_UNTRACKED_FILES_DIRTY=true
plugins=(docker sudo)
source $ZSH/oh-my-zsh.sh
export HISTSIZE=5000000
export SAVEHIST=5000000
unsetopt nomatch
typeset -A ZSH_HIGHLIGHT_STYLES
ZSH_HIGHLIGHT_STYLES[comment]='fg=white'
function optional_source() { [ -s "$1" ] && source "$1" }
optional_source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
optional_source /usr/share/fzf/completion.zsh
optional_source /usr/share/fzf/key-bindings.zsh
local ret_status="%(?:%{$fg_bold[green]%}:%{$fg_bold[red]%})"
function get_pwd(){
git_root=$PWD
while [[ $git_root != / && ! -e $git_root/.git ]]; do
git_root=$git_root:h
done
if [[ $git_root = / ]]; then
unset git_root
prompt_short_dir=%~
else
parent=${git_root%\/*}
prompt_short_dir=${PWD#$parent/}
fi
echo $prompt_short_dir
}
PROMPT='$ret_status%n@%m %{$fg[white]%}$(get_pwd)$(git_prompt_info)%{$reset_color%}%{$reset_color%} λ '
ZSH_THEME_GIT_PROMPT_PREFIX=" %{$fg[cyan]%}"
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_DIRTY=""
ZSH_THEME_GIT_PROMPT_CLEAN=""
alias g="git"
alias gs="git status -sb"
alias t="tig"
alias ts="tig status"
alias tw="timew"
alias k="kubectl"
alias cal="cal -m"
# muscle memory ftw
alias vim=$EDITOR
alias vi=$EDITOR
alias dkc="docker-compose"
alias dogger="docker-compose down -v && docker-compose pull && docker-compose up -d"
alias xc="xclip -sel clip"
if which fasd > /dev/null; then
eval "$(fasd --init auto)"
alias c="fasd_cd -d"
fi
if which exa > /dev/null; then
alias ll="exa -la"
else
alias ll="ls -lah"
fi