my dotfiles
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

add zsh configuration with plugins and aliases

theMackabu 22210c46

+304
+304
.zshrc
··· 1 + # goto directory by name 2 + setopt autocd 3 + 4 + # zsh plugins 5 + source $HOME/.config/plugins/completion/completion.zsh 6 + source $HOME/.config/plugins/fsh/fast-syntax-highlighting.plugin.zsh 7 + source $HOME/.config/plugins/autosuggestions/zsh-autosuggestions.plugin.zsh 8 + 9 + # enable built in scripts 10 + source $HOME/.local/scripts/entry.sh 11 + 12 + # shell configuration 13 + typeset -A \ 14 + prompt_with_newline_terminals \ 15 + multiplexer_terminals \ 16 + unsupported_terminals \ 17 + logo_ls_enabled_terminals 18 + 19 + prompt_with_newline_terminals=( 20 + [iTerm.app]=1 21 + [Tabby]=1 22 + [ghostty]=1 23 + ) 24 + 25 + multiplexer_terminals=( 26 + [tmux]=1 27 + ) 28 + 29 + unsupported_terminals=( 30 + [WarpTerminal]=1 31 + [Apple_Terminal]=1 32 + [zed]=1 33 + [CodeEditApp_Terminal]=1 34 + [Jetbrains.Fleet]=1 35 + ) 36 + 37 + logo_ls_enabled_terminals=( 38 + [iTerm.app]=1 39 + [""]=1 40 + [ghostty]=1 41 + [tmux]=1 42 + [CodeEditApp_Terminal]=1 43 + [Jetbrains.Fleet]=1 44 + ) 45 + 46 + # check which group the current terminal belongs to 47 + if [[ -n ${prompt_with_newline_terminals[$TERM_PROGRAM]} ]]; then 48 + # newline after every command 49 + precmd() precmd() echo 50 + eval "$(oh-my-posh init zsh --config $HOME/.config/themes/spaceship.omp.json)" 51 + elif [[ -n ${multiplexer_terminals[$TERM_PROGRAM]} ]]; then 52 + eval "$(oh-my-posh init zsh --config $HOME/.config/themes/spaceship.tmux.json)" 53 + elif [[ -z ${unsupported_terminals[$TERM_PROGRAM]} ]]; then 54 + # default case for all other terminals 55 + if [[ "$PWD" != "$HOME/Developer/rust/playground"* ]]; then 56 + eval "$(oh-my-posh init zsh --config $HOME/.config/themes/custom/agnoster.yml)" 57 + fi 58 + fi 59 + 60 + if [[ -n ${logo_ls_enabled_terminals[$TERM_PROGRAM]} ]]; then 61 + alias ls="logo-ls" 62 + alias l="/bin/ls" 63 + fi 64 + 65 + # bun completions 66 + [ -s "/Users/themackabu/.bun/_bun" ] && source "/Users/themackabu/.bun/_bun" 67 + 68 + # gnupg 69 + export GPG_TTY=$(tty) 70 + 71 + # visual editor 72 + export EDITOR=meow 73 + 74 + # return symbol 75 + PROMPT_EOL_MARK="⏎" 76 + 77 + # neovim 78 + alias nv='nvim' 79 + 80 + # get path 81 + alias path='echo -e ${PATH//:/\\n}' 82 + 83 + # get time 84 + alias now='date +"%T"' 85 + 86 + # meow 87 + alias meow='_meow_handler' 88 + alias mrrp='_meow_handler' 89 + alias ':3'='_meow_handler' 90 + 91 + # gui editor 92 + alias edit="open -a CotEditor" 93 + 94 + # funny quotes 95 + alias quote="fortune | cowsay -W 30" 96 + 97 + # get your ip 98 + alias myip="curl ip.themackabu.dev" 99 + 100 + # gnu coreutils 101 + alias date='gdate' 102 + 103 + # cute 104 + alias boykisser="cowsay -f $HOME/Downloads/boykisser.cow" 105 + 106 + alias myinfo="PF_INFO='ascii title os host kernel uptime pkgs memory' HOSTNAME=M1Pro pfetch" 107 + alias picofetch="PF_INFO='title os host kernel uptime pkgs memory' HOSTNAME=M1Pro pfetch" 108 + 109 + # make homebrew faster 110 + export HOMEBREW_NO_AUTO_UPDATE=1 111 + 112 + # deno 113 + export DENO_INSTALL="/Users/themackabu/.deno" 114 + export PATH="$DENO_INSTALL/bin:$PATH" 115 + 116 + # tailscale 117 + alias tailscale="/Applications/Tailscale.app/Contents/MacOS/Tailscale" 118 + 119 + # uwufetch 120 + alias uwu="uwufetch --image ~/Desktop/awww.png" 121 + 122 + # vm.framework 123 + alias vm="limactl" 124 + alias vx="lima" 125 + 126 + # password manager 127 + alias pass="gopass" 128 + 129 + # cursor editor 130 + alias c="cursor" 131 + 132 + # close cloudflare warp 133 + alias dewarp="killall 'Cloudflare WARP'" 134 + 135 + # just js 136 + alias just="~/Developer/rust/js_runtime/just" 137 + 138 + # python 139 + alias python="python3" 140 + alias pip="python3 -m pip" 141 + 142 + # godot cli 143 + alias godot="/Applications/Godot.app/Contents/MacOS/Godot" 144 + 145 + # pnpm 146 + export PNPM_HOME="/Users/themackabu/Library/pnpm" 147 + case ":$PATH:" in 148 + *":$PNPM_HOME:"*) ;; 149 + *) export PATH="$PNPM_HOME:$PATH" ;; 150 + esac 151 + 152 + # screenshot shadow toggles 153 + alias screen_shadow_on="defaults write com.apple.screencapture 'disable-shadow' -bool 'false'" 154 + alias screen_shadow_off="defaults write com.apple.screencapture 'disable-shadow' -bool 'true'" 155 + 156 + # count lines of code 157 + alias lines="cloc" 158 + 159 + # bat-kat 160 + alias kat="bat" 161 + 162 + # youtube DL mp3 163 + alias ytmp3="noglob yt-dlp -f bestaudio --extract-audio --audio-quality 0 --audio-format mp3 -o '%(title)s.%(ext)s'" 164 + 165 + # youtube DL mp4 166 + alias ytdl="noglob yt-dlp -f best --format mp4 -o '%(title)s.%(ext)s'" 167 + 168 + # best quality 169 + alias bestdl="noglob yt-dlp -f 'bestvideo[ext=mp4]+bestaudio[ext=m4a]/best[ext=mp4]/best' --format mp4 -o '%(title)s.%(ext)s'" 170 + 171 + # disable globbing 172 + alias s3mp3="noglob s3mp3" 173 + alias gencov="noglob generate_cover" 174 + 175 + function s3yt { 176 + s3mp3 "https://youtu.be/$1" 177 + } 178 + 179 + function s3ls { 180 + mc ls "s3/$1" 181 + } 182 + 183 + function s3mls { 184 + s3ls "mp3-embed/$1" 185 + } 186 + 187 + # youtube DL cover art 188 + alias ytcov="ytmp3 --add-metadata --ppa \"ThumbnailsConvertor+ffmpeg_o:-c:v png -vf crop='ih'\" --embed-thumbnail --postprocessor-args \"-id3v2_version 3\" -o \"%(uploader)s/%(title)s.%(ext)s\"" 189 + 190 + # android studio path 191 + export ANDROID_HOME=/Users/themackabu/Library/Android/sdk 192 + export PATH=$PATH:$ANDROID_HOME/emulator 193 + export PATH=$PATH:$ANDROID_HOME/platform-tools 194 + 195 + # Wasmer 196 + export WASMTIME_HOME="$HOME/.wasmtime" 197 + export PATH="$WASMTIME_HOME/bin:$PATH" 198 + export WASMER_DIR="/Users/themackabu/.wasmer" 199 + [ -s "$WASMER_DIR/wasmer.sh" ] && source "$WASMER_DIR/wasmer.sh" 200 + 201 + # llvm 202 + export PATH="/opt/homebrew/opt/llvm/bin:$PATH" 203 + export LDFLAGS="-L/opt/homebrew/opt/llvm/lib/c++ -Wl,-rpath,/opt/homebrew/opt/llvm/lib/c++" 204 + export LDFLAGS="-L/opt/homebrew/opt/llvm/lib" 205 + export CPPFLAGS="-I/opt/homebrew/opt/llvm/include" 206 + 207 + # postgres lib 208 + export PATH="/opt/homebrew/opt/postgresql@16/bin:$PATH" 209 + export LDFLAGS="-L/opt/homebrew/opt/libpq/lib" 210 + export CPPFLAGS="-I/opt/homebrew/opt/libpq/include" 211 + 212 + # modular 213 + export MODULAR_HOME="$HOME/.modular" 214 + export PATH="$MODULAR_HOME/pkg/packages.modular.com_mojo/bin:$PATH" 215 + 216 + # java latest version 217 + export JAVA_TOOL_OPTIONS="--enable-preview" 218 + 219 + # arc browser 220 + alias arc="open -a Arc.app --args --disable-blink-features=PrettyPrintJSONDocument" 221 + 222 + # cargo 223 + # export CARGO_REGISTRIES_CRATES_IO_PROTOCOL="git cargo fetch" 224 + # export CARGO_REGISTRIES_CRATES_IO_PROTOCOL="git cargo upgrade" 225 + # export CARGO_NET_GIT_FETCH_WITH_CLI=true 226 + # export CARGO_REGISTRIES_CRATES_IO_PROTOCOL=git 227 + 228 + # rust nova path 229 + export RA_PATH="/Users/themackabu/.cargo/bin/rust-analyzer" 230 + 231 + # thefuck autocorrect 232 + eval $(thefuck --alias) 233 + 234 + # broot 235 + source /Users/themackabu/.config/broot/launcher/bash/br 236 + 237 + # fastfetch 238 + alias ff="fastfetch --cpu-temp --gpu-temp --battery-temp" 239 + alias neofetch="fastfetch --cpu-temp --gpu-temp --battery-temp" 240 + alias lnconfig="~/.config/fastfetch/link_config.sh" 241 + 242 + # piracy.mp3 243 + function car { 244 + tr A-Z a-z <<< "$1" | sed -e 's/[^ ]/:pi8&:/g' -e 's/ /:pi8blank:/g' 245 + } 246 + 247 + # link homebrew items that aren't in path 248 + function blink { 249 + local targetdir 250 + targetdir=($(brew --cellar $1)/*/bin) || return 251 + local linksdir=$(brew --repo)/bin 252 + 253 + for ex in $(find "$targetdir" -type f -maxdepth 1); do 254 + local exname=${ex##*/} 255 + if builtin which "$exname" &>/dev/null; then 256 + echo " $exname already available in the path - skipped" 257 + else 258 + ln -s "$ex" "$linksdir/" && echo "$exname linked from $linksdir" 259 + fi 260 + done 261 + } 262 + 263 + # ampere simple ssh 264 + alias ampere="ssh ampere -t" 265 + 266 + # command handler 267 + function command_not_found_handler() { 268 + if [[ $1 == "ampere-"* ]]; then 269 + cmd=${1#ampere-} 270 + ampere "$cmd" 271 + return 0 272 + fi 273 + 274 + echo "zsh: command not found: $1" 275 + return 127 276 + } 277 + 278 + # git branch remote cleanup 279 + clean_local_branches() { 280 + local remote=${1:-origin} 281 + 282 + for branch in $(git branch | sed 's/\*//'); do 283 + if [ -z "$(git branch --all | grep $remote | grep $branch)" ]; then 284 + git branch -D $branch 285 + fi 286 + done 287 + } 288 + 289 + # handle meowing 290 + _meow_handler() { [ $# -gt 0 ] && $HOME/.cargo/bin/meow "$@" || echo "meow"; } 291 + 292 + # lm studio 293 + export PATH="$PATH:/Users/themackabu/.lmstudio/bin" 294 + 295 + # moon monorepo 296 + export PATH="/Users/themackabu/.moon/bin:$PATH" 297 + 298 + # cargo-mommy 299 + alias cargo="cargo mommy" 300 + 301 + export CARGO_MOMMYS_ROLES="mommy" 302 + export CARGO_MOMMYS_PRONOUNS="her" 303 + export CARGO_MOMMYS_LITTLE="boy/pet/kitty/sharky/cutie" 304 + export CARGO_MOMMYS_EMOTES="❤️/💖/💗/💓/💞/:3"