-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.zshrc
115 lines (97 loc) · 3.34 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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
# ZSH settings
HISTFILE=~/.histfile
HISTSIZE=5000
SAVEHIST=5000
bindkey -v
zstyle :compinstall filename "/Users/ellie/.zshrc"
autoload -Uz compinit
compinit
export HISTORY_IGNORE="(ls|cd|pwd|exit|nvim|sudo reboot|history|cd -|cd ..)"
# macOS specific tasks
if [[ "$OSTYPE" =~ ^darwin ]]; then
# Prompt
# PROMPT="%F{#50fa7b}%n%f%F{#bd93f9}@%F{#50fa7b}akari%f %F{#bd93f9}%B%~%b%f %F{#bd93f9}%# %F{#f8f8f2}"
PROMPT="%F{#30612f}%n%f%F{#A626A4}@%F{#30612f}akari%f %F{#A626A4}%B%~%b%f %F{#A626A4}%# %F{#383A42}"
# Load nvm
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"
# TODO: fix path variable
export PATH=$PATH:/Users/ellie/.spicetify:/Users/ellie/.local/bin:/usr/local/opt/ccache/libexec
export JAVA_HOME=$(/usr/libexec/java_home -v 21)
export PATH=$JAVA_HOME/bin:$PATH
# Aliases
alias dotfiles="cd /Users/ellie/Downloads/Utility/dotfiles/"
alias ls="ls -A --color=auto"
alias doas="sudo"
alias sl="sl | lolcat && fortune | uwuify | cowsay && ls -A --color=auto"
alias polaris="ssh -t -i /Users/ellie/.ssh/id_ed25519_polaris [email protected]"
fi
# Linux specific tasks
if [[ "$OSTYPE" =~ ^linux ]]; then
# Prompt
# PROMPT="%F{#50fa7b}%n%f%F{#bd93f9}@%F{#50fa7b}%M%f %F{#bd93f9}%B%~%b%f %F{#bd93f9}%# %F{#f8f8f2}"
PROMPT="%F{#30612f}%n%f%F{#A626A4}@%F{#30612f}%M%f %F{#A626A4}%B%~%b%f %F{#A626A4}%# %F{#383A42}"
# Aliases
alias dotfiles="cd /home/akari/Downloads/util/dotfiles/"
alias trash="trash-put"
alias watch_something="python3 /home/akari/Downloads/sort/movies_to_sort/what_to_watch/main.py"
alias ls="ls -A --color=auto --group-directories-first"
alias sl="sl | lolcat && fortune | uwuify | cowsay && ls -A --color=auto --group-directories-first"
# ENV veriables
export GPG_TTY=$(tty)
export EDITOR=nvim
export VISUAL=neovide
# pnpm
export PNPM_HOME="/home/akari/.local/share/pnpm"
alias polaris="ssh [email protected]"
export PATH="$PNPM_HOME:$PATH:/home/akari/.local/share/gem/ruby/3.0.0/bin"
export LFS="/media/orisson"
fi
# General aliases
alias neo="neofetch | lolcat"
alias one="onefetch | lolcat"
alias fort="fortune | uwuify | cowsay"
alias vim="nvim"
# Sha checker
sha256() {
printf "%s %s\n" "$1" "$2" | sha256sum --check
}
### ARCHIVE EXTRACTION
# usage: ex <file>
ex () {
if [ -f $1 ] ; then
case $1 in
*.tar.bz2) tar xjf $1 ;;
*.tar.gz) tar xzf $1 ;;
*.bz2) bunzip2 $1 ;;
*.rar) unrar x $1 ;;
*.gz) gunzip $1 ;;
*.tar) tar xf $1 ;;
*.tbz2) tar xjf $1 ;;
*.tgz) tar xzf $1 ;;
*.zip) unzip $1 ;;
*.jar) unzip $1 ;;
*.Z) uncompress $1;;
*.7z) 7z x $1 ;;
*.deb) ar x $1 ;;
*.tar.xz) tar xf $1 ;;
*.tar.zst) unzstd $1 ;;
*) echo "'$1' cannot be extracted via ex()" ;;
esac
else
echo "'$1' is not a valid file"
fi
}
### Make and enter a director
# usage: mz <dir>
mz () {
mkdir $1
cd ./$1
}
# Greeting for new terminal windows
echo
# neofetch | lolcat
fortune
[ -f "/Users/ellie/.ghcup/env" ] && source "/Users/ellie/.ghcup/env" # ghcup-env
eval "$(zoxide init zsh)"