Merge remote-tracking branch 'origin/master'

This commit is contained in:
Eryn Wells 2012-11-27 16:24:52 -08:00
commit a63455927c
20 changed files with 67 additions and 8 deletions

1
.gitignore vendored
View file

@ -1 +1,2 @@
zsh/cache/
vim/view/

View file

@ -0,0 +1,3 @@
Django==1.4.1
dj-database-url==0.2.1
virtualenv==1.7.2

View file

@ -1,3 +0,0 @@
DATABASE_URL=sqlite://localhost/local.db
SECRET_KEY={{ secret_key }}
DEBUG=True

View file

@ -13,7 +13,7 @@ vimbundles=( \
command-t "https://github.com/wincent/Command-T.git" \
gundo "https://github.com/sjl/gundo.vim.git" \
repeat "https://github.com/tpope/vim-repeat" \
snipmate "https://github.com/msanders/snipmate.vim.git" \
snipmate "https://github.com/garbas/vim-snipmate.git" \
solarized "https://github.com/altercation/vim-colors-solarized.git" \
speeddating "https://github.com/tpope/vim-speeddating.git" \
surround "https://github.com/tpope/vim-surround.git" \

View file

@ -1,4 +1,4 @@
set-option -g prefix C-b
set-option -g prefix C-f
set-option -g exit-unattached off
set-option -g default-terminal "screen-256color"
set-option -g set-titles off

View file

@ -2,3 +2,6 @@ setlocal shiftwidth=2
setlocal softtabstop=2
setlocal listchars-=tab:▸\
setlocal nowrap
setlocal tw=0
setlocal colorcolumn=100

View file

@ -1,6 +1,10 @@
setlocal shiftwidth=4
setlocal softtabstop=4
setlocal expandtab
setlocal textwidth=100
setlocal colorcolumn=100
"setlocal foldnestmax=3
"setlocal fdm=indent
setlocal textwidth=80
setlocal makeprg="pylint -f parseable %"

51
zsh/func/makers/mkdjango Normal file
View file

@ -0,0 +1,51 @@
#!/bin/zsh
# Create a Django project using a template in .dotfiles/codetemplates/django
# Eryn Wells <eryn@erynwells.me>
local funcname=$0
_usage() {
print_info "Usage: $funcname template_name project_name [optional destination directory]"
}
if [[ ${#@} -lt 2 ]]; then
print_error "Need moar arguments" 1>&2
_usage
return -1
fi
local tname=$1
local tdir="$HOME/.codetemplates/django/$tname"
local pname=$2
local dest=$3
if [[ ! -d "$tdir" ]]; then
print_error "Invalid template name: $tname" 1>&2
return -2
fi
print_info "Making Django project '$pname' with template '$tname'"
if [[ -n "$dest" && ! -d "$dest" ]]; then
print_info_sub "Destination directory given but does not exist; creating $dest"
mkdir -p "$dest"
fi
# Determine what files might not be rendered by django-admin.py
local names=()
for f in `find "$tdir"`; do
# Pick up all dotfiles
if [[ -e "$f" && "`basename $f`" =~ "^\." ]]; then
names+=($f)
fi
done
print_info_sub "Calling django-admin.py"
django-admin.py startproject --template="$tdir" --name=${(j.,.)names} $pname $dest
exitcode=$?
unfunction _usage
return $exitcode

4
zshrc
View file

@ -201,14 +201,14 @@ done
# ad nauseum)
function up {
if [[ -z $1 ]]; then
pushd ..
cd ..
else
local updir=''
for (( i=0; $i < $1; i++ ))
do
updir="../$updir"
done
pushd $updir
cd $updir
fi
}