1
0
Fork 0
mirror of https://github.com/notwa/rc synced 2024-06-01 23:43:07 -07:00
rc/home/shrc.zsh

75 lines
2.2 KiB
Bash
Raw Normal View History

2013-06-28 05:22:14 -07:00
# for both zsh and bash
umask 027 # screw others
2013-07-01 02:22:36 -07:00
ADDPATH() {
grep ":$1:" <<<":$PATH:" >/dev/null || export PATH="$PATH:$1"
}
ADDPATH "$HOME/opt/local/bin"
2013-06-29 11:47:01 -07:00
2013-07-04 03:18:03 -07:00
ify() {
[ $# -ge 2 ] || return
local ex=$1
shift
$@ | $ex
}
2014-02-14 08:05:48 -08:00
has() { which "$1" >/dev/null 2>&1 && which "$1"; }
2013-09-15 20:33:04 -07:00
2013-06-29 11:47:01 -07:00
# cleanup in case of inherited exports
for x in AR CC CPP CXX CFLAGS CPPFLAGS CXXFLAGS LDFLAGS RANLIB RC WINDRES; do
2013-11-11 15:11:22 -08:00
unset $x
2013-06-29 11:47:01 -07:00
done
2013-06-28 05:22:14 -07:00
export PREFIX="$HOME/opt/local"
2013-09-15 20:33:04 -07:00
export CC="$(has clang || has gcc)"
export CXX="$(has clang || has g++)"
2013-06-28 05:22:14 -07:00
export CFLAGS='-march=native -O2'
export LDFLAGS='-Wl,-O1,--sort-common,-z,relro'
export CFLAGS="$CFLAGS -I'$HOME/opt/local/include'"
export LDFLAGS="$LDFLAGS -L'$HOME/opt/local/lib'"
export CXXFLAGS="$CFLAGS"
2013-06-28 05:22:14 -07:00
export LD_LIBRARY_PATH= # -n isn't an option in zsh's export
2014-01-14 09:17:22 -08:00
export MAKEFLAGS="-j2"
2013-06-28 05:22:14 -07:00
export EDITOR='vim -p'
export GOPATH="$HOME/go"
# colors
for x in ls dir vdir grep fgrep egrep; do
alias $x="$x --color=auto"
done
2013-11-11 15:11:22 -08:00
#alias make="$(has colormake || has make)"
2013-06-28 05:22:14 -07:00
# just flags
export LESS='-SR'
2013-06-29 11:47:01 -07:00
alias makedbg='CFLAGS="-O0" LDFLAGS="-g" make'
2013-06-28 05:22:14 -07:00
alias fils="du -bad1"
alias lsfm="lsf -ugpms"
alias lsa="ls -A --group-directories-first"
alias logs="logs -o cat -b -e"
alias logsf="logs -f"
2013-07-09 18:15:19 -07:00
alias diff="git diff --color=auto --no-ext-diff --no-index"
2013-06-28 05:22:14 -07:00
# being specific
2013-07-04 01:39:44 -07:00
alias erc="e ~/.zshrc ~/shrc.zsh ~/.bashrc ~/.vimrc"
2013-06-28 05:22:14 -07:00
alias irc="screen -dR irc irssi"
alias crawl='screen -dR crawl ssh crawl@crawl.develz.org -i ~/.ssh/crawl'
alias crawla='screen -dR crawl ssh crawl@crawl.akrasiac.org -l joshua -i ~/.ssh/crawl'
# providing extra functionality
# TODO: dotfiles first, like `LC_ALL=C ls -A` which doesnt work with -X flag
2013-07-04 03:18:03 -07:00
alias ll="ify less ls -ACX --group-directories-first --color=force"
2013-06-28 05:22:14 -07:00
alias counts='find . | wc -l'
alias exts='print -l *(:e:l) | sort | uniq -c | sort -n'
alias meow='( cd ~/play/meow; ~/sh/meow.sh/run -pa )'
alias nocom='grep -oP --line-buffered --color=never "^[^#]+"'
2013-07-04 03:18:03 -07:00
alias unwrap='awk '\''BEGIN{RS="\n\n";FS="\n"}{for(i=1;i<=NF;i++)printf "%s ",$i;print "\n"}'\'
2013-07-04 02:56:57 -07:00
alias picky='{ pacman -Qgq base base-devel | tee -; pacman -Qtnq; } | sort | uniq -u'
2013-06-28 05:22:14 -07:00
alias unused='{ pacman -Qt; pacman -Qe | tee -; } | sort | uniq -u'
2013-11-11 15:11:22 -08:00
#. ~/mingw.sh
2013-06-28 05:22:14 -07:00
. ~/sh/lsf.sh/lsf.sh
. ~/sh/z/z.sh