-
Notifications
You must be signed in to change notification settings - Fork 3
/
dot_zshrc.tmpl
93 lines (84 loc) · 2.35 KB
/
dot_zshrc.tmpl
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
87
88
89
90
91
92
93
# Load custom bits
if [ -f ~/.bash_local ]; then
. ~/.bash_local
fi
if [ -f ~/.shell/secret ]; then
. ~/.shell/secret
fi
. ~/.shell/variables
. ~/.shell/functions
. ~/.shell/aliases
# Path to your oh-my-zsh configuration.
ZSH=$HOME/.oh-my-zsh
# Set name of the theme to load.
ZSH_THEME="agnoster"
# Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*)
if [[ "$OSTYPE" == "linux-gnu" ]]; then
plugins=(git emoji)
elif [[ "$unamestr" == "Darwin"* ]]; then
plugins=(git macos battery emoji)
fi
source $ZSH/oh-my-zsh.sh
DEFAULT_USER=`whoami`
# Customize to your needs...
export PATH="$PATH:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/:{{ joinPath .chezmoi.homeDir "bin" }}:{{ joinPath .chezmoi.homeDir ".local" "bin" }}"
#Functions
export CLICOLOR=1
export LSCOLORS=Hxgxfxfxcxdxdxhbadbxbx
# Automatic options added
setopt appendhistory autocd nomatch autopushd pushdignoredups promptsubst
unsetopt beep
bindkey -e
bindkey '^[[1;9C' forward-word
bindkey '^[[1;9D' backward-word
zstyle :compinstall filename '$HOME/.zshrc'
# end automatic options
# Make prompt prettier
autoload -U promptinit
promptinit
export LC_ALL=en_US.UTF-8
setopt PROMPT_SUBST
# TMOUT=1
# TRAPALRM() { zle reset-prompt }
strlen () {
FOO=$1
local zero='%([BSUbfksu]|([FB]|){*})'
LEN=${#${(S%%)FOO//$~zero/}}
echo $LEN
}
# show right prompt with date ONLY when command is executed
# preexec () {
# DATE=$( date +"[%H:%M:%S]" )
# local len_right=$( strlen "$DATE" )
# len_right=$(( $len_right+1 ))
# local right_start=$(($COLUMNS - $len_right))
#
# local len_cmd=$( strlen "$@" )
# local len_prompt=$(strlen "$PROMPT" )
# local len_left=$(($len_cmd+$len_prompt))
#
# RDATE="\033[${right_start}C ${DATE}"
#
# if [ $len_left -lt $right_start ]; then
# # command does not overwrite right prompt
# # ok to move up one line
# echo -e "\033[1A${RDATE}"
# else
# echo -e "${RDATE}"
# fi
#
# }
# Colorized Man Pages
man() {
env \
LESS_TERMCAP_mb=$(printf "\e[1;31m") \
LESS_TERMCAP_md=$(printf "\e[1;31m") \
LESS_TERMCAP_me=$(printf "\e[0m") \
LESS_TERMCAP_se=$(printf "\e[0m") \
LESS_TERMCAP_so=$(printf "\e[1;44;33m") \
LESS_TERMCAP_ue=$(printf "\e[0m") \
LESS_TERMCAP_us=$(printf "\e[1;32m") \
man "$@"
}
eval "$(zoxide init zsh)"
eval "$(starship init zsh)"