[zsh] Add support for macos

This commit is contained in:
Lara 2020-02-19 12:14:43 -05:00
parent 17ac8d0685
commit 2b398cea3a
3 changed files with 18 additions and 6 deletions

View file

@ -20,13 +20,18 @@ if which sl > /dev/null 2>&1; then
alias l='sl'
alias lll='sl'
fi
case $(lsb_release -i | awk -F ':\t' '/Distributor ID/{print $2}') in
case $(uname -s) in
Arch)
alias redwm='cd ~/aur/dwm-git; updpkgsums; makepkg -fi --noconfirm; killall dwm'
alias upgrade='sudo pacman -Syu';;
Debian|Ubuntu)
alias upgrade='sudo apt-get update && sudo apt-get -dy dist-upgrade && sudo apt-get dist-upgrade';;
VoidLinux)
alias upgrade='sudo xbps-install -Su';;
Darwin)
if which mvim > /dev/null 2>&1; then
alias vim='mvim -v'
fi;;
esac
alias ll='ls -lha'
alias df='df -h'
@ -43,7 +48,6 @@ alias -g .......='../../../../../..'
alias -g ........='../../../../../../..'
# Hackish tweaks
alias steam-wine="WINEDEBUG=-all wine $WINEPREFIX/drive_c/Program\ Files\ \(x86\)/Steam/Steam.exe -no-dwrite -no-cef-sandbox &"
alias redwm='cd ~/aur/dwm-git; updpkgsums; makepkg -fi --noconfirm; killall dwm'
alias minecraft='java -jar $HOME/.minecraft/launcher.jar'
alias rot13="tr '[A-Za-z]' '[N-ZA-Mn-za-m]'"
alias shuffle='mpv --shuffle --display-tags= --no-audio-display'

View file

@ -1,7 +1,8 @@
#!/bin/sh
SCRIPT=$(readlink -f "$0")
RC_PATH=$(dirname "$SCRIPT")
#SCRIPT=$(readlink -f "$0")
#RC_PATH=$(dirname "$SCRIPT")
RC_PATH=$(cd "$(dirname "$0")"; pwd)
HOST=$(hostname)
XDG_CONFIG_HOME=${XDG_CONFIG_HOME:-$HOME/.config}
XDG_DATA_HOME=${XDG_DATA_HOME:-$HOME/.local/share}

11
zshrc
View file

@ -10,14 +10,21 @@
# Uncomment this line for perfomance analysis
#zmodload zsh/zprof
export PATH="$PATH:/Library/Frameworks/Python.framework/Versions/3.8/bin:/usr/local/bin:/usr/local/sbin:/usr/sbin:/sbin"
# Get rc dir path
RC_PATH=$(dirname "$(readlink -f ${(%):-%x})")
#RC_PATH=$(dirname "$(readlink -f ${(%):-%x})")
# https://stackoverflow.com/questions/9901210/bash-source0-equivalent-in-zsh#comment45012039_23259585
RC_PATH=$(dirname "$(realpath -- "${(%):-%x}")")
export PATH="$PATH:$RC_PATH/bin:~/bin:/opt/cuda/bin:~/.cargo/bin:~/go/bin"
export PATH="$PATH:/usr/local/sbin:/usr/sbin:/sbin:$RC_PATH/bin:~/bin:/opt/cuda/bin:~/.cargo/bin:~/go/bin"
# Add ruby gems to path
if which ruby >/dev/null && which gem >/dev/null; then
PATH="$(ruby -r rubygems -e 'puts Gem.user_dir')/bin:$PATH"
fi
# Add emscripten to path
if [ -d "$HOME/emsdk" ]; then
PATH="$PATH:~/emsdk:~/emsdk/node/12.9.1_64bit/bin:~/emsdk/fastcomp/emscripten" #:~/emsdk/fastcomp/emscripten/tools"
fi
export BROWSER='/usr/bin/w3m -T "text/html"'
export EDITOR=/usr/bin/vim
export GPG_TTY="$(tty)"