Make all aliases optional (a la plugins)

This continues a pattern that was introduced in ffa45b0 and refined
further in later commits.  This enables all aliases by default, but can
be disabled by any user if they remove the appropriate
aliases/enabled/*.bash file.
This commit is contained in:
Travis Swicegood
2011-06-12 19:44:27 -05:00
parent 279b60e26f
commit ef42010c7b
13 changed files with 7 additions and 1 deletions

View File

@@ -0,0 +1,3 @@
#!/bin/bash
alias em="open -a emacs"

View File

@@ -0,0 +1,73 @@
#!/bin/bash
# List directory contents
alias sl=ls
alias ls='ls -G' # Compact view, show colors
alias la='ls -AF' # Compact view, show hidden
alias ll='ls -al'
alias l='ls -a'
alias l1='ls -1'
alias _="sudo"
if [ $(uname) = "Linux" ]
then
alias ls="ls --color=always"
fi
alias c='clear'
alias k='clear'
alias cls='clear'
alias edit="$EDITOR"
alias pager="$PAGER"
alias q="exit"
alias irc="$IRC_CLIENT"
alias rb="ruby"
# Pianobar can be found here: http://github.com/PromyLOPh/pianobar/
alias piano="pianobar"
alias ..='cd ..' # Go up one directory
alias ...='cd ../..' # Go up two directories
alias -- -="cd -" # Go back
# Shell History
alias h='history'
# Tree
alias tree="find . -print | sed -e 's;[^/]*/;|____;g;s;____|; |;g'"
# Directory
alias md='mkdir -p'
alias rd=rmdir
function aliases-help() {
echo "Generic Alias Usage"
echo
echo " sl = ls"
echo " ls = ls -G"
echo " la = ls -AF"
echo " ll = ls -al"
echo " l = ls -a"
echo " c/k/cls = clear"
echo " .. = cd .."
echo " ... = cd ../.."
echo " - = cd -"
echo " h = history"
echo " md = mkdir -p"
echo " rd = rmdir"
echo " editor = $EDITOR"
echo " pager = $PAGER"
echo " piano = pianobar"
echo " q = exit"
echo " irc = $IRC_CLIENT"
echo " md = mkdir -p"
echo " rd = rmdir"
echo " rb = ruby"
echo
}

View File

@@ -0,0 +1,73 @@
#!/bin/bash
# Aliases
alias gcl='git clone'
alias ga='git add'
alias gall='git add .'
alias g='git'
alias get='git'
alias gst='git status'
alias gs='git status'
alias gss='git status -s'
alias gl='git pull'
alias gup='git fetch && git rebase'
alias gp='git push'
alias gpo='git push origin'
alias gdv='git diff -w "$@" | vim -R -'
alias gc='git commit -v'
alias gca='git commit -v -a'
alias gci='git commit --interactive'
alias gb='git branch'
alias gba='git branch -a'
alias gcount='git shortlog -sn'
alias gcp='git cherry-pick'
alias gco='git checkout'
alias gexport='git archive --format zip --output'
alias gdel='git branch -D'
alias gmu='git fetch origin -v; git fetch upstream -v; git merge upstream/master'
alias gll='git log --graph --pretty=oneline --abbrev-commit'
case $OSTYPE in
linux*)
alias gd='git diff | vim -R -'
;;
darwin*)
alias gd='git diff | mate'
;;
darwin*)
alias gd='git diff'
;;
esac
function git-help() {
echo "Git Custom Aliases Usage"
echo
echo " gcl = git clone"
echo " g = git"
echo " get = git"
echo " ga = git add"
echo " gall = git add ."
echo " gst/gs = git status"
echo " gss = git status -s"
echo " gl = git pull"
echo " gup = git fetch && git rebase"
echo " gp = git push"
echo " gd = git diff | mate"
echo " gdv = git diff -w \"$@\" | vim -R -"
echo " gc = git commit -v"
echo " gca = git commit -v -a"
echo " gci = git commit --interactive"
echo " gb = git branch"
echo " gba = git branch -a"
echo " gcount = git shortlog -sn"
echo " gcp = git cherry-pick"
echo " gco = git checkout"
echo " gexport = git git archive --format zip --output"
echo " gdel = git branch -D"
echo " gpo = git push origin"
echo " gmu = git fetch origin -v; git fetch upstream -v; git merge upstream/master"
echo " gll = git log --graph --pretty=oneline --abbrev-commit"
echo
}

View File

@@ -0,0 +1,56 @@
#!/bin/bash
# heroku
alias h='heroku'
alias hl='heroku list'
alias hi='heroku info'
alias ho='heroku open'
# dynos and workers
alias hd='heroku dynos'
alias hw='heroku workers'
# rake console
alias hr='heroku rake'
alias hcon='heroku console'
# new and restart
alias hnew='heroku create'
alias hrestart='heroku restart'
# logs
alias hlog='heroku logs'
alias hlogs='heroku logs'
# maint
alias hon='heroku maintenance:on'
alias hoff='heroku maintenance:off'
# heroku configs
alias hc='heroku config'
alias hca='heroku config:add'
alias hcr='heroku config:remove'
alias hcc='heroku config:clear'
function heroku-help() {
echo "Heroku Aliases Usage"
echo
echo " h = heroku"
echo " hl = heroku list"
echo " hi = heroku info"
echo " ho = heroku open"
echo " hd = heroku dynos"
echo " hw = heroku workers"
echo " hr = heroku rake"
echo " hcon = heroku console"
echo " hnew = heroku create"
echo " hrestart = heroku restart"
echo " hlog = heroku logs"
echo " hon = heroku maintenance:on"
echo " hoff = heroku maintenance:off"
echo " hc = heroku config"
echo " hca = heroku config:add"
echo " hcr = heroku config:remove"
echo " hcc = heroku config:clear"
echo
}

View File

@@ -0,0 +1,14 @@
#!/bin/bash
alias hs='hg status'
alias hsum='hg summary'
alias hcm='hg commit -m'
function hg-help() {
echo "Mercurial Alias Help"
echo
echo " hs = hg status"
echo " hsum = hg summary"
echo " hcm = hg commit -m"
echo
}

View File

@@ -0,0 +1,20 @@
# Open the root of your site in your vim or builtin cd to it
if [[ $EDITOR = "vim" ]]
then
alias newentry="builtin cd $JEKYLL_LOCAL_ROOT && $EDITOR ."
else
alias newentry="builtin cd $JEKYLL_LOCAL_ROOT"
fi
# Build and locally serve the site
alias testsite="builtin cd $JEKYLL_LOCAL_ROOT && jekyll --server --auto"
# Build but don't locally serve the site
alias buildsite="builtin cd $JEKYLL_LOCAL_ROOT && rm -rf _site/ && jekyll"
# Rsync the site to the remote server
alias deploysite="builtin cd $JEKYLL_LOCAL_ROOT && rsync -rz _site/ $JEKYLL_REMOTE_ROOT"

View File

@@ -0,0 +1,20 @@
#!/bin/bash
# Desktop Programs
alias fireworks="open -a '/Applications/Adobe Fireworks CS3/Adobe Fireworks CS3.app'"
alias photoshop="open -a '/Applications/Adobe Photoshop CS3/Adobe Photoshop.app'"
alias preview="open -a '$PREVIEW'"
alias xcode="open -a '/Developer/Applications/Xcode.app'"
alias filemerge="open -a '/Developer/Applications/Utilities/FileMerge.app'"
alias safari="open -a safari"
alias firefox="open -a firefox"
alias chrome="open -a google\ chrome"
alias chromium="open -a chromium"
alias dashcode="open -a dashcode"
alias f='open -a Finder '
alias textedit='open -a TextEdit'
alias hex='open -a "Hex Fiend"'
if [ -s /usr/bin/firefox ] ; then
unalias firefox
fi

View File

@@ -0,0 +1,42 @@
#!/bin/bash
# Rails Commands
alias r='rails'
alias rg='rails g'
alias rs='rails s'
alias rc='rails c'
alias rn='rails new'
alias rd='rails dbconsole'
alias rp='rails plugin'
alias ra='rails application'
alias rd='rails destroy'
alias dbm='rake db:migrate'
alias ss='script/server'
alias ts="thin start" # thin server
alias sc='script/console'
alias restartapp='touch tmp/restart.txt'
alias restart='touch tmp/restart.txt' # restart passenger
alias devlog='tail -f log/development.log'
alias taild='tail -f log/development.log' # tail dev log
function rails-help() {
echo "Rails Aliases Usage"
echo
echo " r = rails"
echo " rg = rails generate"
echo " rs/ss = rails server"
echo " ts = thin server"
echo " rc/sc = rails console"
echo " rn = rails new"
echo " rd = rails dbconsole"
echo " rp = rails plugin"
echo " ra = rails application"
echo " rd = rails destroy"
echo " restartapp = touch tmp/restart.txt"
echo " restart = touch tmp/restart.txt"
echo " devlog = tail -f log/development.log"
echo " taild = tail -f log/development.log"
echo
}

View File

@@ -0,0 +1,5 @@
#!/bin/bash
# Textmate
alias e='mate . &'
alias et='mate app config db lib public script test spec config.ru Gemfile Rakefile README &'

View File

@@ -0,0 +1,19 @@
#!/bin/bash
alias tls="$TODO ls"
alias ta="$TODO a"
alias trm="$TODO rm"
alias tdo="$TODO do"
alias tpri="$TODO pri"
todo-help() {
echo
echo "todo.txt-cli Custom Aliases Usage"
echo
echo " tls = $TODO ls"
echo " ta = $TODO add"
echo " trm = $TODO rm"
echo " tdo = $TODO do"
echo " tpri = $TODO pri"
echo
}

View File

@@ -0,0 +1,3 @@
#!/bin/bash
alias v='mvim --remote-tab'