Skip to content

Commit

Permalink
Bring back aliases and env vars. Setup diff-so-fancy.
Browse files Browse the repository at this point in the history
  • Loading branch information
ijcd committed Sep 24, 2020
1 parent 451c56d commit 123b112
Show file tree
Hide file tree
Showing 4 changed files with 128 additions and 148 deletions.
100 changes: 39 additions & 61 deletions local/alias.zsh
Original file line number Diff line number Diff line change
@@ -1,62 +1,40 @@
# # rails
# #alias ss=spring

# # disk usage with human sizes and minimal depth
# alias du1='du -h --max-depth=1'
# alias fn='find . -name'
# alias h='history | tail -20'
# alias hi='history 1'

# alias jsonpp='python -mjson.tool'

# alias -g mergebase='$(git merge-base master HEAD)'
# alias -g thisbranch='$(git rev-parse --abbrev-ref HEAD)'
# alias -g thisbranch:thisbranch='$(git rev-parse --abbrev-ref HEAD)':'$(git rev-parse --abbrev-ref HEAD)'

# alias rbx="nocorrect rbx"

# # commandlinefu
# alias head='head -n $(($LINES-2))'

# # Mine
# alias e='emacs -nw'
# alias lpr='lpr -h'
# alias space="du -mc | egrep -v '.*/.*/.*' | sort -n"
# #alias cd='echo "pushd" ; pushd . > /dev/null ; echo "cd" ; cd $* ; done'
# #alias cd=cd-ijcd
# alias ud=upd
# alias pd=popd-ijcd
# alias more=less
# alias cvscheck='cvs -n update 2>/dev/null'


# alias hh=heroku
# alias vv=vagrant

# alias gg='cd $(git rev-parse --show-toplevel)'

# # RUBY
# alias rgems='ruby -rubygems'
# alias k='bundle exec knife'
# alias be='bundle exec'
# alias z=zeus
# alias gman='gem man'

# alias xmlcurl="curl -H Accept:text/xml $*"

# # Mercurial mq
# alias mq='hg -R $(hg root)/.hg/patches'

# # git
# alias g="git"
# alias gs="git status"
# alias gb="git branch"
# alias gd="git diff"
# alias gds="git diff --staged"
# alias gdh="git diff HEAD"
# alias grh="git reset HEAD"
# alias gpr="git pull --rebase"

# # Lock the screen (when going AFK)
# alias afk="/System/Library/CoreServices/Menu\ Extras/User.menu/Contents/Resources/CGSession -suspend"
# disk usage with human sizes and minimal depth
alias du1='du -h --max-depth=1'
alias fn='find . -name'
alias h='history | tail -20'
alias hi='history 1'

alias jsonpp='python -mjson.tool'

# https://www.commandlinefu.com/commands/view/5312/alias-head-for-automatic-smart-output
alias head='head -n $((${LINES:-`tput lines 2>/dev/null||echo -n 12`} - 2))'

# Mine
alias lpr='lpr -h'
alias space="du -mc | egrep -v '.*/.*/.*' | sort -n"
alias more=less

# Random
alias xmlcurl="curl -H Accept:text/xml $*"

# git
alias g="git"
alias gs="git status"
alias gb="git branch"
alias gd="git diff"
alias gds="git diff --staged"
alias gdh="git diff HEAD"
alias grh="git reset HEAD"
alias gpr="git pull --rebase"

# git merge shortcuts
alias -g mergebase='$(git merge-base master HEAD)'
alias -g thisbranch='$(git rev-parse --abbrev-ref HEAD)'
alias -g thisbranch:thisbranch='$(git rev-parse --abbrev-ref HEAD)':'$(git rev-parse --abbrev-ref HEAD)'

# git cd to root
alias gg='cd $(git rev-parse --show-toplevel)'

# Lock the screen (when going AFK)
alias afk="/System/Library/CoreServices/Menu\ Extras/User.menu/Contents/Resources/CGSession -suspend"

172 changes: 86 additions & 86 deletions local/env.zsh
Original file line number Diff line number Diff line change
@@ -1,40 +1,40 @@
# # the basics
# : ${HOME=~}
# : ${LOGNAME=$(id -un)}
# : ${UNAME=$(uname)}
# the basics
: ${HOME=~}
: ${LOGNAME=$(id -un)}
: ${UNAME=$(uname)}

# # complete hostnames from this file
# : ${HOSTFILE=~/.ssh/known_hosts}
# complete hostnames from this file
: ${HOSTFILE=~/.ssh/known_hosts}

# # readline config
# : ${INPUTRC=~/.inputrc}
# readline config
: ${INPUTRC=~/.inputrc}

# # enable en_US locale w/ utf-8 encodings if not already configured
# : ${LANG:="en_US.UTF-8"}
# : ${LANGUAGE:="en"}
# : ${LC_CTYPE:="en_US.UTF-8"}
# : ${LC_ALL:="en_US.UTF-8"}
# export LANG LANGUAGE LC_CTYPE LC_ALL
# enable en_US locale w/ utf-8 encodings if not already configured
: ${LANG:="en_US.UTF-8"}
: ${LANGUAGE:="en"}
: ${LC_CTYPE:="en_US.UTF-8"}
: ${LC_ALL:="en_US.UTF-8"}
export LANG LANGUAGE LC_CTYPE LC_ALL

# # always use PASSIVE mode ftp
# : ${FTP_PASSIVE:=1}
# export FTP_PASSIVE
# always use PASSIVE mode ftp
: ${FTP_PASSIVE:=1}
export FTP_PASSIVE

# # ignore backups, CVS directories, python bytecode, vim swap files
# FIGNORE="~:CVS:#:.pyc:.swp:.swa:apache-solr-*"
# ignore backups, CVS directories, python bytecode, vim swap files
FIGNORE="~:CVS:#:.pyc:.swp:.swa:apache-solr-*"

# # history stuff
# HISTCONTROL=ignoreboth
# HISTFILESIZE=10000
# HISTSIZE=10000
# history stuff
HISTCONTROL=ignoreboth
HISTFILESIZE=10000
HISTSIZE=10000

# # ----------------------------------------------------------------------
# # PAGER / EDITOR
# # ----------------------------------------------------------------------
# ----------------------------------------------------------------------
# PAGER / EDITOR
# ----------------------------------------------------------------------

# # See what we have to work with ...
# HAVE_VIM=$(command -v vim)
# HAVE_GVIM=$(command -v gvim)
# See what we have to work with ...
HAVE_VIM=$(command -v vim)
HAVE_GVIM=$(command -v gvim)

# # EDITOR
# test -n "$HAVE_VIM" && EDITOR=vim || EDITOR=vi
Expand All @@ -50,60 +50,60 @@
# fi
# export PAGER MANPAGER

# # Ack
# ACK_PAGER="$PAGER"
# ACK_PAGER_COLOR="$PAGER"

# # Identity
# export EMAIL="[email protected]"
# export FULLNAME="Ian Duggan"

# # Prevent ZSH from stating all of Maildir
# export MAILCHECK=0

# # Debian
# export DEBEMAIL=$EMAIL
# export DEBFULLNAME=$FULLNAME

# # Git
# export GIT_AUTHOR_NAME=$FULLNAME
# export GIT_COMMITTER_NAME=$FULLNAME
# export GIT_AUTHOR_EMAIL=$EMAIL
# export GIT_COMMITTER_EMAIL=$EMAIL

# # Irc
# export IRCNICK=ijcd
# export IRCNAME=${FULLNAME}
# export IRCSERVER=irc.freenode.net
# export IRC_SERVERS_FILE="$HOME/.irc-serv"

# # Rsync stuff
# export RSYNC_RSH=ssh

# # CVS Stuff
# export CVS_RSH=ssh
# export CVSEDITOR=$EDITOR
# export CVSREAD=yes

# export CCACHE_DIR=$HOME/.ccache
# export CTAGS="--c++-kinds=+p --fields=+iaS --extra=+q"

# # Amazon
# export EC2_HOME=~/lib/ec2/ec2-api-tools
# export EC2_AMITOOL_HOME=~/lib/ec2/ec2-ami-tools
# export EC2_PRIVATE_KEY=~/.ssh/ec2/ijcd/pk-C2NZMJYCC4RZ32VD6PT4LMFTNUUTSEJZ.pem
# export EC2_CERT=~/.ssh/ec2/ijcd/cert-C2NZMJYCC4RZ32VD6PT4LMFTNUUTSEJZ.pem

# export ANT_OPTS="-DXms=1024M -DXmx=1024M -XX:+UseParallelGC"
# export MAVEN_OPTS="-Xmx1024m"
# export CATALINA_OPTS="-Xms512M -Xmx1024M -XX:PermSize=256M -XX:MaxPermSize=1024M"

# # Workflow Stuff
# export INBOX=~/Desktop/Inbox
# export OUTBOX=~/Desktop/Outbox
# export PENDING=~/Desktop/Pending
# export I=$INBOX
# export O=$OUTBOX
# export P=$PENDING

# export GNUTERM=x11
# Ack
ACK_PAGER="$PAGER"
ACK_PAGER_COLOR="$PAGER"

# Identity
export EMAIL="[email protected]"
export FULLNAME="Ian Duggan"

# Prevent ZSH from stating all of Maildir
export MAILCHECK=0

# Debian
export DEBEMAIL=$EMAIL
export DEBFULLNAME=$FULLNAME

# Git
export GIT_AUTHOR_NAME=$FULLNAME
export GIT_COMMITTER_NAME=$FULLNAME
export GIT_AUTHOR_EMAIL=$EMAIL
export GIT_COMMITTER_EMAIL=$EMAIL

# Irc
export IRCNICK=ijcd
export IRCNAME=${FULLNAME}
export IRCSERVER=irc.freenode.net
export IRC_SERVERS_FILE="$HOME/.irc-serv"

# Rsync stuff
export RSYNC_RSH=ssh

# CVS Stuff
export CVS_RSH=ssh
export CVSEDITOR=$EDITOR
export CVSREAD=yes

export CCACHE_DIR=$HOME/.ccache
export CTAGS="--c++-kinds=+p --fields=+iaS --extra=+q"

# Amazon
export EC2_HOME=~/lib/ec2/ec2-api-tools
export EC2_AMITOOL_HOME=~/lib/ec2/ec2-ami-tools
export EC2_PRIVATE_KEY=~/.ssh/ec2/ijcd/pk-C2NZMJYCC4RZ32VD6PT4LMFTNUUTSEJZ.pem
export EC2_CERT=~/.ssh/ec2/ijcd/cert-C2NZMJYCC4RZ32VD6PT4LMFTNUUTSEJZ.pem

export ANT_OPTS="-DXms=1024M -DXmx=1024M -XX:+UseParallelGC"
export MAVEN_OPTS="-Xmx1024m"
export CATALINA_OPTS="-Xms512M -Xmx1024M -XX:PermSize=256M -XX:MaxPermSize=1024M"

# Workflow Stuff
export INBOX=~/Desktop/Inbox
export OUTBOX=~/Desktop/Outbox
export PENDING=~/Desktop/Pending
export I=$INBOX
export O=$OUTBOX
export P=$PENDING

export GNUTERM=x11
2 changes: 1 addition & 1 deletion modules/git/gitconfig
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@
# Make `git rebase` safer on OS X
# More info: <http://www.git-tower.com/blog/make-git-rebase-safe-on-osx/>
trustctime = false
pager = diff-so-fancy | less --tabs=4 -RFX
pager = diff-so-fancy | less --tabs=4 -RFX


#[color]
Expand Down
2 changes: 2 additions & 0 deletions modules/highlighting/init.zsh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# https://github.com/zsh-users/zsh-syntax-highlighting/issues/513
export ZSH_HIGHLIGHT_MAXLENGTH=60

0 comments on commit 123b112

Please sign in to comment.