This commit is contained in:
Fergal Moran
2015-08-20 11:06:20 +01:00
5 changed files with 238 additions and 4 deletions

View File

@@ -4,7 +4,8 @@ alias djrun="python manage.py runserver 0.0.0.0:8000"
alias djshell="python manage.py shell_plus --use-pythonrc --ipython"
alias dbshell="python manage.py dbshell"
alias djmigrate="python manage.py schemamigration spa --auto"
alias dss="cd ~/Dropbox/development/deepsouthsounds.com/dss.api && workon dssapi"
alias dss="cd ~/Dropbox/development/deepsouthsounds.com/dss.api && workon dss"
alias pgdo="sudo -u postgres"
alias reloadbashrc="source ~/.bashrc"
alias rmdb="find . -name \*\'s\ conflicted\ copy\ \* -exec rm {} \;"

3
bash_functions Normal file
View File

@@ -0,0 +1,3 @@
function pips() {
echo $'\n'$1 >> requirements.txt; pip install $1
}

9
bashrc
View File

@@ -113,9 +113,14 @@ if ! shopt -oq posix; then
fi
fi
# Include functions file
if [ -f ~/.bash_functions ]; then
source ~/.bash_functions
fi
export ANDROID_SDK=/opt/android-sdk-linux/
export PATH=$PATH:/opt/android-sdk-linux/tools:/opt/android-sdk-linux/platform-tools/
export PATH=$PATH:/opt/android-sdk-linux/tools:/opt/android-sdk-linux/platform-tools/:/opt/genymotion
export SENCHA_CMD_3_0_0="/home/fergalm/dev/sencha/Sencha/Cmd/4.0.0.203"
export PATH=$SENCHA_CMD_3_0_0:~/bin/:$PATH
export OPENNI2_INCLUDE=/home/fergalm/dev/kinect/lib/OpenNI-Linux-x64-2.2/Include
@@ -124,7 +129,7 @@ export WORKON_HOME=~/.virtualenvs
. /usr/local/bin/virtualenvwrapper.sh
. ~/dotfiles/z.sh
source ~/.bash_prompt
source ~/dotfiles/git-flow-completion.bash
export HISTCONTROL=ignoredups:erasedups # no duplicate entries
export HISTSIZE=100000 # big big history

225
git-flow-completion.bash Normal file
View File

@@ -0,0 +1,225 @@
#!bash
#
# git-flow-completion
# ===================
#
# Bash completion support for [git-flow](http://github.com/nvie/gitflow)
#
# The contained completion routines provide support for completing:
#
# * git-flow init and version
# * feature, hotfix and release branches
# * remote feature, hotfix and release branch names
#
#
# Installation
# ------------
#
# To achieve git-flow completion nirvana:
#
# 0. Install git-completion.
#
# 1. Install this file. Either:
#
# a. Place it in a `bash-completion.d` folder:
#
# * /etc/bash-completion.d
# * /usr/local/etc/bash-completion.d
# * ~/bash-completion.d
#
# b. Or, copy it somewhere (e.g. ~/.git-flow-completion.sh) and put the following line in
# your .bashrc:
#
# source ~/.git-flow-completion.sh
#
# 2. If you are using Git < 1.7.1: Edit git-completion.sh and add the following line to the giant
# $command case in _git:
#
# flow) _git_flow ;;
#
#
# The Fine Print
# --------------
#
# Copyright (c) 2010-2015 [Justin Hileman](http://justinhileman.com)
#
# Distributed under the [MIT License](http://creativecommons.org/licenses/MIT/)
_git_flow ()
{
local subcommands="init feature release hotfix support help version"
local subcommand="$(__git_find_on_cmdline "$subcommands")"
if [ -z "$subcommand" ]; then
__gitcomp "$subcommands"
return
fi
case "$subcommand" in
init)
__git_flow_init
return
;;
feature)
__git_flow_feature
return
;;
release)
__git_flow_release
return
;;
hotfix)
__git_flow_hotfix
return
;;
support)
__git_flow_support
return
;;
*)
COMPREPLY=()
;;
esac
}
__git_flow_init ()
{
local subcommands="help"
local subcommand="$(__git_find_on_cmdline "$subcommands")"
if [ -z "$subcommand" ]; then
__gitcomp "$subcommands"
return
fi
}
__git_flow_feature ()
{
local subcommands="list start finish publish track diff rebase checkout pull help"
local subcommand="$(__git_find_on_cmdline "$subcommands")"
if [ -z "$subcommand" ]; then
__gitcomp "$subcommands"
return
fi
case "$subcommand" in
pull)
__gitcomp "$(__git_remotes)"
return
;;
checkout|finish|diff|rebase)
__gitcomp "$(__git_flow_list_branches 'feature')"
return
;;
publish)
__gitcomp "$(comm -23 <(__git_flow_list_branches 'feature') <(__git_flow_list_remote_branches 'feature'))"
return
;;
track)
__gitcomp "$(comm -23 <(__git_flow_list_remote_branches 'feature') <(__git_flow_list_branches 'feature'))"
return
;;
*)
COMPREPLY=()
;;
esac
}
__git_flow_release ()
{
local subcommands="list start finish track publish help"
local subcommand="$(__git_find_on_cmdline "$subcommands")"
if [ -z "$subcommand" ]; then
__gitcomp "$subcommands"
return
fi
case "$subcommand" in
finish)
__gitcomp "$(__git_flow_list_branches 'release')"
return
;;
publish)
__gitcomp "$(comm -23 <(__git_flow_list_branches 'release') <(__git_flow_list_remote_branches 'release'))"
return
;;
track)
__gitcomp "$(comm -23 <(__git_flow_list_remote_branches 'release') <(__git_flow_list_branches 'release'))"
return
;;
*)
COMPREPLY=()
;;
esac
}
__git_flow_hotfix ()
{
local subcommands="list start finish track publish help"
local subcommand="$(__git_find_on_cmdline "$subcommands")"
if [ -z "$subcommand" ]; then
__gitcomp "$subcommands"
return
fi
case "$subcommand" in
finish)
__gitcomp "$(__git_flow_list_branches 'hotfix')"
return
;;
publish)
__gitcomp "$(comm -23 <(__git_flow_list_branches 'hotfix') <(__git_flow_list_remote_branches 'hotfix'))"
return
;;
track)
__gitcomp "$(comm -23 <(__git_flow_list_remote_branches 'hotfix') <(__git_flow_list_branches 'hotfix'))"
return
;;
*)
COMPREPLY=()
;;
esac
}
__git_flow_support ()
{
local subcommands="list start help"
local subcommand="$(__git_find_on_cmdline "$subcommands")"
if [ -z "$subcommand" ]; then
__gitcomp "$subcommands"
return
fi
case "$subcommand" in
*)
COMPREPLY=()
;;
esac
}
__git_flow_prefix ()
{
case "$1" in
feature|release|hotfix)
git config "gitflow.prefix.$1" 2> /dev/null || echo "$1/"
return
;;
esac
}
__git_flow_list_branches ()
{
local prefix="$(__git_flow_prefix $1)"
git branch --no-color 2> /dev/null | tr -d ' |*' | grep --color=never "^$prefix" | sed s,^$prefix,, | sort
}
__git_flow_list_remote_branches ()
{
local prefix="$(__git_flow_prefix $1)"
local origin="$(git config gitflow.origin 2> /dev/null || echo "origin")"
git branch --no-color -r 2> /dev/null | sed "s/^ *//g" | grep --color=never "^$origin/$prefix" | sed s,^$origin/$prefix,, | sort
}
# alias __git_find_on_cmdline for backwards compatibility
if [ -z "`type -t __git_find_on_cmdline`" ]; then
alias __git_find_on_cmdline=__git_find_subcommand
fi

View File

@@ -6,7 +6,7 @@ h
dir=~/dotfiles # dotfiles directory
olddir=~/dotfiles_old # old dotfiles backup directory
files="bashrc bash_aliases bash_profile bash_prompt" # list of files/folders to symlink in homedir
files="bashrc bash_aliases bash_profile bash_prompt bash_functions" # list of files/folders to symlink in homedir
##########