-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.zshrc.sample
83 lines (68 loc) · 1.96 KB
/
.zshrc.sample
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
source /etc/profile
# Path to your oh-my-zsh installation.
export ZSH="$HOME/.oh-my-zsh"
plugins=(
git
vi-mode
history-substring-search
colored-man-pages
zsh-autosuggestions
zsh-syntax-highlighting
)
source $ZSH/oh-my-zsh.sh
# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$('$HOME/miniconda3/bin/conda' 'shell.zsh' 'hook' 2> /dev/null)"
if [ $? -eq 0 ]; then
eval "$__conda_setup"
else
if [ -f "$HOME/miniconda3/etc/profile.d/conda.sh" ]; then
. "$HOME/miniconda3/etc/profile.d/conda.sh"
else
export PATH="$HOME/miniconda3/bin:$PATH"
fi
fi
unset __conda_setup
# <<< conda initialize <<<
[ -z "$NVM_DIR" ] && export NVM_DIR="$HOME/.nvm"
source /usr/share/nvm/nvm.sh
source /usr/share/nvm/bash_completion
source /usr/share/nvm/install-nvm-exec
source $HOME/.alias_profile
source $HOME/.env_profile
eval "$(starship init zsh)"
if command -v zoxide &>/dev/null; then
eval "$(zoxide init zsh)"
fi
# ENV overwrite
SHELL=$(which zsh)
# Custom functions
function greet_title() {
SYS_LOGO=$($HOME/Scripts/os-logo.sh)
UPTIME=$(uptime -p | sed -E 's/ minute[s]*/m/; s/ hour[s]*/h/; s/ day[s]*/d/; s/ week[s]*/w/; s/ year[s]*/y/')
echo $(printf "%s \033[1;32m%s \033[1;36m%s \033[1;37m%s \033[0m" "$SYS_LOGO" "$(uname -rn)" "$(LC_ALL=en_US.utf8 date +'%T')" "$UPTIME")
}
function spark_greeting() {
TITLE=$(greet_title)
printf "%s" $TITLE
if command -v lolcat &> /dev/null; then
UNCOLOR=$(echo $TITLE | sed -r "s/\x1B\[([0-9]{1,3}(;[0-9]{1,2})?)?[mGK]//g")
REMAINING="$(($(tput cols)-${#UNCOLOR}))"
seq 1 $REMAINING | sort -R | spark | lolcat -b -r
else
echo
fi
echo $(awk -f $HOME/Scripts/color-bar.awk | sed -z "s/\n//g")
}
function clear() {
/usr/bin/env clear
spark_greeting
}
function clear_greet() {
clear
tput cup 1 0
zle accept-line
}
zle -N clear_greet
bindkey "^l" clear_greet
spark_greeting