Attempting to carve out a sensible chunk of stuff for a dotfiles repo.

Sure hope I didn't miss any super secret crap :-P
This commit is contained in:
Dan Buch 2012-02-26 14:38:01 -05:00
commit a8cd5a2fe9
51 changed files with 7951 additions and 0 deletions

10
Makefile Normal file
View File

@ -0,0 +1,10 @@
TARGETS = $(patsubst %,$(HOME)/.%,$(shell ls -d * | grep -v '.d'))
$(HOME)/.%: %
rsync -avz $^ $@
all: $(TARGETS)
mkdir -p $(HOME)/.bash_completion.d
rsync -avz bash_completion.d/ $(HOME)/.bash_completion.d
.PHONY: all

3
Xdefaults Normal file
View File

@ -0,0 +1,3 @@
# nuffin
urxvt.depth: 24

1
Xkbmap Normal file
View File

@ -0,0 +1 @@
dvorak

0
Xmodmap Normal file
View File

67
activate_proj Normal file
View File

@ -0,0 +1,67 @@
#!/bin/bash
USAGE="Usage: $HOME/.activate_proj <proj>"
function __run_activate(){
if [ -n "${1}" ] ; then
PROJ=${1}
local PROJDIR="${HOME}/src/${PROJ}"
if [[ -d "$PROJDIR" ]] ; then
export PROJ
export PROJSRC="$PROJDIR/src"
export PROJBIN="${PROJDIR}/bin"
cd "${PROJSRC}"
_HAS_GIT=""
if [[ -d "$PWD/.git" ]]
then
_HAS_GIT="yup"
fi
_HG_BRANCH=""
_HAS_HG=""
if [[ -d "$PWD/.hg" ]]
then
_HG_BRANCH="$PWD/.hg/branch"
_HAS_HG="yup"
fi
echo "Changed to ${PROJSRC}"
if [[ -e "${PROJBIN}/activate" ]]
then
source "${PROJBIN}/activate"
fi
echo "${PROJ} activated"
PROMPT_COMMAND='precmd; PS1="(\[\033[33m\]\${PROJ}\[\033[00m\]) _VCS_BRANCH_$PS1"'
export PROMPT_COMMAND
if [[ -n "$_HAS_HG" ]]
then
if [[ -n "$(/bin/ls $(hg root)/.hg/branches 2>/dev/null)" ]]
then
PROMPT_COMMAND=$(echo $PROMPT_COMMAND | sed "s@_VCS_BRANCH_@(lb:\`hg lbranch 2>/dev/null\`) @")
else
PROMPT_COMMAND=$(echo $PROMPT_COMMAND | sed "s@_VCS_BRANCH_@(b:\`cat ${PROJSRC}/.hg/branch 2>/dev/null\`) @")
fi
else
PROMPT_COMMAND=$(echo $PROMPT_COMMAND | sed "s/_VCS_BRANCH_//" )
fi
export PS2=""
else
echo "Hey! '${1}' is not a valid project."
echo "Pick from these:"
echo
for p in $( ls -1 -I "*.egg" "${HOME}/src" ) ; do
echo " $p"
done
fi
else
echo ${USAGE}
fi
}
__run_activate "$@"
unset __run_activate
# vim:ft=sh

26
bash_aliases Normal file
View File

@ -0,0 +1,26 @@
alias .bp="source $HOME/.bash_profile"
alias .sa="source $HOME/.ssh/agent.out"
alias be='bundle exec'
alias h='cat /etc/hosts'
alias hn='hostname -f'
alias i='ip addr'
alias k1='kill -9 %1'
alias la='l -a'
alias ll='l -l'
alias lla='l -la'
alias p=ipython
alias psg='pgrep -fl'
alias s="cat $HOME/.ssh/config | grep '^Host ' | sed \"s/Host //\" | sort | uniq"
alias sS='TERM=xterm screen -Rd -S '
alias scr='TERM=xterm screen -Rd'
alias sl="screen -ls"
if [[ "$(uname)" -eq "Linux" ]]
then
alias l='ls -F --color=auto'
else
# for darwin in particular
alias l='ls -GF'
fi
# vim:filetype=sh

514
bash_completion Normal file
View File

@ -0,0 +1,514 @@
# bash_completion - programmable completion functions for bash 3.x
# (backwards compatible with bash 2.05b)
#
# Copyright © 2006-2008, Ian Macdonald <ian@caliban.org>
# © 2008, David Paleino <d.paleino@gmail.com>
# © 2008, Luk Claes <luk@debian.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# The latest version of this software can be obtained here:
#
# http://bash-completion.alioth.debian.org/
#
# RELEASE: 20080617.5
LOCAL_BASH_COMPLETION_DIR=$HOME/.bash_completion.d
_debug()
{
test -n "$DEBUG" && echo "$1"
}
if [[ $- == *v* ]]; then
BASH_COMPLETION_ORIGINAL_V_VALUE="-v"
else
BASH_COMPLETION_ORIGINAL_V_VALUE="+v"
fi
if [[ -n $BASH_COMPLETION_DEBUG ]]; then
set -v
else
set +v
fi
# Set a couple of useful vars
#
UNAME=$( uname -s )
# strip OS type and version under Cygwin (e.g. CYGWIN_NT-5.1 => Cygwin)
UNAME=${UNAME/CYGWIN_*/Cygwin}
RELEASE=$( uname -r )
# features supported by bash 2.05 and higher
if [ ${BASH_VERSINFO[0]} -eq 2 ] && [[ ${BASH_VERSINFO[1]} > 04 ]] ||
[ ${BASH_VERSINFO[0]} -gt 2 ]; then
declare -r bash205=$BASH_VERSION 2>/dev/null || :
default="-o default"
dirnames="-o dirnames"
filenames="-o filenames"
fi
# features supported by bash 2.05b and higher
if [ ${BASH_VERSINFO[0]} -eq 2 ] && [[ ${BASH_VERSINFO[1]} = "05b" ]] ||
[ ${BASH_VERSINFO[0]} -gt 2 ]; then
declare -r bash205b=$BASH_VERSION 2>/dev/null || :
nospace="-o nospace"
fi
# features supported by bash 3.0 and higher
if [ ${BASH_VERSINFO[0]} -gt 2 ]; then
declare -r bash3=$BASH_VERSION 2>/dev/null || :
bashdefault="-o bashdefault"
plusdirs="-o plusdirs"
fi
# Turn on extended globbing and programmable completion
shopt -s extglob progcomp
# A lot of the following one-liners were taken directly from the
# completion examples provided with the bash 2.04 source distribution
# Make directory commands see only directories
complete -d pushd
# The following section lists completions that are redefined later
# Do NOT break these over multiple lines.
#
# START exclude -- do NOT remove this line
complete -f -X '!*.?(t)bz?(2)' bunzip2
# TODO: see #455510
#complete -f -X '!*.?(t)bz?(2)' bzcat bzcmp bzdiff bzegrep bzfgrep bzgrep
complete -f -X '!*.*' bzcat bzcmp bzdiff bzegrep bzfgrep bzgrep
complete -f -X '!*.@(zip|ZIP|jar|JAR|egg|EGG|exe|EXE|pk3|war|wsz|ear|zargo|xpi|sxw|swc|ott|od[fgpst])' unzip zipinfo
complete -f -X '*.Z' compress znew
complete -f -X '!*.@(Z|gz|tgz|Gz|dz)' gunzip
# TODO: see #455510
#complete -f -X '!*.@(Z|gz|tgz|Gz|dz)' zcmp zdiff zcat zegrep zfgrep zgrep zless zmore
complete -f -X '!*.*' zcmp zdiff zcat zegrep zfgrep zgrep zless zmore
complete -f -X '!*.Z' uncompress
complete -f -X '!*.@(gif|jp?(e)g|miff|tif?(f)|pn[gm]|p[bgp]m|bmp|xpm|ico|xwd|tga|pcx|GIF|JP?(E)G|MIFF|TIF?(F)|PN[GM]|P[BGP]M|BMP|XPM|ICO|XWD|TGA|PCX)' ee
complete -f -X '!*.@(gif|jp?(e)g|miff|tif?(f)|pn[gm]|p[bgp]m|bmp|xpm|ico|xwd|tga|pcx|svg|GIF|JP?(E)G|MIFF|TIF?(F)|PN[GM]|P[BGP]M|BMP|XPM|ICO|XWD|TGA|PCX|SVG)' display
complete -f -X '!*.@(gif|jp?(e)g|tif?(f)|png|p[bgp]m|bmp|x[bp]m|rle|rgb|pcx|fits|pm|GIF|JPG|JP?(E)G|TIF?(F)|PNG|P[BGP]M|BMP|X[BP]M|RLE|RGB|PCX|FITS|PM)' xv qiv
complete -f -X '!*.@(@(?(e)ps|?(E)PS|pdf|PDF)?(.gz|.GZ|.bz2|.BZ2|.Z))' gv ggv kghostview
complete -f -X '!*.@(dvi|DVI)?(.@(gz|Z|bz2))' xdvi
complete -f -X '!*.@(dvi|DVI)?(.@(gz|Z|bz2))' kdvi
complete -f -X '!*.@(dvi|DVI)' dvips dviselect dvitype dvipdf advi dvipdfm dvipdfmx
complete -f -X '!*.@(pdf|PDF)' acroread gpdf xpdf
complete -f -X '!*.@(?(e)ps|?(E)PS|pdf|PDF)' kpdf
complete -f -X '!*.@(@(?(e)ps|?(E)PS|pdf|PDF)?(.gz|.GZ|.bz2|.BZ2)|cb(r|z)|CB(R|Z)|djv?(u)|DJV?(U)|dvi|DVI|gif|jp?(e)g|miff|tif?(f)|pn[gm]|p[bgp]m|bmp|xpm|ico|xwd|tga|pcx|GIF|JP?(E)G|MIFF|TIF?(F)|PN[GM]|P[BGP]M|BMP|XPM|ICO|XWD|TGA|PCX)' evince
complete -f -X '!*.@(?(e)ps|?(E)PS)' ps2pdf
complete -f -X '!*.texi*' makeinfo texi2html
complete -f -X '!*.@(?(la)tex|?(LA)TEX|texi|TEXI|dtx|DTX|ins|INS)' tex latex slitex jadetex pdfjadetex pdftex pdflatex texi2dvi
complete -f -X '!*.@(mp3|MP3)' mpg123 mpg321 madplay
complete -f -X '!*.@(mp?(e)g|MP?(E)G|wma|avi|AVI|asf|vob|VOB|bin|dat|divx|DIVX|vcd|ps|pes|fli|flv|FLV|viv|rm|ram|yuv|mov|MOV|qt|QT|wmv|mp3|MP3|m4[pv]|M4[PV]|ogg|OGG|ogm|OGM|mp4|MP4|wav|WAV|asx|ASX|mng|MNG|srt)' xine aaxine fbxine kaffeine
complete -f -X '!*.@(avi|asf|wmv)' aviplay
complete -f -X '!*.@(rm?(j)|ra?(m)|smi?(l))' realplay
complete -f -X '!*.@(mpg|mpeg|avi|mov|qt)' xanim
complete -f -X '!*.@(ogg|OGG|m3u|flac|spx)' ogg123
complete -f -X '!*.@(mp3|MP3|ogg|OGG|pls|m3u)' gqmpeg freeamp
complete -f -X '!*.fig' xfig
complete -f -X '!*.@(mid?(i)|MID?(I)|cmf|CMF)' playmidi
complete -f -X '!*.@(mid?(i)|MID?(I)|rmi|RMI|rcp|RCP|[gr]36|[GR]36|g18|G18|mod|MOD|xm|XM|it|IT|x3m|X3M)' timidity
complete -f -X '*.@(o|so|so.!(conf)|a|rpm|gif|GIF|jp?(e)g|JP?(E)G|mp3|MP3|mp?(e)g|MPG|avi|AVI|asf|ASF|ogg|OGG|class|CLASS)' vi vim gvim rvim view rview rgvim rgview gview
complete -f -X '*.@(o|so|so.!(conf)|a|rpm|gif|GIF|jp?(e)g|JP?(E)G|mp3|MP3|mp?(e)g|MPG|avi|AVI|asf|ASF|ogg|OGG|class|CLASS)' emacs
complete -f -X '!*.@(exe|EXE|com|COM|scr|SCR|exe.so)' wine
complete -f -X '!*.@(zip|ZIP|z|Z|gz|GZ|tgz|TGZ)' bzme
complete -f -X '!*.@(?([xX]|[sS])[hH][tT][mM]?([lL]))' netscape mozilla lynx opera galeon curl dillo elinks amaya
complete -f -X '!*.@(sxw|stw|sxg|sgl|doc|dot|rtf|txt|htm|html|odt|ott|odm)' oowriter
complete -f -X '!*.@(sxi|sti|pps|ppt|pot|odp|otp)' ooimpress
complete -f -X '!*.@(sxc|stc|xls|xlw|xlt|csv|ods|ots)' oocalc
complete -f -X '!*.@(sxd|std|sda|sdd|odg|otg)' oodraw
complete -f -X '!*.@(sxm|smf|mml|odf)' oomath
complete -f -X '!*.odb' oobase
complete -f -X '!*.rpm' rpm2cpio
# FINISH exclude -- do not remove this line
# start of section containing compspecs that can be handled within bash
# user commands see only users
complete -u su usermod userdel passwd chage write chfn groups slay w sux
# group commands see only groups
[ -n "$bash205" ] && complete -g groupmod groupdel newgrp 2>/dev/null
# bg completes with stopped jobs
complete -A stopped -P '"%' -S '"' bg
# other job commands
complete -j -P '"%' -S '"' fg jobs disown
# readonly and unset complete with shell variables
complete -v readonly unset
# set completes with set options
complete -A setopt set
# shopt completes with shopt options
complete -A shopt shopt
# helptopics
complete -A helptopic help
# unalias completes with aliases
complete -a unalias
# bind completes with readline bindings (make this more intelligent)
complete -A binding bind
# type and which complete on commands
complete -c command type which
# builtin completes on builtins
complete -b builtin
# start of section containing completion functions called by other functions
# This function checks whether we have a given program on the system.
# No need for bulky functions in memory if we don't.
#
have()
{
unset -v have
PATH=$PATH:/sbin:/usr/sbin:/usr/local/sbin type $1 &>/dev/null &&
have="yes"
}
# use GNU sed if we have it, since its extensions are still used in our code
#
[ $UNAME != Linux ] && have gsed && alias sed=gsed
# This function checks whether a given readline variable
# is `on'.
#
_rl_enabled()
{
[[ "$( bind -v )" = *$1+([[:space:]])on* ]]
}
# This function shell-quotes the argument
quote()
{
echo \'${1//\'/\'\\\'\'}\' #'# Help vim syntax highlighting
}
# This function quotes the argument in a way so that readline dequoting
# results in the original argument
quote_readline()
{
local t="${1//\\/\\\\}"
echo \'${t//\'/\'\\\'\'}\' #'# Help vim syntax highlighting
}
# This function shell-dequotes the argument
dequote()
{
eval echo "$1"
}
# Get the word to complete
# This is nicer than ${COMP_WORDS[$COMP_CWORD]}, since it handles cases
# where the user is completing in the middle of a word.
# (For example, if the line is "ls foobar",
# and the cursor is here --------> ^
# it will complete just "foo", not "foobar", which is what the user wants.)
#
#
# Accepts an optional parameter indicating which characters out of
# $COMP_WORDBREAKS should NOT be considered word breaks. This is useful
# for things like scp where we want to return host:path and not only path.
_get_cword()
{
if [[ "${#COMP_WORDS[COMP_CWORD]}" -eq 0 ]] || [[ "$COMP_POINT" == "${#COMP_LINE}" ]]; then
echo "${COMP_WORDS[COMP_CWORD]}"
else
local i
local cur="$COMP_LINE"
local index="$COMP_POINT"
for (( i = 0; i <= COMP_CWORD; ++i )); do
while [[ "${#cur}" -ge ${#COMP_WORDS[i]} ]] && [[ "${cur:0:${#COMP_WORDS[i]}}" != "${COMP_WORDS[i]}" ]]; do
cur="${cur:1}"
index="$(( index - 1 ))"
done
if [[ "$i" -lt "$COMP_CWORD" ]]; then
local old_size="${#cur}"
cur="${cur#${COMP_WORDS[i]}}"
local new_size="${#cur}"
index="$(( index - old_size + new_size ))"
fi
done
if [[ "${COMP_WORDS[COMP_CWORD]:0:${#cur}}" != "$cur" ]]; then
# We messed up! At least return the whole word so things
# keep working
echo "${COMP_WORDS[COMP_CWORD]}"
else
echo "${cur:0:$index}"
fi
fi
}
# This function performs file and directory completion. It's better than
# simply using 'compgen -f', because it honours spaces in filenames.
# If passed -d, it completes only on directories. If passed anything else,
# it's assumed to be a file glob to complete on.
#
_filedir()
{
local IFS=$'\t\n' xspec
_expand || return 0
local toks=( ) tmp
while read -r tmp; do
[[ -n $tmp ]] && toks[${#toks[@]}]=$tmp
done < <( compgen -d -- "$(quote_readline "$cur")" )
if [[ "$1" != -d ]]; then
xspec=${1:+"!*.$1"}
while read -r tmp; do
[[ -n $tmp ]] && toks[${#toks[@]}]=$tmp
done < <( compgen -f -X "$xspec" -- "$(quote_readline "$cur")" )
fi
COMPREPLY=( "${COMPREPLY[@]}" "${toks[@]}" )
}
# This function completes on signal names
#
_signals()
{
local i
# standard signal completion is rather braindead, so we need
# to hack around to get what we want here, which is to
# complete on a dash, followed by the signal name minus
# the SIG prefix
COMPREPLY=( $( compgen -A signal SIG${cur#-} ))
for (( i=0; i < ${#COMPREPLY[@]}; i++ )); do
COMPREPLY[i]=-${COMPREPLY[i]#SIG}
done
}
# This function completes on configured network interfaces
#
_configured_interfaces()
{
if [ -f /etc/debian_version ]; then
# Debian system
COMPREPLY=( $( sed -ne 's|^iface \([^ ]\+\).*$|\1|p' \
/etc/network/interfaces ) )
elif [ -f /etc/SuSE-release ]; then
# SuSE system
COMPREPLY=( $( command ls \
/etc/sysconfig/network/ifcfg-* | \
sed -ne 's|.*ifcfg-\('$cur'.*\)|\1|p' ) )
elif [ -f /etc/pld-release ]; then
# PLD Linux
COMPREPLY=( $( command ls -B \
/etc/sysconfig/interfaces | \
sed -ne 's|.*ifcfg-\('$cur'.*\)|\1|p' ) )
else
# Assume Red Hat
COMPREPLY=( $( command ls \
/etc/sysconfig/network-scripts/ifcfg-* | \
sed -ne 's|.*ifcfg-\('$cur'.*\)|\1|p' ) )
fi
}
# This function completes on all available network interfaces
# -a: restrict to active interfaces only
# -w: restrict to wireless interfaces only
#
_available_interfaces()
{
local cmd
if [ "${1:-}" = -w ]; then
cmd="iwconfig"
elif [ "${1:-}" = -a ]; then
cmd="ifconfig"
else
cmd="ifconfig -a"
fi
COMPREPLY=( $( eval $cmd 2>/dev/null | \
sed -ne 's|^\('$cur'[^[:space:][:punct:]]\{1,\}\).*$|\1|p') )
}
# This function expands tildes in pathnames
#
_expand()
{
# FIXME: Why was this here?
#[ "$cur" != "${cur%\\}" ] && cur="$cur\\"
# expand ~username type directory specifications
if [[ "$cur" == \~*/* ]]; then
eval cur=$cur
elif [[ "$cur" == \~* ]]; then
cur=${cur#\~}
COMPREPLY=( $( compgen -P '~' -u $cur ) )
return ${#COMPREPLY[@]}
fi
}
# This function completes on process IDs.
# AIX and Solaris ps prefers X/Open syntax.
[ $UNAME = SunOS -o $UNAME = AIX ] &&
_pids()
{
COMPREPLY=( $( compgen -W '$( command ps -efo pid | sed 1d )' -- $cur ))
} ||
_pids()
{
COMPREPLY=( $( compgen -W '$( command ps axo pid | sed 1d )' -- $cur ) )
}
# This function completes on process group IDs.
# AIX and SunOS prefer X/Open, all else should be BSD.
[ $UNAME = SunOS -o $UNAME = AIX ] &&
_pgids()
{
COMPREPLY=( $( compgen -W '$( command ps -efo pgid | sed 1d )' -- $cur ))
} ||
_pgids()
{
COMPREPLY=( $( compgen -W '$( command ps axo pgid | sed 1d )' -- $cur ))
}
# This function completes on user IDs
#
_uids()
{
if type getent &>/dev/null; then
COMPREPLY=( $( getent passwd | \
awk -F: '{if ($3 ~ /^'$cur'/) print $3}' ) )
elif type perl &>/dev/null; then
COMPREPLY=( $( compgen -W '$( perl -e '"'"'while (($uid) = (getpwent)[2]) { print $uid . "\n" }'"'"' )' -- $cur ) )
else
# make do with /etc/passwd
COMPREPLY=( $( awk 'BEGIN {FS=":"} {if ($3 ~ /^'$cur'/) print $3}'\
/etc/passwd ) )
fi
}
# This function completes on group IDs
#
_gids()
{
if type getent &>/dev/null; then
COMPREPLY=( $( getent group | \
awk -F: '{if ($3 ~ /^'$cur'/) print $3}' ) )
elif type perl &>/dev/null; then
COMPREPLY=( $( compgen -W '$( perl -e '"'"'while (($gid) = (getgrent)[2]) { print $gid . "\n" }'"'"' )' -- $cur ) )
else
# make do with /etc/group
COMPREPLY=( $( awk 'BEGIN {FS=":"} {if ($3 ~ /^'$cur'/) print $3}'\
/etc/group ) )
fi
}
# This function completes on services
#
_services()
{
local sysvdir famdir
[ -d /etc/rc.d/init.d ] && sysvdir=/etc/rc.d/init.d || sysvdir=/etc/init.d
famdir=/etc/xinetd.d
COMPREPLY=( $( builtin echo $sysvdir/!(*.rpmsave|*.rpmorig|*~|functions)) )
if [ -d $famdir ]; then
COMPREPLY=( "${COMPREPLY[@]}" $( builtin echo $famdir/!(*.rpmsave|*.rpmorig|*~)) )
fi
COMPREPLY=( $( compgen -W '${COMPREPLY[@]#@($sysvdir|$famdir)/}' -- $cur ) )
}
# This function complete on modules
#
_modules()
{
local modpath
modpath=/lib/modules/$1
COMPREPLY=( $( command ls -R $modpath | \
sed -ne 's/^\('$cur'.*\)\.k\?o\(\|.gz\)$/\1/p') )
}
# This function completes on installed modules
#
_installed_modules()
{
COMPREPLY=( $( compgen -W "$( /sbin/lsmod | \
awk '{if (NR != 1) print $1}' )" -- $1 ) )
}
# this function complete on user:group format
#
_usergroup()
{
local IFS=$'\n'
cur=${cur//\\\\ / }
if [[ $cur = *@(\\:|.)* ]] && [ -n "$bash205" ]; then
user=${cur%%*([^:.])}
COMPREPLY=( $(compgen -P ${user/\\\\} -g -- ${cur##*[.:]}) )
elif [[ $cur = *:* ]] && [ -n "$bash205" ]; then
COMPREPLY=( $( compgen -g -- ${cur##*[.:]} ) )
else
COMPREPLY=( $( compgen -S : -u -- $cur ) )
fi
}
# this function count the number of mandatory args
#
_count_args()
{
args=1
for (( i=1; i < COMP_CWORD; i++ )); do
if [[ "${COMP_WORDS[i]}" != -* ]]; then
args=$(($args+1))
fi
done
}
_source_local_bash_completion()
{
# source completion directory definitions
if [ -n "$(complete | grep "post-review")" ]
then
return 2
fi
if [ -x $LOCAL_BASH_COMPLETION_DIR ]
then
for i in $LOCAL_BASH_COMPLETION_DIR/*
do
local invalid="`echo $i | grep -E '.*(~|\.bak|\.swp|\.dpkg.*|\.rpm.*)'`"
if [[ ! -n "$invalid" ]] && [[ -e "$i" ]]
then
_debug "sourcing $i"
source $i
fi
done
fi
unset i
}
_source_local_bash_completion
unset _source_local_bash_completion
# vim:filetype=sh

View File

@ -0,0 +1,9 @@
if [ which mxmlc 2>/dev/null ]
then
__WORDS="$(mxmlc -help list | awk '/^-/ { print $1 }')"
complete -W "$__WORDS" -f -o default mxmlc
complete -W "$__WORDS" -f -o default compc
fi
# vim:filetype=sh

2738
bash_completion.d/git Normal file

File diff suppressed because it is too large Load Diff

49
bash_completion.d/gpg Normal file
View File

@ -0,0 +1,49 @@
# bash completion for gpg
have gpg &&
_gpg()
{
local cur prev
COMPREPLY=()
cur=`_get_cword`
prev=${COMP_WORDS[COMP_CWORD-1]}
case "$prev" in
-@(s|-sign|-clearsign|-decrypt-files|-load-extension))
_filedir
return 0
;;
--@(export|@(?(l|nr|nrl)sign|edit)-key))
# return list of public keys
COMPREPLY=( $( compgen -W "$( gpg --list-keys 2>/dev/null | \
sed -ne 's@^pub.*/\([^ ]*\).*$@\1@p;s@^.*\(<\([^>]*\)>\).*$@\2@p')" -- "$cur" ))
return 0
;;
-@(r|-recipient))
COMPREPLY=( $( compgen -W "$( gpg --list-keys 2>/dev/null | \
sed -ne 's@^.*<\([^>]*\)>.*$@\1@p')" -- "$cur" ))
if [ -e ~/.gnupg/gpg.conf ]; then
COMPREPLY=( "${COMPREPLY[@]}" $( compgen -W "$( sed -ne \
's@^[ \t]*group[ \t][ \t]*\([^=]*\).*$@\1@p' \
~/.gnupg/gpg.conf )" -- "$cur") )
fi
return 0
;;
esac
if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '-s -b -e -f -c -d -a -r -u -Z -o -v\
-q -n -N $(gpg --dump-options)' -- "$cur" ) )
fi
} &&
complete -F _gpg $default gpg
# Local variables:
# mode: shell-script
# sh-basic-offset: 4
# sh-indent-comment: t
# indent-tabs-mode: nil
# End:
# ex: ts=4 sw=4 et filetype=sh

53
bash_completion.d/gpg2 Normal file
View File

@ -0,0 +1,53 @@
# gpg2(1) completion
have gpg2 && {
_gpg2 ()
{
local cur prev
COMPREPLY=()
cur=`_get_cword`
prev=${COMP_WORDS[COMP_CWORD-1]}
case "$prev" in
--homedir)
_filedir -d
return 0
;;
-@(s|-sign|-clearsign|-options|-decrypt))
_filedir
return 0
;;
--@(export|@(?(l|nr|nrl)sign|edit)-key))
# return list of public keys
COMPREPLY=( $( compgen -W "$( gpg2 --list-keys 2>/dev/null | \
sed -ne 's@^pub.*/\([^ ]*\).*$@\1@p;s@^.*\(<\([^>]*\)>\).*$@\2@p')" -- "$cur" ))
return 0
;;
-@(r|-recipient))
COMPREPLY=( $( compgen -W "$( gpg2 --list-keys 2>/dev/null | \
sed -ne 's@^.*<\([^>]*\)>.*$@\1@p')" -- "$cur" ))
if [ -e ~/.gnupg/gpg.conf ]; then
COMPREPLY=( "${COMPREPLY[@]}" $( compgen -W "$( sed -ne \
's@^[ \t]*group[ \t][ \t]*\([^=]*\).*$@\1@p' \
~/.gnupg/gpg.conf)" -- "$cur"))
fi
return 0
;;
esac
if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '-s -b -e -c -d -k -K -a -r -u -z -o -v \
-n -N -i -h -R -t $(gpg2 --dump-options)' -- "$cur" ) )
fi
} &&
complete -F _gpg2 $default gpg2
}
# Local variables:
# mode: shell-script
# sh-basic-offset: 4
# sh-indent-comment: t
# indent-tabs-mode: nil
# End:
# ex: ts=4 sw=4 et filetype=sh

View File

@ -0,0 +1,25 @@
# inkscape(1) completion
# put this file in /etc/bash_completion.d/
# allali@univ-mlv.fr
have inkscape &&
_inkscape()
{
local cur
COMPREPLY=()
cur=${COMP_WORDS[COMP_CWORD]}
if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '-? --help --usage -V --version \
-z --without-gui -g --with-gui -f --file= -p --print= \
-e --export-png= -d --export-dpi= -a --export-area= \
-w --export-width= -h --export-height= -i --export-id= \
-j --export-id-only -t --export-use-hints -b --export-background= \
-y --export-background-opacity= -l --export-plain-svg= -s --slideshow' -- $cur ) )
else
_filedir '@(svg|svgz|ai|dia|eps|ani|bmp|cur|gif|ico|jpe|jpg|pbm|pcx|pgm|png|ppm|pnm|ras|targa|tga|tif|tiff|wbmp|xbm|xpm|ggr|ps|sk|txt|wmf)'
fi
}
[ "${have:-}" ] && complete -F _inkscape $filenames inkscape

127
bash_completion.d/knife Normal file
View File

@ -0,0 +1,127 @@
# vim: ft=sh:ts=4:sw=4:autoindent:expandtab:
# Author: Avishai Ish-Shalom <avishai@fewbytes.com>
# We need to specify GNU sed for OS X, BSDs, etc.
if [[ "$(uname -s)" == "Darwin" ]]; then
SED=gsed
else
SED=sed
fi
# first argument set the command level
_get_knife_completions() {
n=$1
shift
# first argument is knife, so shift it
#[ "$1" == "knife" ] && shift
local opts
opts="$($@ --help | grep -E '^knife' | cut -f$n -d" " | grep -v -E '[][[:upper:].]+' |grep -v '(options)')"
_upvar opts "$opts"
}
_flatten_knife_command() {
echo ${words[*]} |${SED} -r -e "s/\ *${words[$cword]}\$//" -e 's/\W/_/g'
}
# Check cache file for category ( passed as $1 ) and run command if cache is empty
# Designed to be used with _get_knife_completions() and use the opts variables for options
_completion_cache() {
local CACHE_DIR=${CHEF_HOME:-"$HOME/.chef"}/.completion_cache
local flag COMMAND
local OPTIND=1
while getopts "c" flag "$@"; do
case $flag in
c)
COMMAND=yes
;;
*)
;;
esac
done
shift $(( $OPTIND - 1 ))
local CACHE_FILE="$CACHE_DIR/$1"
shift
if [ ! -f "$CACHE_FILE" ]; then
if [[ "$COMMAND" == "yes" ]]; then
opts=$( eval $@ )
else
$@
fi
[ -d "$CACHE_DIR" ] && echo $opts >"$CACHE_FILE"
else
opts=$(cat "$CACHE_FILE")
fi
_upvar opts "$opts"
}
_knife() {
local opts cur prev cword words flattened_knife_command
_completion_cache knife_commands _get_knife_completions 2 knife
_get_comp_words_by_ref cur prev cword words
flattened_knife_command=$(_flatten_knife_command)
COMPREPLY=()
case $flattened_knife_command in
*knife_cookbook_upload|*knife_cookbook_test)
local chef_repos
if [[ -z $CHEF_REPOS ]]; then
chef_repos=( $(${SED} -rn '/cookbook_path/ {s/.*\[(.*)\]/\1/g; s/[,'\'']//g; p}' ${CHEF_HOME:-"$HOME/.chef"}/knife.rb) )
else
chef_repos=( ${CHEF_REPOS[@]} )
fi
if [[ -n "$chef_repos" ]]; then
opts=$( ls -1p ${chef_repos[@]} | sort -u | ${SED} -n 's/\/$//p' )
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
fi
;;
*knife_data)
opts="bag"
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
return 0
;;
*knife_node_show|*knife_node_edit|*knife_node_delete|*knife_tag_*)
_completion_cache -c knife_nodes "${words[0]} node list|${SED} -r -e 's/[\"\ ,]//g' -e '/[^0-9A-Za-z._-]+/d'"
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
return 0
;;
*knife_role_edit|*knife_role_show|*knife_role_delete)
_completion_cache -c knife_roles "${words[0]} role list|${SED} -r -e 's/[\"\ ,]//g' -e '/[^0-9A-Za-z._-]+/d'"
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
return 0
;;
*knife_data_bag_delete|*knife_data_bag_show|*knife_data_bag_edit)
_completion_cache -c knife_data_bags "${words[0]} data bag list|${SED} -r -e 's/[\"\ ,]//g' -e '/[^0-9A-Za-z._-]+/d'"
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
return 0
;;
*knife_data_bag_delete_*|*knife_data_bag_show_*|*knife_data_bag_edit_*)
_completion_cache -c knife_data_bag_$prev "${words[0]} data bag show $prev 2>/dev/null|${SED} -r -e 's/[\"\ ,]//g' -e '/^[^0-9A-Za-z._-]+/d'"
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
return 0
;;
*knife_client_list|*knife_client_show|*knife_client_edit)
_completion_cache -c knife_clients "${words[0]} client list|${SED} -r -e 's/[\"\ ,]//g' -e '/[^0-9A-Za-z._-]+/d'"
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
return 0
;;
*knife_environment_show|*knife_environment_edit|*knife_environment_delete)
_completion_cache -c knife_environments "${words[0]} environment list|${SED} -r -e 's/[\"\ ,]//g' -e '/[^0-9A-Za-z._-]+/d'"
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
return 0
;;
*)
case $cword in
1)
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
return 0
;;
*)
_completion_cache $flattened_knife_command _get_knife_completions $(( $cword + 1 )) ${words[*]}
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
return 0
;;
esac
;;
esac
[[ ${#COMPREPLY[@]} -ge 1 ]] && return 0
}
complete -F _knife knife

100
bash_completion.d/make Normal file
View File

@ -0,0 +1,100 @@
# GNU make(1) completion
# have make || have gmake || have gnumake || have pmake &&
_make()
{
local file makef makef_dir="." makef_inc cur prev i
COMPREPLY=()
cur=`_get_cword`
prev=${COMP_WORDS[COMP_CWORD-1]}
# --name value style option
case $prev in
-@(f|o|W))
_filedir
return 0
;;
-@(I|C))
_filedir -d
return 0
;;
esac
# --name=value style option
if [[ "$cur" == *=* ]]; then
prev=${cur/=*/}
cur=${cur/*=/}
case "$prev" in
--@(file|makefile))
_filedir
return 0
;;
--@(directory|include-dir))
_filedir -d
return 0
;;
esac
fi
if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '-b -m -B -C -d -e -f -h -i -I\
-j -l -k -n -o -p -q -r -R - s -S -t -v -w -W \
--always-make --directory= --debug \
--environment-overrides --file= --makefile= --help \
--ignore-errors --include-dir= --jobs --load-average \
--max-load --keep-going --just-print --dry-run \
--recon --old-file= --assume-old= --print-data-base \
--question --no-builtin-rules --no-builtin-variables \
--silent --quiet --no-keep-goind --stop --touch \
--version --print-directory --no-print-directory \
--what-if= --new-file= --assume-new= \
--warn-undefined-variables' -- $cur ) )
else
# before we check for makefiles, see if a path was specified
# with -C
for (( i=0; i < ${#COMP_WORDS[@]}; i++ )); do
if [[ ${COMP_WORDS[i]} == -C ]]; then
# eval for tilde expansion
eval makef_dir=${COMP_WORDS[i+1]}
break
fi
done
# make reads `GNUmakefile', then `makefile', then `Makefile'
if [ -f ${makef_dir}/GNUmakefile ]; then
makef=${makef_dir}/GNUmakefile
elif [ -f ${makef_dir}/makefile ]; then
makef=${makef_dir}/makefile
elif [ -f ${makef_dir}/Makefile ]; then
makef=${makef_dir}/Makefile
else
makef=${makef_dir}/*.mk # local convention
fi
# before we scan for targets, see if a Makefile name was
# specified with -f
for (( i=0; i < ${#COMP_WORDS[@]}; i++ )); do
if [[ ${COMP_WORDS[i]} == -f ]]; then
# eval for tilde expansion
eval makef=${COMP_WORDS[i+1]}
break
fi
done
[ ! -f $makef ] && return 0
# deal with included Makefiles
makef_inc=$( grep -E '^-?include' $makef | sed -e "s,^.* ,"$makef_dir"/," )
for file in $makef_inc; do
[ -f $file ] && makef="$makef $file"
done
COMPREPLY=( $( awk -F':' '/^[a-zA-Z0-9][^$#\/\t=]*:([^=]|$)/ \
{split($1,A,/ /);for(i in A)print A[i]}' \
$makef 2>/dev/null | command grep "^$cur" ))
fi
} &&
complete -f -F _make $filenames make gmake gnumake pmake
# vim:filetype=sh

510
bash_completion.d/mercurial Normal file
View File

@ -0,0 +1,510 @@
# bash completion for the Mercurial distributed SCM
# Docs:
#
# If you source this file from your .bashrc, bash should be able to
# complete a command line that uses hg with all the available commands
# and options and sometimes even arguments.
#
# Mercurial allows you to define additional commands through extensions.
# Bash should be able to automatically figure out the name of these new
# commands and their options. See below for how to define _hg_opt_foo
# and _hg_cmd_foo functions to fine-tune the completion for option and
# non-option arguments, respectively.
#
#
# Notes about completion for specific commands:
#
# - the completion function for the email command from the patchbomb
# extension will try to call _hg_emails to get a list of e-mail
# addresses. It's up to the user to define this function. For
# example, put the addresses of the lists that you usually patchbomb
# in ~/.patchbomb-to and the addresses that you usually use to send
# the patchbombs in ~/.patchbomb-from and use something like this:
#
# _hg_emails()
# {
# if [ -r ~/.patchbomb-$1 ]; then
# cat ~/.patchbomb-$1
# fi
# }
#
#
# Writing completion functions for additional commands:
#
# If it exists, the function _hg_cmd_foo will be called without
# arguments to generate the completion candidates for the hg command
# "foo". If the command receives some arguments that aren't options
# even though they start with a "-", you can define a function called
# _hg_opt_foo to generate the completion candidates. If _hg_opt_foo
# doesn't return 0, regular completion for options is attempted.
#
# In addition to the regular completion variables provided by bash,
# the following variables are also set:
# - $hg - the hg program being used (e.g. /usr/bin/hg)
# - $cmd - the name of the hg command being completed
# - $cmd_index - the index of $cmd in $COMP_WORDS
# - $cur - the current argument being completed
# - $prev - the argument before $cur
# - $global_args - "|"-separated list of global options that accept
# an argument (e.g. '--cwd|-R|--repository')
# - $canonical - 1 if we canonicalized $cmd before calling the function
# 0 otherwise
#
_hg_commands()
{
local commands
commands="$("$hg" debugcomplete "$cur" 2>/dev/null)" || commands=""
COMPREPLY=(${COMPREPLY[@]:-} $(compgen -W '$commands' -- "$cur"))
}
_hg_paths()
{
local paths="$("$hg" paths 2>/dev/null | sed -e 's/ = .*$//')"
COMPREPLY=(${COMPREPLY[@]:-} $(compgen -W '$paths' -- "$cur"))
}
_hg_repos()
{
local i
for i in $(compgen -d -- "$cur"); do
test ! -d "$i"/.hg || COMPREPLY=(${COMPREPLY[@]:-} "$i")
done
}
_hg_status()
{
local files="$("$hg" status -n$1 . 2>/dev/null)"
local IFS=$'\n'
COMPREPLY=(${COMPREPLY[@]:-} $(compgen -W '$files' -- "$cur"))
}
_hg_tags()
{
local tags="$("$hg" tags -q 2>/dev/null)"
local IFS=$'\n'
COMPREPLY=(${COMPREPLY[@]:-} $(compgen -W '$tags' -- "$cur"))
}
# this is "kind of" ugly...
_hg_count_non_option()
{
local i count=0
local filters="$1"
for ((i=1; $i<=$COMP_CWORD; i++)); do
if [[ "${COMP_WORDS[i]}" != -* ]]; then
if [[ ${COMP_WORDS[i-1]} == @($filters|$global_args) ]]; then
continue
fi
count=$(($count + 1))
fi
done
echo $(($count - 1))
}
_hg()
{
local cur prev cmd cmd_index opts i
# global options that receive an argument
local global_args='--cwd|-R|--repository'
local hg="$1"
local canonical=0
COMPREPLY=()
cur="$2"
prev="$3"
# searching for the command
# (first non-option argument that doesn't follow a global option that
# receives an argument)
for ((i=1; $i<=$COMP_CWORD; i++)); do
if [[ ${COMP_WORDS[i]} != -* ]]; then
if [[ ${COMP_WORDS[i-1]} != @($global_args) ]]; then
cmd="${COMP_WORDS[i]}"
cmd_index=$i
break
fi
fi
done
if [[ "$cur" == -* ]]; then
if [ "$(type -t "_hg_opt_$cmd")" = function ] && "_hg_opt_$cmd"; then
return
fi
opts=$("$hg" debugcomplete --options "$cmd" 2>/dev/null)
COMPREPLY=(${COMPREPLY[@]:-} $(compgen -W '$opts' -- "$cur"))
return
fi
# global options
case "$prev" in
-R|--repository)
_hg_paths
_hg_repos
return
;;
--cwd)
# Stick with default bash completion
return
;;
esac
if [ -z "$cmd" ] || [ $COMP_CWORD -eq $i ]; then
_hg_commands
return
fi
# try to generate completion candidates for whatever command the user typed
local help
if _hg_command_specific; then
return
fi
# canonicalize the command name and try again
help=$("$hg" help "$cmd" 2>/dev/null)
if [ $? -ne 0 ]; then
# Probably either the command doesn't exist or it's ambiguous
return
fi
cmd=${help#hg }
cmd=${cmd%%[$' \n']*}
canonical=1
_hg_command_specific
}
_hg_command_specific()
{
if [ "$(type -t "_hg_cmd_$cmd")" = function ]; then
"_hg_cmd_$cmd"
return 0
fi
if [ "$cmd" != status ] && [ "$prev" = -r ] || [ "$prev" == --rev ]; then
if [ $canonical = 1 ]; then
_hg_tags
return 0
elif [[ status != "$cmd"* ]]; then
_hg_tags
return 0
else
return 1
fi
fi
case "$cmd" in
help)
_hg_commands
;;
export)
if _hg_ext_mq_patchlist qapplied && [ "${COMPREPLY[*]}" ]; then
return 0
fi
_hg_tags
;;
manifest|update)
_hg_tags
;;
pull|push|outgoing|incoming)
_hg_paths
_hg_repos
;;
paths)
_hg_paths
;;
add)
_hg_status "u"
;;
commit)
_hg_status "mar"
;;
remove)
_hg_status "d"
;;
forget)
_hg_status "a"
;;
diff)
_hg_status "mar"
;;
revert)
_hg_status "mard"
;;
clone)
local count=$(_hg_count_non_option)
if [ $count = 1 ]; then
_hg_paths
fi
_hg_repos
;;
debugindex|debugindexdot)
COMPREPLY=(${COMPREPLY[@]:-} $(compgen -f -X "!*.i" -- "$cur"))
;;
debugdata)
COMPREPLY=(${COMPREPLY[@]:-} $(compgen -f -X "!*.d" -- "$cur"))
;;
*)
return 1
;;
esac
return 0
}
complete -o bashdefault -o default -F _hg hg 2>/dev/null \
|| complete -o default -F _hg hg
# Completion for commands provided by extensions
# mq
_hg_ext_mq_patchlist()
{
local patches
patches=$("$hg" $1 2>/dev/null)
if [ $? -eq 0 ] && [ "$patches" ]; then
COMPREPLY=(${COMPREPLY[@]:-} $(compgen -W '$patches' -- "$cur"))
return 0
fi
return 1
}
_hg_ext_mq_queues()
{
local root=$("$hg" root 2>/dev/null)
local n
for n in $(cd "$root"/.hg && compgen -d -- "$cur"); do
# I think we're usually not interested in the regular "patches" queue
# so just filter it.
if [ "$n" != patches ] && [ -e "$root/.hg/$n/series" ]; then
COMPREPLY=(${COMPREPLY[@]:-} "$n")
fi
done
}
_hg_cmd_qpop()
{
if [[ "$prev" = @(-n|--name) ]]; then
_hg_ext_mq_queues
return
fi
_hg_ext_mq_patchlist qapplied
}
_hg_cmd_qpush()
{
if [[ "$prev" = @(-n|--name) ]]; then
_hg_ext_mq_queues
return
fi
_hg_ext_mq_patchlist qunapplied
}
_hg_cmd_qgoto()
{
if [[ "$prev" = @(-n|--name) ]]; then
_hg_ext_mq_queues
return
fi
_hg_ext_mq_patchlist qseries
}
_hg_cmd_qdelete()
{
local qcmd=qunapplied
if [[ "$prev" = @(-r|--rev) ]]; then
qcmd=qapplied
fi
_hg_ext_mq_patchlist $qcmd
}
_hg_cmd_qsave()
{
if [[ "$prev" = @(-n|--name) ]]; then
_hg_ext_mq_queues
return
fi
}
_hg_cmd_strip()
{
_hg_tags
}
_hg_cmd_qcommit()
{
local root=$("$hg" root 2>/dev/null)
# this is run in a sub-shell, so we can't use _hg_status
local files=$(cd "$root/.hg/patches" 2>/dev/null &&
"$hg" status -nmar 2>/dev/null)
COMPREPLY=(${COMPREPLY[@]:-} $(compgen -W '$files' -- "$cur"))
}
_hg_cmd_qfold()
{
_hg_ext_mq_patchlist qunapplied
}
_hg_cmd_qrename()
{
_hg_ext_mq_patchlist qseries
}
_hg_cmd_qheader()
{
_hg_ext_mq_patchlist qseries
}
_hg_cmd_qclone()
{
local count=$(_hg_count_non_option)
if [ $count = 1 ]; then
_hg_paths
fi
_hg_repos
}
_hg_ext_mq_guards()
{
"$hg" qselect --series 2>/dev/null | sed -e 's/^.//'
}
_hg_cmd_qselect()
{
local guards=$(_hg_ext_mq_guards)
COMPREPLY=(${COMPREPLY[@]:-} $(compgen -W '$guards' -- "$cur"))
}
_hg_cmd_qguard()
{
local prefix=''
if [[ "$cur" == +* ]]; then
prefix=+
elif [[ "$cur" == -* ]]; then
prefix=-
fi
local ncur=${cur#[-+]}
if ! [ "$prefix" ]; then
_hg_ext_mq_patchlist qseries
return
fi
local guards=$(_hg_ext_mq_guards)
COMPREPLY=(${COMPREPLY[@]:-} $(compgen -P $prefix -W '$guards' -- "$ncur"))
}
_hg_opt_qguard()
{
local i
for ((i=cmd_index+1; i<=COMP_CWORD; i++)); do
if [[ ${COMP_WORDS[i]} != -* ]]; then
if [[ ${COMP_WORDS[i-1]} != @($global_args) ]]; then
_hg_cmd_qguard
return 0
fi
elif [ "${COMP_WORDS[i]}" = -- ]; then
_hg_cmd_qguard
return 0
fi
done
return 1
}
# hbisect
_hg_cmd_bisect()
{
local i subcmd
# find the sub-command
for ((i=cmd_index+1; i<=COMP_CWORD; i++)); do
if [[ ${COMP_WORDS[i]} != -* ]]; then
if [[ ${COMP_WORDS[i-1]} != @($global_args) ]]; then
subcmd="${COMP_WORDS[i]}"
break
fi
fi
done
if [ -z "$subcmd" ] || [ $COMP_CWORD -eq $i ] || [ "$subcmd" = help ]; then
COMPREPLY=(${COMPREPLY[@]:-}
$(compgen -W 'bad good help init next reset' -- "$cur"))
return
fi
case "$subcmd" in
good|bad)
_hg_tags
;;
esac
return
}
# patchbomb
_hg_cmd_email()
{
case "$prev" in
-c|--cc|-t|--to|-f|--from|--bcc)
# we need an e-mail address. let the user provide a function
# to get them
if [ "$(type -t _hg_emails)" = function ]; then
local arg=to
if [[ "$prev" == @(-f|--from) ]]; then
arg=from
fi
local addresses=$(_hg_emails $arg)
COMPREPLY=(${COMPREPLY[@]:-}
$(compgen -W '$addresses' -- "$cur"))
fi
return
;;
-m|--mbox)
# fallback to standard filename completion
return
;;
-s|--subject)
# free form string
return
;;
esac
_hg_tags
return
}
# gpg
_hg_cmd_sign()
{
_hg_tags
}
# transplant
_hg_cmd_transplant()
{
case "$prev" in
-s|--source)
_hg_paths
_hg_repos
return
;;
--filter)
# standard filename completion
return
;;
esac
# all other transplant options values and command parameters are revisions
_hg_tags
return
}

View File

@ -0,0 +1,14 @@
function __nosetests_opts(){
echo $(
nosetests --help 2>/dev/null | \
sed "s/, */@@@/g" | \
grep -E "^ *-" | \
awk '{ print $1 }' | \
sed -e "s/@@@/ /" -e "s/,//g" -e "s/=.*//"
)
}
complete -W "$(__nosetests_opts)" -f -o default nosetests
# vim:filetype=sh

11
bash_completion.d/pip Normal file
View File

@ -0,0 +1,11 @@
# pip bash completion start
_pip_completion()
{
COMPREPLY=( $( COMP_WORDS="${COMP_WORDS[*]}" \
COMP_CWORD=$COMP_CWORD \
PIP_AUTO_COMPLETE=1 $1 ) )
}
complete -o default -F _pip_completion pip
# pip bash completion end

View File

@ -0,0 +1,13 @@
function __post_review_opts(){
post-review --help | grep -E "^ *-" | \
awk '/^ *--/ { gsub(/=.*/, "") ; print $1 }
/^ *-[^-]/ {
gsub(/=.*/, "") ;
gsub(/,/, "") ;
print $1 "\n" $2
}' | grep -v ID
}
which post-review >/dev/null 2>&1 && complete -W "$(__post_review_opts)" -o default post-review
# vim:filetype=sh

17
bash_completion.d/ssh Normal file
View File

@ -0,0 +1,17 @@
_get_ssh_hosts(){
cat $HOME/.ssh/config | grep '^Host ' | sed "s/Host //"
}
_ssh(){
cur=${COMP_WORDS[COMP_CWORD]}
# prev=${COMP_WORDS[COMP_CWORD-1]}
if [ $COMP_CWORD -eq 1 ]; then
COMPREPLY=( $( compgen -W "$(_get_ssh_hosts)" $cur ) )
fi
}
complete -F _ssh -o default ssh
complete -F _ssh -o default scp
# vim:filetype=sh

View File

@ -0,0 +1,983 @@
# Programmable completion for the Subversion svn command under bash. Source
# this file (or on some systems add it to ~/.bash_completion and start a new
# shell) and bash's completion mechanism will know all about svn's options!
# Provides completion for the svnadmin command as well. Who wants to read
# man pages/help text...
# Known to work with bash 2.05a with programmable completion and extended
# pattern matching enabled (use 'shopt -s extglob progcomp' to enable
# these if they are not already enabled).
shopt -s extglob
# Tree helper functions which only use bash, to ease readability.
# look for value associated to key from stdin in K/V hash file format
# val=$(_svn_read_hashfile svn:realmstring < some/file)
function _svn_read_hashfile()
{
local tkey=$1 key= val=
while true; do
read tag len
[ $tag = 'END' ] && break
[ $tag != 'K' ] && {
#echo "unexpected tag '$tag' instead of 'K'" >&2
return
}
read -r -n $len key ; read
read tag len
[ $tag != 'V' ] && {
#echo "unexpected tag '$tag' instead of 'V'" >&2
return
}
read -r -n $len val ; read
if [[ $key = $tkey ]] ; then
echo "$val"
return
fi
done
#echo "target key '$tkey' not found" >&2
}
# _svn_grcut shell-regular-expression
# extract filenames from 'svn status' output
function _svn_grcut()
{
local re=$1 line=
while read -r line ; do
[[ ! $re || $line == $re ]] && echo ${line/???????/}
done
}
# _svn_lls (dir|file|all) files...
# list svn-managed files from list
# some 'svn status --all-files' would be welcome here?
function _svn_lls()
{
local opt=$1 f=
shift
for f in "$@" ; do
# could try to check in .svn/entries? hmmm...
if [[ $opt == @(dir|all) && -d "$f" ]] ; then
echo "$f/"
elif [[ $opt == @(file|all) ]] ; then
# split f in directory/file names
local dn= fn="$f"
[[ "$f" == */* ]] && dn=${f%\/*}/ fn=${f##*\/}
# ??? this does not work for just added files, because they
# do not have a content reference yet...
[ -f "${dn}.svn/text-base/${fn}.svn-base" ] && echo "$f"
fi
done
}
# This completion guides the command/option order along the one suggested
# by "svn help", although other syntaxes are allowed.
#
# - there is a "real" parser to check for what is available and deduce what
# can be suggested further.
# - the syntax should be coherent with subversion/svn/{cl.h,main.c}
# - although it is not a good practice, mixed options and arguments
# is supported by the completion as it is by the svn command.
# - the completion works in the middle of a line,
# but not really in the middle of an argument or option.
# - property names are completed: see comments about issues related to handling
# ":" within property names although it is a word completion separator.
# - unknown properties are assumed to be simple file properties.
# - --revprop and --revision options are forced to revision properties
# as they are mandatory in this case.
# - argument values are suggested to some other options, eg directory names
# for --config-dir.
# - values for some options can be extended with environment variables:
# SVN_BASH_FILE_PROPS: other properties on files/directories
# SVN_BASH_REV_PROPS: other properties on revisions
# SVN_BASH_ENCODINGS: encodings to be suggested
# SVN_BASH_MIME_TYPE: mime types to be suggested
# SVN_BASH_KEYWORDS: "svn:keywords" substitutions to be suggested
# SVN_BASH_USERNAME: usernames suggested for --username
# SVN_BASH_COMPL_EXT: completion extensions for file arguments, based on the
# current subcommand, so that for instance only modified files are
# suggested for 'revert', only not svn-managed files for 'add', and so on.
# Possible values are:
# - username: guess usernames from ~/.subversion/auth/...
# - svnstatus: use 'svn status' for completion
# - recurse: allow recursion (expensive)
# - externals: recurse into externals (very expensive)
# Both former options are reasonable, but beware that both later options
# may be unadvisable if used on large working copies.
# None of these costly completions are activated by default.
# Argument completion outside a working copy results in an error message.
# Filenames with spaces are not completed properly.
#
# TODO
# - other options?
# - obsolete options could be removed from auto-comp? (e.g. -N)
# - obsolete commands could be removed? (e.g. resolved)
_svn()
{
local cur cmds cmdOpts pOpts mOpts rOpts qOpts nOpts optsParam opt
COMPREPLY=()
cur=${COMP_WORDS[COMP_CWORD]}
# Possible expansions, without pure-prefix abbreviations such as "up".
cmds='add blame annotate praise cat changelist cl \
checkout co cleanup commit ci \
copy cp delete remove rm diff export help import info \
list ls lock log merge mergeinfo mkdir move mv rename \
propdel pdel propedit pedit propget pget \
proplist plist propset pset resolve resolved revert \
status switch unlock update'
# help options have a strange command status...
local helpOpts='--help -h'
# all special options that have a command status
local specOpts="--version $helpOpts"
# options that require a parameter
# note: continued lines must end '|' continuing lines must start '|'
optsParam="-r|--revision|--username|--password|--targets|
|-x|--extensions|-m|--message|-F|--file|--encoding|
|--diff-cmd|--diff3-cmd|--editor-cmd|--old|--new|
|--config-dir|--native-eol|-l|--limit|-c|--change|--depth|
|--with-revprop|--changelist|--accept"
# svn:* and other (env SVN_BASH_*_PROPS) properties
local svnProps revProps allProps psCmds propCmds
# svn and user configured file properties
svnProps="svn:keywords svn:executable svn:needs-lock svn:externals
svn:ignore svn:eol-style svn:mime-type $SVN_BASH_FILE_PROPS"
# svn and user configured revision properties
revProps="svn:author svn:log svn:date $SVN_BASH_REV_PROPS"
# all properties as an array variable
allProps=( $svnProps $revProps )
# subcommands that expect property names
psCmds='propset|pset|ps'
propCmds="$psCmds|propget|pget|pg|propedit|pedit|pe|propdel|pdel|pd"
# Parse arguments and set various variables about what was found.
#
# cmd: the current command if available
# isPropCmd: whether it expects a property name argument
# isPsCmd: whether it also expects a property value argument
# isHelpCmd: whether it is about help
# nExpectArgs: how many arguments are expected by the command
# help: help requested about this command (if cmd=='help')
# prop: property name (if appropriate)
# isRevProp: is it a special revision property
# val: property value (if appropriate, under pset)
# options: all options encountered
# hasRevPropOpt: is --revprop set
# hasRevisionOpt: is --revision set
# hasRelocateOpt: is --relocate set
# acceptOpt: the value of --accept
# nargs: how many arguments were found
# stat: status of parsing at the 'current' word
#
# prev: previous command in the loop
# last: status of last parameter analyzed
# i: index
local cmd= isPropCmd= isPsCmd= isHelpCmd= nExpectArgs= isCur= i=0
local prev= help= prop= val= isRevProp= last='none' nargs=0 stat=
local options= hasRevPropOpt= hasRevisionOpt= hasRelocateOpt=
local acceptOpt=
for opt in "${COMP_WORDS[@]}"
do
# get status of current word (from previous iteration)
[[ $isCur ]] && stat=$last
# are we processing the current word
isCur=
[[ $i -eq $COMP_CWORD ]] && isCur=1
let i++
# FIRST must be the "svn" command
[ $last = 'none' ] && { last='first'; continue ; }
# SKIP option arguments
if [[ $prev == @($optsParam) ]] ; then
# record accept value
[[ $prev = '--accept' ]] && acceptOpt=$opt
prev=''
last='skip'
continue ;
fi
# Argh... This looks like a bashbug...
# Redirections are passed to the completion function
# although it is managed by the shell directly...
# It matters because we want to tell the user when no more
# completion is available, so it does not necessary
# fallback to the default case.
if [[ $prev == @(<|>|>>|[12]>|[12]>>) ]] ; then
prev=''
last='skip'
continue ;
fi
prev=$opt
# get the subCoMmanD
if [[ ! $cmd && $opt \
&& ( $opt != -* || $opt == @(${specOpts// /|}) ) ]]
then
cmd=$opt
[[ $cmd == @($propCmds) ]] && isPropCmd=1
[[ $cmd == @($psCmds) ]] && isPsCmd=1
[[ $cmd == @(${helpOpts// /|}) ]] && cmd='help'
[[ $cmd = 'help' ]] && isHelpCmd=1
# HELP about a command asked with an option
if [[ $isHelpCmd && $cmd && $cmd != 'help' && ! $help ]]
then
help=$cmd
cmd='help'
fi
last='cmd'
continue
fi
# HELP about a command
if [[ $isHelpCmd && ! $help && $opt && $opt != -* ]]
then
help=$opt
last='help'
continue
fi
# PROPerty name
if [[ $isPropCmd && ! $prop && $opt && $opt != -* ]]
then
prop=$opt
[[ $prop == @(${revProps// /|}) ]] && isRevProp=1
last='prop'
continue
fi
# property VALue
if [[ $isPsCmd && $prop && ! $val && $opt != -* ]] ;
then
val=$opt
last='val'
continue
fi
if [[ $last != 'onlyarg' ]]
then
# more OPTions
case $opt in
-r|--revision|--revision=*)
hasRevisionOpt=1
;;
--revprop)
hasRevPropOpt=1
# restrict to revision properties!
allProps=( $revProps )
# on revprops, only one URL is expected
nExpectArgs=1
;;
-h|--help)
isHelpCmd=1
;;
-F|--file)
val='-F'
;;
--relocate)
hasRelocateOpt=1
;;
esac
# no more options, only arguments, whatever they look like.
if [[ $opt = '--' && ! $isCur ]] ; then
last='onlyarg'
continue
fi
# options are recorded...
if [[ $opt == -* ]] ; then
# but not the current one!
[[ ! $isCur ]] && options="$options $opt "
last='opt'
continue
fi
else
# onlyarg
let nargs++
continue
fi
# then we have an argument
last='arg'
let nargs++
done
[[ $stat ]] || stat=$last
# suggest all subcommands, including special help
if [[ ! $cmd || $stat = 'cmd' ]]
then
COMPREPLY=( $( compgen -W "$cmds $specOpts" -- $cur ) )
return 0
fi
# suggest all subcommands
if [[ $stat = 'help' || ( $isHelpCmd && ! $help ) ]]
then
COMPREPLY=( $( compgen -W "$cmds" -- $cur ) )
return 0
fi
# help about option arguments
if [[ $stat = 'skip' ]]
then
local previous=${COMP_WORDS[COMP_CWORD-1]}
local values= dirs= beep=
[[ $previous = '--config-dir' ]] && dirs=1
[[ $previous = '--native-eol' ]] && values='LF CR CRLF'
# just to suggest that a number is expected. hummm.
[[ $previous = '--limit' ]] && values='0 1 2 3 4 5 6 7 8 9'
# some special partial help about --revision option.
[[ $previous = '--revision' || $previous = '-r' ]] && \
values='HEAD BASE PREV COMMITTED 0 {'
[[ $previous = '--encoding' ]] && \
values="latin1 utf8 $SVN_BASH_ENCODINGS"
[[ $previous = '--extensions' || $previous = '-x' ]] && \
values="--unified --ignore-space-change \
--ignore-all-space --ignore-eol-style"
[[ $previous = '--depth' ]] && \
values='empty files immediates infinity'
[[ $previous = '--accept' ]] && \
{
# the list is different for 'resolve'
if [[ $cmd = 'resolve' ]] ; then
# from svn help resolve
values='base working mine-full theirs-full'
else # checkout merge switch update
# not implemented yet: mine-conflict theirs-conflict
values='postpone base mine-full theirs-full edit launch'
fi
}
if [[ $previous = '--username' ]] ; then
values="$SVN_BASH_USERNAME"
if [[ $SVN_BASH_COMPL_EXT == *username* ]] ; then
local file=
# digest? others?
for file in ~/.subversion/auth/svn.simple/* ; do
if [ -r $file ] ; then
values="$values $(_svn_read_hashfile username < $file)"
fi
done
fi
[[ ! "$values" ]] && beep=1
fi
# could look at ~/.subversion/ ?
# hmmm... this option should not exist
[[ $previous = '--password' ]] && beep=1
# TODO: provide help about other options such as:
# --old --new --with-revprop
# if the previous option required a parameter, do something
# or fallback on ordinary filename expansion
[[ $values ]] && COMPREPLY=( $( compgen -W "$values" -- $cur ) )
[[ $dirs ]] && COMPREPLY=( $( compgen -o dirnames -- $cur ) )
[[ $beep ]] &&
{
# 'no known completion'. hummm.
echo -en "\a"
COMPREPLY=( '' )
}
return 0
fi
# provide allowed property names after property commands
if [[ $isPropCmd && ( ! $prop || $stat = 'prop' ) && $cur != -* ]]
then
#
# Ok, this part is pretty ugly.
#
# The issue is that ":" is a completion word separator,
# which is a good idea for file:// urls but not within
# property names...
#
# The first idea was to remove locally ":" from COMP_WORDBREAKS
# and then put it back in all cases but in property name
# completion. It does not always work. There is a strange bug
# where one may get "svn:svn:xxx" in some unclear cases.
#
# Thus the handling is reprogrammed here...
# The code assumes that property names look like *:*,
# but it also works reasonably well with simple names.
local choices=
if [[ $cur == *:* ]]
then
# only suggest/show possible suffixes
local prefix=${cur%:*} suffix=${cur#*:} c=
for c in ${allProps[@]} ; do
[[ $c == $prefix:* ]] && choices="$choices ${c#*:}"
done
# everything will be appended to the prefix because ':' is
# a separator, so cur is restricted to the suffix part.
cur=$suffix
else
# only one choice is fine
COMPREPLY=( $( compgen -W "${allProps[*]}" -- $cur ) )
[ ${#COMPREPLY[@]} -eq 1 ] && return 0
# no ':' so only suggest prefixes?
local seen= n=0 last= c=
for c in ${allProps[@]%:*} ; do
# do not put the same prefix twice...
if [[ $c == $cur* && ( ! $seen || $c != @($seen) ) ]]
then
let n++
last=$c
choices="$choices $c:"
if [[ $seen ]]
then
seen="$seen|$c*"
else
seen="$c*"
fi
fi
done
# supply two choices to force a partial completion and a beep
[[ $n -eq 1 ]] && choices="$last:1 $last:2"
fi
COMPREPLY=( $( compgen -W "$choices" -- $cur ) )
return 0
fi
# force mandatory --revprop option on revision properties
if [[ $isRevProp && ! $hasRevPropOpt ]]
then
COMPREPLY=( $( compgen -W '--revprop' -- $cur ) )
return 0
fi
# force mandatory --revision option on revision properties
if [[ $isRevProp && $hasRevPropOpt && ! $hasRevisionOpt ]]
then
COMPREPLY=( $( compgen -W '--revision' -- $cur ) )
return 0
fi
# possible completion when setting property values
if [[ $isPsCmd && $prop && ( ! $val || $stat = 'val' ) ]]
then
# ' is a reminder for an arbitrary value
local values="\' --file"
case $prop in
svn:keywords)
# just a subset?
values="Id Rev URL Date Author \' $SVN_BASH_KEYWORDS"
;;
svn:executable|svn:needs-lock)
# hmmm... canonical value * is special to the shell.
values='\\*'
;;
svn:eol-style)
values='native LF CR CRLF'
;;
svn:mime-type)
# could read /etc/mime.types if available. overkill.
values="text/ text/plain text/html text/xml text/rtf
image/ image/png image/gif image/jpeg image/tiff
audio/ audio/midi audio/mpeg
video/ video/mpeg video/mp4
application/ application/octet-stream
$SVN_BASH_MIME_TYPE"
;;
esac
COMPREPLY=( $( compgen -W "$values" -- $cur ) )
# special case for --file... return even if within an option
[[ ${COMPREPLY} ]] && return 0
fi
# force mandatory --accept option for 'resolve' command
if [[ $cmd = 'resolve' && ! $acceptOpt ]]
then
COMPREPLY=( $( compgen -W '--accept' -- $cur ) )
# force option now! others will be available on later completions
return 0
fi
# maximum number of additional arguments expected in various forms
case $cmd in
merge)
nExpectArgs=3
;;
mergeinfo)
nExpectArgs=1
;;
copy|cp|move|mv|rename|ren|export|import)
nExpectArgs=2
;;
switch|sw)
[[ ! $hasRelocateOpt ]] && nExpectArgs=2
;;
help|h)
nExpectArgs=0
;;
--version)
nExpectArgs=0
;;
esac
# the maximum number of arguments is reached for a command
if [[ $nExpectArgs && $nargs -gt $nExpectArgs ]]
then
# some way to tell 'no completion at all'... is there a better one?
# Do not say 'file completion' here.
echo -en "\a"
COMPREPLY=( '' )
return 0
fi
# if not typing an option,
# then fallback on filename expansion...
if [[ $cur != -* || $stat = 'onlyarg' ]] ; then
# do we allow possible expensive completion here?
if [[ $SVN_BASH_COMPL_EXT == *svnstatus* ]] ; then
# build status command and options
# "--quiet" removes 'unknown' files
local status='svn status --non-interactive'
[[ $SVN_BASH_COMPL_EXT == *recurse* ]] || \
status="$status --non-recursive"
# I'm not sure that it can work with externals in call cases
# the output contains translatable sentences (even with quiet)
[[ $SVN_BASH_COMPL_EXT == *externals* ]] || \
status="$status --ignore-externals"
local cs= files=
# subtlety: must not set $cur* if $cur is empty in some cases
[[ $cur ]] && cs=$cur*
# 'files' is set according to the current subcommand
case $cmd in
st*) # status completion must include all files
files=$cur*
;;
ci|commit|revert|di*) # anything edited
files=$($status $cs| _svn_grcut '@([MADR!]*| M*|_M*)')
;;
add) # unknown files
files=$($status $cs| _svn_grcut '\?*')
;;
unlock) # unlock locked files
files=$($status $cs| _svn_grcut '@(??L*|?????[KOTB]*)')
;;
resolve*) # files in conflict
files=$($status $cs| _svn_grcut '@(?C*|C*)')
;;
praise|blame|ann*) # any svn file but added
files=$( _svn_lls all $cur* )
;;
p*) # prop commands
if [[ $cmd == @($propCmds) && \
$prop == @(svn:ignore|svn:externals) ]] ; then
# directory specific props
files=$( _svn_lls dir . $cur* )
else
# ??? added directories appear twice: foo foo/
files="$( _svn_lls all $cur* )
$($status $cs | _svn_grcut 'A*' )"
fi
;;
info) # information on any file
files="$( _svn_lls all $cur* )
$($status $cs | _svn_grcut 'A*' )"
;;
remove|rm|del*|move|mv|rename) # changing existing files
files=$( _svn_lls all $cur* )
;;
mkdir) # completion in mkdir can only be for subdirs?
files=$( _svn_lls dir $cur* )
;;
log|lock|up*|cl*|switch) # misc, all but added files
files=$( _svn_lls all $cur* )
;;
merge) # may do a better job? URL/WCPATH
files=$( _svn_lls all $cur* )
;;
ls|list) # better job? what about URLs?
files=$( _svn_lls all $cur* )
;;
*) # other commands: changelist export import cat mergeinfo
local fallback=1
;;
esac
# when not recursive, some relevant files may exist
# within subdirectories, so they are added here.
# should it be restricted to svn-managed subdirs? no??
if [[ $SVN_BASH_COMPL_EXT != *recurse* ]] ; then
files="$files $( _svn_lls dir $cur* )"
fi
# set completion depending on computed 'files'
if [[ $files ]] ; then
COMPREPLY=( $( compgen -W "$files" -- $cur ) )
# if empty, set to nope?
[[ "${COMPREPLY[*]}" ]] || COMPREPLY=( '' )
elif [[ ! $fallback ]] ; then
# this suggests no completion...
echo -en "\a"
COMPREPLY=( '' )
fi
fi
# else fallback to ordinary filename completion...
return 0
fi
# otherwise build possible options for the command
pOpts="--username --password --no-auth-cache --non-interactive"
mOpts="-m --message -F --file --encoding --force-log --with-revprop"
rOpts="-r --revision"
qOpts="-q --quiet"
nOpts="-N --non-recursive --depth"
gOpts="-g --use-merge-history"
cmdOpts=
case $cmd in
--version)
cmdOpts="$qOpts"
;;
add)
cmdOpts="--auto-props --no-auto-props --force --targets \
--no-ignore --parents $nOpts $qOpts $pOpts"
;;
blame|annotate|ann|praise)
cmdOpts="$rOpts $pOpts -v --verbose --incremental --xml \
-x --extensions --force $gOpts"
;;
cat)
cmdOpts="$rOpts $pOpts"
;;
changelist|cl)
cmdOpts="--targets $pOpts $qOpts --changelist \
-R --recursive --depth --remove"
;;
checkout|co)
cmdOpts="$rOpts $qOpts $nOpts $pOpts --ignore-externals \
--force --accept"
;;
cleanup)
cmdOpts="--diff3-cmd $pOpts"
;;
commit|ci)
cmdOpts="$mOpts $qOpts $nOpts --targets --editor-cmd $pOpts \
--no-unlock --changelist --keep-changelists"
;;
copy|cp)
cmdOpts="$mOpts $rOpts $qOpts --editor-cmd $pOpts --parents"
;;
delete|del|remove|rm)
cmdOpts="--force $mOpts $qOpts --targets --editor-cmd $pOpts \
--keep-local"
;;
diff|di)
cmdOpts="$rOpts -x --extensions --diff-cmd --no-diff-deleted \
$nOpts $pOpts --force --old --new --notice-ancestry \
-c --change --summarize --changelist --xml"
;;
export)
cmdOpts="$rOpts $qOpts $pOpts $nOpts --force --native-eol \
--ignore-externals"
;;
help|h|\?)
cmdOpts=
;;
import)
cmdOpts="--auto-props --no-auto-props $mOpts $qOpts $nOpts \
--no-ignore --editor-cmd $pOpts --force"
;;
info)
cmdOpts="$pOpts $rOpts --targets -R --recursive --depth \
--incremental --xml --changelist"
;;
list|ls)
cmdOpts="$rOpts -v --verbose -R --recursive $pOpts \
--incremental --xml --depth"
;;
lock)
cmdOpts="-m --message -F --file --encoding --force-log \
--targets --force $pOpts"
;;
log)
cmdOpts="$rOpts -v --verbose --targets $pOpts --stop-on-copy \
--incremental --xml $qOpts -l --limit -c --change \
$gOpts --with-all-revprops --with-revprop"
;;
merge)
cmdOpts="$rOpts $nOpts $qOpts --force --dry-run --diff3-cmd \
$pOpts --ignore-ancestry -c --change -x --extensions \
--record-only --accept --reintegrate"
;;
mergeinfo)
cmdOpts="$rOpts $pOpts --show-revs"
;;
mkdir)
cmdOpts="$mOpts $qOpts --editor-cmd $pOpts --parents"
;;
move|mv|rename|ren)
cmdOpts="$mOpts $rOpts $qOpts --force --editor-cmd $pOpts \
--parents"
;;
propdel|pdel|pd)
cmdOpts="$qOpts -R --recursive $rOpts $pOpts --changelist \
--depth"
[[ $isRevProp || ! $prop ]] && cmdOpts="$cmdOpts --revprop"
;;
propedit|pedit|pe)
cmdOpts="--editor-cmd $pOpts $mOpts --force"
[[ $isRevProp || ! $prop ]] && \
cmdOpts="$cmdOpts --revprop $rOpts"
;;
propget|pget|pg)
cmdOpts="-R --recursive $rOpts --strict $pOpts --changelist \
--depth --xml"
[[ $isRevProp || ! $prop ]] && cmdOpts="$cmdOpts --revprop"
;;
proplist|plist|pl)
cmdOpts="-v --verbose -R --recursive $rOpts --revprop $qOpts \
$pOpts --changelist --depth --xml"
;;
propset|pset|ps)
cmdOpts="$qOpts --targets -R --recursive \
--encoding $pOpts --force --changelist --depth"
[[ $isRevProp || ! $prop ]] && \
cmdOpts="$cmdOpts --revprop $rOpts"
[[ $val ]] || cmdOpts="$cmdOpts -F --file"
;;
resolve)
cmdOpts="--targets -R --recursive $qOpts $pOpts --accept \
--depth"
;;
resolved)
cmdOpts="--targets -R --recursive $qOpts $pOpts --depth"
;;
revert)
cmdOpts="--targets -R --recursive $qOpts --changelist \
--depth $pOpts"
;;
status|stat|st)
cmdOpts="-u --show-updates -v --verbose $nOpts $qOpts $pOpts \
--no-ignore --ignore-externals --incremental --xml \
--changelist"
;;
switch|sw)
cmdOpts="--relocate $rOpts $nOpts $qOpts $pOpts --diff3-cmd \
--force --accept --ignore-externals --set-depth"
;;
unlock)
cmdOpts="--targets --force $pOpts"
;;
update|up)
cmdOpts="$rOpts $nOpts $qOpts $pOpts --diff3-cmd \
--ignore-externals --force --accept --changelist \
--editor-cmd --set-depth"
;;
*)
;;
esac
# add options that are nearly always available
[[ "$cmd" != "--version" ]] && cmdOpts="$cmdOpts $helpOpts"
cmdOpts="$cmdOpts --config-dir"
# --accept (edit|launch) incompatible with --non-interactive
if [[ $acceptOpt == @(edit|launch) ]] ;
then
cmdOpts=${cmdOpts/ --non-interactive / }
fi
# take out options already given
for opt in $options
do
local optBase
# remove leading dashes and arguments
case $opt in
--*) optBase=${opt/=*/} ;;
-*) optBase=${opt:0:2} ;;
esac
cmdOpts=" $cmdOpts "
cmdOpts=${cmdOpts/ ${optBase} / }
# take out alternatives and mutually exclusives
case $optBase in
-v) cmdOpts=${cmdOpts/ --verbose / } ;;
--verbose) cmdOpts=${cmdOpts/ -v / } ;;
-N) cmdOpts=${cmdOpts/ --non-recursive / } ;;
--non-recursive) cmdOpts=${cmdOpts/ -N / } ;;
-R) cmdOpts=${cmdOpts/ --recursive / } ;;
--recursive) cmdOpts=${cmdOpts/ -R / } ;;
-x) cmdOpts=${cmdOpts/ --extensions / } ;;
--extensions) cmdOpts=${cmdOpts/ -x / } ;;
-q) cmdOpts=${cmdOpts/ --quiet / } ;;
--quiet) cmdOpts=${cmdOpts/ -q / } ;;
-h) cmdOpts=${cmdOpts/ --help / } ;;
--help) cmdOpts=${cmdOpts/ -h / } ;;
-l) cmdOpts=${cmdOpts/ --limit / } ;;
--limit) cmdOpts=${cmdOpts/ -l / } ;;
-r) cmdOpts=${cmdOpts/ --revision / } ;;
--revision) cmdOpts=${cmdOpts/ -r / } ;;
-c) cmdOpts=${cmdOpts/ --change / } ;;
--change) cmdOpts=${cmdOpts/ -c / } ;;
--auto-props) cmdOpts=${cmdOpts/ --no-auto-props / } ;;
--no-auto-props) cmdOpts=${cmdOpts/ --auto-props / } ;;
-g) cmdOpts=${cmdOpts/ --use-merge-history / } ;;
--use-merge-history)
cmdOpts=${cmdOpts/ -g / } ;;
-m|--message|-F|--file)
cmdOpts=${cmdOpts/ --message / }
cmdOpts=${cmdOpts/ -m / }
cmdOpts=${cmdOpts/ --file / }
cmdOpts=${cmdOpts/ -F / }
;;
esac
# remove help options within help subcommand
if [ $isHelpCmd ] ; then
cmdOpts=${cmdOpts/ -h / }
cmdOpts=${cmdOpts/ --help / }
fi
done
# provide help about available options
COMPREPLY=( $( compgen -W "$cmdOpts" -- $cur ) )
return 0
}
complete -F _svn -o default -X '@(*/.svn|*/.svn/|.svn|.svn/)' svn
_svnadmin ()
{
local cur cmds cmdOpts optsParam opt helpCmds optBase i
COMPREPLY=()
cur=${COMP_WORDS[COMP_CWORD]}
# Possible expansions, without pure-prefix abbreviations such as "h".
cmds='crashtest create deltify dump help hotcopy list-dblogs \
list-unused-dblogs load lslocks lstxns recover rmlocks \
rmtxns setlog setrevprop setuuid upgrade verify --version'
if [[ $COMP_CWORD -eq 1 ]] ; then
COMPREPLY=( $( compgen -W "$cmds" -- $cur ) )
return 0
fi
# options that require a parameter
# note: continued lines must end '|' continuing lines must start '|'
optsParam="-r|--revision|--parent-dir|--fs-type"
# if not typing an option, or if the previous option required a
# parameter, then fallback on ordinary filename expansion
helpCmds='help|--help|h|\?'
if [[ ${COMP_WORDS[1]} != @($helpCmds) ]] && \
[[ "$cur" != -* ]] || \
[[ ${COMP_WORDS[COMP_CWORD-1]} == @($optsParam) ]] ; then
return 0
fi
cmdOpts=
case ${COMP_WORDS[1]} in
create)
cmdOpts="--bdb-txn-nosync --bdb-log-keep --config-dir \
--fs-type --pre-1.4-compatible --pre-1.5-compatible"
;;
deltify)
cmdOpts="-r --revision -q --quiet"
;;
dump)
cmdOpts="-r --revision --incremental -q --quiet --deltas"
;;
help|h|\?)
cmdOpts="$cmds -q --quiet"
;;
hotcopy)
cmdOpts="--clean-logs"
;;
load)
cmdOpts="--ignore-uuid --force-uuid --parent-dir -q --quiet \
--use-pre-commit-hook --use-post-commit-hook"
;;
recover)
cmdOpts="--wait"
;;
rmtxns)
cmdOpts="-q --quiet"
;;
setlog)
cmdOpts="-r --revision --bypass-hooks"
;;
setrevprop)
cmdOpts="-r --revision --use-pre-revprop-change-hook \
--use-post-revprop-change-hook"
;;
verify)
cmdOpts="-r --revision -q --quiet"
;;
*)
;;
esac
cmdOpts="$cmdOpts --help -h"
# take out options already given
for (( i=2; i<=$COMP_CWORD-1; ++i )) ; do
opt=${COMP_WORDS[$i]}
case $opt in
--*) optBase=${opt/=*/} ;;
-*) optBase=${opt:0:2} ;;
esac
cmdOpts=" $cmdOpts "
cmdOpts=${cmdOpts/ ${optBase} / }
# take out alternatives
case $optBase in
-q) cmdOpts=${cmdOpts/ --quiet / } ;;
--quiet) cmdOpts=${cmdOpts/ -q / } ;;
-h) cmdOpts=${cmdOpts/ --help / } ;;
--help) cmdOpts=${cmdOpts/ -h / } ;;
-r) cmdOpts=${cmdOpts/ --revision / } ;;
--revision) cmdOpts=${cmdOpts/ -r / } ;;
esac
# skip next option if this one requires a parameter
if [[ $opt == @($optsParam) ]] ; then
((++i))
fi
done
COMPREPLY=( $( compgen -W "$cmdOpts" -- $cur ) )
return 0
}
complete -F _svnadmin -o default svnadmin

3
bash_completion.d/xinit Normal file
View File

@ -0,0 +1,3 @@
complete -W "$(cat $HOME/.xinitrc | awk '/^ *exec/ { print $2 }' | sed 's/\$.*//g')" -o default xinit
# vim:filetype=sh

261
bash_functions Normal file
View File

@ -0,0 +1,261 @@
function home_as_tilde(){
echo $1 | sed "s@^$HOME@~@"
}
function trunc_pwd(){
if [ "$PWD" == "$HOME" ]
then
echo "~"
else
parts=($(echo $PWD | tr " " "_" | tr "/" "\n"))
parts_len="${#parts[*]}"
max_parts="4"
if [ $parts_len -le $max_parts ]
then
home_as_tilde $PWD
else
startslice=$(expr $parts_len - $max_parts)
out=""
for p in ${parts[@]:$startslice}
do
out="$out$p/"
done
echo ">" `home_as_tilde "$out" | sed "s@/\\\$@@"`
fi
fi
}
function __available_projects(){
/bin/ls $HOME/src | tr " " "\n"
}
function __proj_activate_comp(){
cur=${COMP_WORDS[COMP_CWORD]}
if [ $COMP_CWORD -eq 1 ]
then
COMPREPLY=( $( compgen -W "$(__available_projects)" $cur ) )
fi
}
function __proj_deactivate_reactivate_comp(){
cur=${COMP_WORDS[COMP_CWORD]}
if [ -n "$VIRTUAL_ENV" ]
then
COMPREPLY=( $(basename "$VIRTUAL_ENV") )
return 0
elif [ -n "$PROJ" ]
then
COMPREPLY=( $(basename "$PROJ") )
return 0
else
COMPREPLY=( $cur )
fi
}
function a(){
source $HOME/.activate_proj "$@"
}
function d(){
source $HOME/.deactivate_proj "$@"
}
function r(){
d "$1"
a "$1"
}
complete -F __proj_activate_comp -o default a
complete -F __proj_deactivate_reactivate_comp -o default d r
_CRUFTY_CRAP=(
'.*\.pyc$'
'.*~$'
'.*\.[^.]*\.bak$'
)
function decruft(){
local here_files=( "$(/bin/ls $PWD)" )
for fname in ${here_files[*]}
do
for pattern in ${_CRUFTY_CRAP[*]}
do
if [ -n "$(echo $fname | grep -E "$pattern")" ]
then
[ -n "$DEBUG" ] && echo "removing $fname"
rm -f "$fname"
fi
done
done
}
# if the command-not-found package is installed, use it
if [ -x /usr/lib/command-not-found ]; then
command_not_found_handle(){
# check because c-n-f could've been removed in the meantime
if [ -x /usr/lib/command-not-found ]; then
/usr/bin/python /usr/lib/command-not-found -- $1
return $?
else
return 127
fi
}
fi
function add_ssh_keys()
{
if [[ "$1" == "all" ]]
then
for key in $__SSH_KEYS__
do
ssh-add $key
done
else
ssh-add
fi
}
function get_ssh_agent(){
ssh-add -l
test $? -eq 2 || return
agent_out="$HOME/.ssh/agent.out"
source $agent_out
ssh-add -l
test $? -eq 2 || return
ssh-agent > $agent_out
source $agent_out
ssh-add
}
function get_gpg_agent(){
agent_out="$HOME/.gnupg/agent.out"
tmp=$(mktemp /tmp/gnupgXXXX)
gpg-agent $* > $tmp && mv $tmp $agent_out
grep GPG_TTY $agent_out || \
cat >> $agent_out <<EOF
export GPG_TTY="$(tty)"
EOF
source $agent_out
}
function retag(){
langs="python"
if [ -n "$1" ] ; then
langs="$langs,$1"
fi
rm -f $PWD/tags
ctags --recurse=yes --languages=$langs $PWD
}
function top_commands(){
history | awk '{ print $2 }' | sort | uniq -c | sort -k1 -rn | head
}
function svn_clean(){
for f in `svn status | grep ^?` ; do
name="`echo $f | sed \"s/\? *//\"`" ;
name="`echo $name | sed \"s/ //g\"`" ;
if [ -n "$name" ] ; then
cmd="rm -rf $name ";
echo "# ---> $cmd"
eval $cmd
fi
done
}
function hg_clean(){
find -name \*.orig -exec rm -v {} \;
find -name \*.rej -exec rm -v {} \;
unknown="$(hg status | awk '/^\?/ { print $2 }')"
test -n "$unknown" && rm -v "$unknown"
}
function svn_conflicts(){
svn status | grep -E '^!? *C'
}
function rss_pid_command(){
cmd="ps -o rss,pid,command U $USER"
if [ -n "$1" ] ; then
grep_filter="grep $1"
$cmd | $grep_filter | grep -v "$grep_filter"
else
$cmd
fi
}
function precmd(){
PS1="\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;32m\]"
PS1="$PS1$(trunc_pwd)\[\033[00m\] "
local pcla="$(which print-color-loadavg 2>/dev/null)"
test -n "$pcla" && test -x $pcla && PS1="$PS1($(print-color-loadavg)) "
PS1="$PS1$(__git_ps1 "(%s)")\n\$ "
if [ -n "$1" ]
then
echo "$PS1"
else
export PS1
fi
}
function __git_branch_and_description(){
([[ "$(git rev-parse --is-inside-work-tree 2>/dev/null)" == "true" ]] || \
[[ "$(git rev-parse --is-inside-git-dir 2>/dev/null)" == "true" ]]) && (
echo -n $(git branch 2>/dev/null | grep '*' | awk '{ print $2 }')
desc=$(cat $(git rev-parse --git-dir)/description | grep -v '^Unnamed repository')
test -n "$desc" && echo " \[\033[32m\]$desc\[\033[00m\]"
)
}
function make_pythonpath_local_only(){
export PYTHONPATH="$(
echo $PYTHONPATH | tr ":" "\n" | sort | uniq | \
grep -v -E '/(usr|var)' | grep -v '^$' | tr "\n" ":"
)"
}
function svn_list_unknown(){
svn st | awk '/^?/ { gsub(/^? */, "", $0) ; print $0 }'
}
function svn_add_unknown(){
svn add $(svn_list_unknown)
}
function unhyphenate(){
ruby -e "puts '$1'.gsub(/[\-_]/, ' ')"
}
# vim:filetype=sh

74
bash_profile Normal file
View File

@ -0,0 +1,74 @@
_debug(){
if [ -n "$DEBUG" ] ; then
echo $*
fi
}
_get_hostname(){
local hn="$(hostname -a 2>/dev/null || hostname)"
local ha=""
for host in $hn ; do
if [[ "$(echo $host | grep "\." | grep -v "localhost")" != "" ]] ; then
ha="$host"
fi
done
if [ -n "$ha" ] ; then
echo "$ha"
else
echo ""
fi
}
_source_host_specific_rcfile(){
local _host_alias="`_get_hostname`"
if [[ ! -n "$_host_alias" ]] ; then
_host_alias="`hostname`"
fi
local _host_specific_rcfile="$HOME/.bash_vars.$_host_alias"
if [[ -e "$_host_specific_rcfile" ]] ; then
debug "sourcing $_host_specific_rcfile"
source $_host_specific_rcfile
fi
}
_source_bash_extras()
{
local _BASH_EXTRAS="
$HOME/.bash_aliases
$HOME/.bash_functions
/etc/bash_completion
$HOME/.bash_completion
"
for ext in $_BASH_EXTRAS ; do
if [ -e "$ext" ] ; then
_debug "sourcing $ext"
source $ext
fi
done
}
_bash_profile_main()
{
source "$HOME/.bash_vars_common"
_source_host_specific_rcfile
_source_bash_extras
get_ssh_agent
get_gpg_agent
eval "$(rbenv init -)"
unset _get_hostname
unset _source_host_specific_rcfile
unset _source_bash_extras
unset _bash_profile_main
}
_bash_profile_main
# vim:filetype=sh

109
bash_vars_common Normal file
View File

@ -0,0 +1,109 @@
if [ "$TERM" != "dumb" ] && $(dircolors -b >/dev/null 2>&1)
then
eval "`dircolors -b`"
fi
export EDITOR=vim
export VISUAL=vim
export FLASHPLAYER_HOME=$HOME/.local/share/flashplayer
export FLEX_HOME=$HOME/opt/flex-sdk
export _LOC_ACLOCAL="$HOME/share/aclocal"
if [ -d "$HOME/share/aclocal" ]
then
ACLOCAL_PATH="$_LOC_ACLOCAL:$ACLOCAL_PATH"
ACLOCAL_FLAGS="-I $_LOC_ACLOCAL"
for d in $(find $HOME/share/aclocal -type d)
do
ACLOCAL_PATH="$ACLOCAL_PATH:$d"
ACLOCAL_FLAGS="-I $d $ACLOCAL_FLAGS"
done
export ACLOCAL_PATH
export ACLOCAL_FLAGS
unset d
fi
function __addjars(){
if [ -d "$1" ] ; then
for j in $(find $1 -name \*.jar) ; do
CLASSPATH="$CLASSPATH:$j"
done
unset j
fi
export CLASSPATH
}
function __normclasspath(){
tmp=/tmp/$RANDOM.$RANDOM.$RANDOM.cp
echo $CLASSPATH | tr ":" "\n" > $tmp
cat $tmp | sed -e "s/^://" | sort | uniq | tr "\n" ":"
}
CLASSPATH="$PWD"
JYTHON_HOME="/opt/jython"
PRIVATE_JARS_HOME="$HOME/.local/private-jars"
FLEX_JARS="$FLEX_HOME/lib"
__addjars "$JYTHON_HOME/extlibs"
__addjars "$PRIVATE_JARS_HOME"
__addjars "$FLEX_JARS"
__addjars "/usr/share/java"
CLASSPATH="$(__normclasspath)"
export CLASSPATH
export HISTCONTROL=ignoreboth
LD_LIBRARY_PATH="/usr/include:/usr/include/python2.5:$HOME/lib"
for d in mysql python2.6 pkgconfig engines ; do
LD_LIBRARY_PATH="$HOME/lib/$d:$LD_LIBRARY_PATH"
done
unset d
LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$HOME/include:$HOME/include/python2.6"
LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$HOME/include/wx-2.8"
export LD_LIBRARY_PATH
export INCLUDE_PATH="$LD_LIBRARY_PATH:$HOME/include/python2.5:/usr/include"
LIB_PATH=$LD_LIBRARY_PATH:$LIB_PATH
export LIB_PATH
PATH="$HOME/bin:$HOME/.local/bin:/usr/local/bin:/usr/local/sbin:$PATH"
PATH="$PATH:$FLEX_HOME/bin:$FLASHPLAYER_HOME/bin"
PATH="$PATH:/opt/java/bin"
PATH="$HOME/.rbenv/bin:$PATH"
export PATH
export PS1="%m %d %# "
export PROMPT_COMMAND='PS1=$(precmd yup)'
export PS2=">>> "
PYTHONPATH="$HOME/lib/python2.6/site-packages:$PYTHONPATH"
PYTHONPATH="/usr/lib/python2.6/site-packages:$PYTHONPATH"
PYTHONPATH="$PYTHONPATH:/var/lib/python-support/python2.5"
PYTHONPATH="$PYTHONPATH:$HOME/lib/svn-python"
PYTHONPATH="$PYTHONPATH:/var/lib/python-support/python2.6"
export PYTHONPATH
export LUA_PATH="$HOME/share/lua/5.1/?.lua;;"
export __SSH_KEYS__="$(/bin/ls $HOME/.ssh/*_*sa)"
export PKG_CONFIG_PATH="$HOME/lib/pkgconfig:$PKG_CONFIG_PATH"
export CMAKE_ROOT="$HOME/share/cmake-2.8"
export OSYNC_TRACE="$HOME/var/tmp/opensync"
export OSYNC_NOPRIVACY=1
export WINEPREFIX="$HOME/.wine"
export GREP_COLOR=auto
export GIT_PS1_SHOWDIRTYSTATE="1"
export GIT_PS1_SHOWSTASHSTATE="1"
export GIT_PS1_SHOWUNTRACKEDFILES="1"
export GIT_PS1_SHOWUPSTREAM="auto"
export GIT_PS1_DESCRIBE_STYLE="default"
# ^--- could also be "contains", "branch", or "describe"
# vim:filetype=sh

30
bash_vars_darwin Normal file
View File

@ -0,0 +1,30 @@
export MAGICK_HOME="/opt/ImageMagick-6.6.7"
export DYLD_LIBRARY_PATH="$MAGICK_HOME/lib/"
export VIMRUNTIME="/usr/local/MacVim.app/Contents/Resources/vim/vim73"
export EDITOR='mvim --remote-wait-silent'
export VISUAL='mvim --remote-wait-silent'
export TF_DIFF_COMMAND='colordiff -u --label "%6 / %7" "%1" "%2"'
_PF_VERSIONS="/Library/Frameworks/Python.framework/Versions"
if [[ -d $_PF_VERSIONS ]]
then
for _version in $(/bin/ls $_PF_VERSIONS | grep -v Current)
do
PATH="$_PF_VERSIONS/$_version/bin:$PATH"
if [[ "$_version" == "2.7" ]]
then
PYTHONPATH="$_PF_VERSIONS/$_version/lib/python${_version}:$PYTHONPATH"
fi
done
fi
unset _PF_VERSIONS
unset _version
PATH="$PATH:/opt/TEE-CLC-10.0.0:$MAGICK_HOME/bin"
export PATH
export PYTHONPATH
# vim:filetype=sh

15
bashrc Normal file
View File

@ -0,0 +1,15 @@
test -n "$PROMPT_COMMAND" && unset PROMPT_COMMAND
PATH="$HOME/bin:$PATH"
export PATH
export PS1="\u@\h:\w\$ "
test -f "$HOME/.bashrc_local" && source "$HOME/.bashrc_local"
if test -t 0
then
source ~/.bash_aliases
source ~/.bash_functions
fi
# vim:filetype=sh

31
colordiffrc Normal file
View File

@ -0,0 +1,31 @@
# Example colordiffrc file for dark backgrounds
#
# Set banner=no to suppress authorship info at top of
# colordiff output
banner=no
# By default, when colordiff output is being redirected
# to a file, it detects this and does not colour-highlight
# To make the patch file *include* colours, change the option
# below to 'yes'
color_patches=no
# available colours are: white, yellow, green, blue,
# cyan, red, magenta, black,
# darkwhite, darkyellow, darkgreen,
# darkblue, darkcyan, darkred,
# darkmagenta, darkblack
#
# Can also specify 'none', 'normal' or 'off' which are all
# aliases for the same thing, namely "don't colour highlight
# this, use the default output colour"
#
plain=off
newtext=green
oldtext=red
diffstuff=yellow
cvsstuff=white
# vim:filetype=cfg

32
deactivate_proj Normal file
View File

@ -0,0 +1,32 @@
#!/bin/sh
__run_deactivate()
{
if [ -n "$1" ] ; then
project=${1}
PROJDIR=${HOME}/src/${project}
if [[ -d $PROJDIR ]] ; then
export PROJSRC=${PROJDIR}/src/${project}
export PROJBIN=${PROJDIR}/bin
if [[ -e deactivate ]] ; then
deactivate ${PROJBIN}/activate
fi
echo "${project} deactivated"
unset _HAS_GIT _HAS_HG _HG_BRANCH PROJ
cd "${HOME}"
source ${HOME}/.bash_profile
elif [[ -e deactivate ]] ; then
deactivate
else
echo "You are not in project ${project}."
echo "Furthermore, the 'deactivate' function does not exist right now."
fi
else
echo "Usage: $HOME/.deactivate_proj <projname>"
fi
}
__run_deactivate "$@"
unset __run_deactivate
# vim:ft=sh

1
gemrc Normal file
View File

@ -0,0 +1 @@
gem: --no-rdoc --ri

6
git-global-ignores Normal file
View File

@ -0,0 +1,6 @@
*.pyc
*.[oa]
*.so
tags
TAGS
*.rbc

77
gitconfig Normal file
View File

@ -0,0 +1,77 @@
[user]
name = Dan Buch
email = daniel.buch@gmail.com
[core]
excludesfile = ~/.git-global-ignores
autocrlf = false
[daemon]
uploadpack = true
uploadarch = true
receivepack = true
[color]
ui = auto
[color "branch"]
current = yellow reverse
local = yellow
remote = green
[color "diff"]
meta = yellow bold
frag = magenta bold
old = red bold
new = green bold
[color "status"]
added = yellow
changed = green
untracked = cyan
[alias]
a = add
ad = add
addd = add
br = branch
bra = branch -a
brr = branch -r
ci = commit
co = checkout
d = diff
dc = diff --cached
di = diff
dif = diff
l = ls-files
ls = ls-files
nuke = clean -dfx
pr = pull --rebase
s = status
st = status
sta = stash
stcq = diff --cached --name-only
stq = diff --name-only
t = tag
ta = tag
tags = tag
slog = log git-svn..
sup = svn fetch --all
spush = svn dcommit
srb = rebase git-svn
cm = checkout master
lm = log master..
rt = rebase trunk
lt = log trunk..
ct = checkout svn/trunk
logv = log --name-status
[clean]
requireForce = false
# vim:filetype=cfg

32
gitk Normal file
View File

@ -0,0 +1,32 @@
set mainfont {Helvetica 9}
set textfont {Courier 9}
set uifont {Helvetica 9 bold}
set tabstop 8
set findmergefiles 0
set maxgraphpct 50
set maxwidth 16
set cmitmode patch
set wrapcomment none
set autoselect 1
set showneartags 1
set showlocalchanges 1
set datetimeformat {%Y-%m-%d %H:%M:%S}
set limitdiffs 1
set bgcolor white
set fgcolor black
set colors {green red blue magenta darkgrey brown orange}
set diffcolors {red "#00a000" blue}
set diffcontext 3
set selectbgcolor gray85
set extdifftool meld
set geometry(main) 1680x952+0+25
set geometry(topwidth) 1678
set geometry(topheight) 520
set geometry(pwsash0) "618 1"
set geometry(pwsash1) "928 1"
set geometry(botwidth) 772
set geometry(botheight) 420
set permviews {}
# vim:filetype=sh

3
gvimrc.after Normal file
View File

@ -0,0 +1,3 @@
" this file is sourced by Janus stuff
set guifont=Mensch\ 8

120
hgrc Normal file
View File

@ -0,0 +1,120 @@
[ui]
username = Dan Buch <daniel.buch@gmail.com>
debug = off
style = default
[pager]
pager = LESS='FSRX' less
quiet = true
attend = status, diff, log, glog, heads, branches, outgoing, incoming
[diff]
git = true
gui = false
[merge-patterns]
* = vimdiff
[merge-tools]
kdiff3.gui = false
gpyfm.gui = false
meld.gui = false
tkdiff.gui = false
xxdiff.gui = false
diffmerge.gui = false
p4merge.gui = false
ecmerge.gui = false
beyondcompare3.gui = false
vimdiff.executable = vimdiff
vimdiff.args = $local $other
vimdiff.priority = 1
[gpg]
key = 0x6DD3E3EC
[color]
# diff.diffline = bold
# diff.extended = cyan bold
# diff.file_a = red bold
# diff.file_b = green bold
# diff.hunk = magenta
# diff.deleted = red
# diff.inserted = green
# diff.changed = white
# diff.trailingwhitespace = bold red_background
# status.modified = magenta bold
# status.added = green bold
# status.removed = red bold
# status.deleted = cyan bold
# status.unknown = blue bold
# status.ignored = black bold
# qseries.applied = blue bold underline
# qseries.unapplied = black bold
# qseries.missing = red bold
# [merge-tools.diffmerge]
# gui = False
# checkchanged = True
# [merge-tools.filemerge]
# gui = False
# [merge-tools.gvimdiff]
# priority = -9
# [merge-tools.kdiff3]
# fixeol = True
# gui = False
# [merge-tools.merge]
# checkconflicts = True
# priority = -10
# [merge-tools.xxdiff]
# gui = False
# priority = -8
[extensions]
# hgext.acl =
hgext.bookmarks =
# hgext.bugzilla =
# hgext.children =
hgext.churn =
hgext.color =
hgext.convert =
# hgext.crecord =
# hgext.eol =
# hgext.extdiff =
# hgext.fetch =
# hgext.gpg =
hgext.graphlog =
# hgext.hgcia =
hgext.hgk =
# hgext.interhg =
# hgext.keyword =
# hgext.mq =
hgext.notify =
hgext.pager =
# hgext.parentrevspec =
# hgext.patchbomb =
hgext.progress =
hgext.purge =
hgext.rebase =
hgext.record =
# hgext.relink =
# hgext.schemes =
# hgext.share =
hgext.transplant =
# hgext.win32mbcs =
# hgext.win32text =
hgext.imerge = !
# hglocalbranch =
# hgshelve =
# hgsubversion =
# prompt = ~/repos/hg-prompt.hg/prompt.py
# activity = ~/repos/Hgactivity.hg/activity.py
# vim:filetype=cfg

23
htoprc Normal file
View File

@ -0,0 +1,23 @@
# Beware! This file is rewritten every time htop exits.
# The parser is also very primitive, and not human-friendly.
# (I know, it's in the todo list).
fields=0 48 17 18 38 39 40 22 2 33 46 47 49 16 1
sort_key=46
sort_direction=1
hide_threads=1
hide_kernel_threads=1
hide_userland_threads=1
shadow_other_users=0
show_thread_names=0
highlight_base_name=1
highlight_megabytes=1
highlight_threads=1
tree_view=1
header_margin=1
detailed_cpu_time=1
color_scheme=1
delay=15
left_meters=AllCPUs CPU Memory Swap
left_meter_modes=1 1 1 1
right_meters=Tasks LoadAverage Uptime Battery Clock
right_meter_modes=2 2 2 2 2

4
inputrc Normal file
View File

@ -0,0 +1,4 @@
set show-all-if-ambiguous on
set visible-stats on
set editing-mode vi
set keymap vi

1
irbrc Normal file
View File

@ -0,0 +1 @@
require 'irb/completion'

10
janus.rake Normal file
View File

@ -0,0 +1,10 @@
# TODO: make this crap work with the new Janus method via pathogen
vim_plugin_task "valgrind", "git://github.com/vim-scripts/valgrind.vim.git"
vim_plugin_task "guicolorscheme", "git://github.com/vim-scripts/guicolorscheme.vim.git"
vim_plugin_task "gardener.vim" do
sh "curl 'http://www.vim.org/scripts/download_script.php?src_id=4682' > colors/gardener.vim"
end
vim_plugin_task "pgsql.vim" do
sh "curl 'http://www.gunduz.org/postgresql/pgsql.vim' > plugin/pgsql.vim"
end

1
libtrash Normal file
View File

@ -0,0 +1 @@
TRASH_CAN = .Trash

341
lynxrc Normal file
View File

@ -0,0 +1,341 @@
# Lynx User Defaults File
#
# This file contains options saved from the Lynx Options Screen (normally
# with the 'o' key). To save options with that screen, you must select the
# checkbox:
# Save options to disk
#
# You must then save the settings using the link on the line above the
# checkbox:
# Accept Changes
#
# You may also use the command-line option "-forms_options", which displays
# the simpler Options Menu instead. Save options with that using the '>' key.
#
# There is normally no need to edit this file manually, since the defaults
# here can be controlled from the Options Screen, and the next time options
# are saved from the Options Screen this file will be completely rewritten.
# You have been warned...
#
# If you are looking for the general configuration file - it is normally
# called "lynx.cfg". It has different content and a different format.
# It is not this file.
# accept_all_cookies allows the user to tell Lynx to automatically
# accept all cookies if desired. The default is "FALSE" which will
# prompt for each cookie. Set accept_all_cookies to "TRUE" to accept
# all cookies.
accept_all_cookies=on
# anonftp_password allows the user to tell Lynx to use the personal
# email address as the password for anonymous ftp. If no value is given,
# Lynx will use the personal email address. Set anonftp_password
# to a different value if you choose.
anonftp_password=
# bookmark_file specifies the name and location of the default bookmark
# file into which the user can paste links for easy access at a later
# date.
bookmark_file=~/.lynx_bookmarks.html
# If case_sensitive_searching is "on" then when the user invokes a search
# using the 's' or '/' keys, the search performed will be case sensitive
# instead of case INsensitive. The default is usually "off".
case_sensitive_searching=on
# The character_set definition controls the representation of 8 bit
# characters for your terminal. If 8 bit characters do not show up
# correctly on your screen you may try changing to a different 8 bit
# set or using the 7 bit character approximations.
# Current valid characters sets are:
# Western (ISO-8859-1)
# 7 bit approximations (US-ASCII)
# Western (ISO-8859-15)
# Western (cp850)
# Western (windows-1252)
# IBM PC US codepage (cp437)
# DEC Multinational
# Macintosh (8 bit)
# NeXT character set
# HP Roman8
# Chinese
# Japanese (EUC-JP)
# Japanese (Shift_JIS)
# Korean
# Taipei (Big5)
# Vietnamese (VISCII)
# Transparent
# Eastern European (ISO-8859-2)
# Eastern European (cp852)
# Eastern European (windows-1250)
# Latin 3 (ISO-8859-3)
# Latin 4 (ISO-8859-4)
# Baltic Rim (ISO-8859-13)
# Baltic Rim (cp775)
# Baltic Rim (windows-1257)
# Cyrillic (ISO-8859-5)
# Cyrillic (cp866)
# Cyrillic (windows-1251)
# Cyrillic (KOI8-R)
# Arabic (ISO-8859-6)
# Arabic (cp864)
# Arabic (windows-1256)
# Celtic (ISO-8859-14)
# Greek (ISO-8859-7)
# Greek (cp737)
# Greek2 (cp869)
# Greek (windows-1253)
# Hebrew (ISO-8859-8)
# Hebrew (cp862)
# Hebrew (windows-1255)
# Turkish (ISO-8859-9)
# Turkish (cp857)
# North European (ISO-8859-10)
# UNICODE (UTF-8)
# RFC 1345 w/o Intro
# RFC 1345 Mnemonic
# Ukrainian Cyrillic (cp866u)
# Ukrainian Cyrillic (KOI8-U)
# Cyrillic-Asian (PT154)
character_set=UNICODE (UTF-8)
# cookie_accept_domains and cookie_reject_domains are comma-delimited
# lists of domains from which Lynx should automatically accept or reject
# all cookies. If a domain is specified in both options, rejection will
# take precedence. The accept_all_cookies parameter will override any
# settings made here.
cookie_accept_domains=
# cookie_file specifies the file from which to read persistent cookies.
# The default is ~/.lynx_cookies.
cookie_file=~/.lynx_cookies
# cookie_loose_invalid_domains, cookie_strict_invalid_domains, and
# cookie_query_invalid_domains are comma-delimited lists of which domains
# should be subjected to varying degrees of validity checking. If a
# domain is set to strict checking, strict conformance to RFC2109 will
# be applied. A domain with loose checking will be allowed to set cookies
# with an invalid path or domain attribute. All domains will default to
# querying the user for an invalid path or domain.
cookie_loose_invalid_domains=
cookie_query_invalid_domains=
cookie_reject_domains=
cookie_strict_invalid_domains=
# dir_list_order specifies the directory list order under DIRED_SUPPORT
# (if implemented). The default is "ORDER_BY_NAME"
dir_list_order=ORDER_BY_NAME
# dir_list_styles specifies the directory list style under DIRED_SUPPORT
# (if implemented). The default is "MIXED_STYLE", which sorts both
# files and directories together. "FILES_FIRST" lists files first and
# "DIRECTORIES_FIRST" lists directories first.
dir_list_style=MIXED_STYLE
# If emacs_keys is to "on" then the normal EMACS movement keys:
# ^N = down ^P = up
# ^B = left ^F = right
# will be enabled.
emacs_keys=off
# file_editor specifies the editor to be invoked when editing local files
# or sending mail. If no editor is specified, then file editing is disabled
# unless it is activated from the command line, and the built-in line editor
# will be used for sending mail.
file_editor=vim
# The file_sorting_method specifies which value to sort on when viewing
# file lists such as FTP directories. The options are:
# BY_FILENAME -- sorts on the name of the file
# BY_TYPE -- sorts on the type of the file
# BY_SIZE -- sorts on the size of the file
# BY_DATE -- sorts on the date of the file
file_sorting_method=BY_FILENAME
# ROT13'd keyboard layout
# JCUKEN Cyrillic, for AT 101-key kbd
# YAWERTY Cyrillic, for DEC LK201 kbd
kblayout=ROT13'd keyboard layout
# If keypad_mode is set to "NUMBERS_AS_ARROWS", then the numbers on
# your keypad when the numlock is on will act as arrow keys:
# 8 = Up Arrow
# 4 = Left Arrow 6 = Right Arrow
# 2 = Down Arrow
# and the corresponding keyboard numbers will act as arrow keys,
# regardless of whether numlock is on.
# If keypad_mode is set to "LINKS_ARE_NUMBERED", then numbers will
# appear next to each link and numbers are used to select links.
# If keypad_mode is set to "LINKS_AND_FORM_FIELDS_ARE_NUMBERED", then
# numbers will appear next to each link and visible form input field.
# Numbers are used to select links, or to move the "current link" to a
# form input field or button. In addition, options in popup menus are
# indexed so that the user may type an option number to select an option in
# a popup menu, even if the option isn't visible on the screen. Reference
# lists and output from the list command also enumerate form inputs.
# NOTE: Some fixed format documents may look disfigured when
# "LINKS_ARE_NUMBERED" or "LINKS_AND_FORM_FIELDS_ARE_NUMBERED" are
# enabled.
keypad_mode=LINKS_AND_FORM_FIELDS_ARE_NUMBERED
# lineedit_mode specifies the key binding used for inputting strings in
# prompts and forms. If lineedit_mode is set to "Default Binding" then
# the following control characters are used for moving and deleting:
#
# Prev Next Enter = Accept input
# Move char: <- -> ^G = Cancel input
# Move word: ^P ^N ^U = Erase line
# Delete char: ^H ^R ^A = Beginning of line
# Delete word: ^B ^F ^E = End of line
#
# Current lineedit modes are:
# Default Binding
# Alternate Bindings
# Bash-like Bindings
lineedit_mode=Bash-like Bindings
# The following allow you to define sub-bookmark files and descriptions.
# The format is multi_bookmark<capital_letter>=<filename>,<description>
# Up to 26 bookmark files (for the English capital letters) are allowed.
# We start with "multi_bookmarkB" since 'A' is the default (see above).
multi_bookmarkB=
multi_bookmarkC=
multi_bookmarkD=
multi_bookmarkE=
multi_bookmarkF=
multi_bookmarkG=
multi_bookmarkH=
multi_bookmarkI=
multi_bookmarkJ=
multi_bookmarkK=
multi_bookmarkL=
multi_bookmarkM=
multi_bookmarkN=
multi_bookmarkO=
multi_bookmarkP=
multi_bookmarkQ=
multi_bookmarkR=
multi_bookmarkS=
multi_bookmarkT=
multi_bookmarkU=
multi_bookmarkV=
multi_bookmarkW=
multi_bookmarkX=
multi_bookmarkY=
multi_bookmarkZ=
# personal_mail_address specifies your personal mail address. The
# address will be sent during HTTP file transfers for authorization and
# logging purposes, and for mailed comments.
# If you do not want this information given out, set the NO_FROM_HEADER
# to TRUE in lynx.cfg, or use the -nofrom command line switch. You also
# could leave this field blank, but then you won't have it included in
# your mailed comments.
personal_mail_address=daniel.buch@gmail.com
# preferred_charset specifies the character set in MIME notation (e.g.,
# ISO-8859-2, ISO-8859-5) which Lynx will indicate you prefer in requests
# to http servers using an Accept-Charset header. The value should NOT
# include ISO-8859-1 or US-ASCII, since those values are always assumed
# by default. May be a comma-separated list.
# If a file in that character set is available, the server will send it.
# If no Accept-Charset header is present, the default is that any
# character set is acceptable. If an Accept-Charset header is present,
# and if the server cannot send a response which is acceptable
# according to the Accept-Charset header, then the server SHOULD send
# an error response, though the sending of an unacceptable response
# is also allowed.
preferred_charset=
# preferred_language specifies the language in MIME notation (e.g., en,
# fr, may be a comma-separated list in decreasing preference)
# which Lynx will indicate you prefer in requests to http servers.
# If a file in that language is available, the server will send it.
# Otherwise, the server will send the file in its default language.
preferred_language=en
# select_popups specifies whether the OPTIONs in a SELECT block which
# lacks a MULTIPLE attribute are presented as a vertical list of radio
# buttons or via a popup menu. Note that if the MULTIPLE attribute is
# present in the SELECT start tag, Lynx always will create a vertical list
# of checkboxes for the OPTIONs. A value of "on" will set popup menus
# as the default while a value of "off" will set use of radio boxes.
# The default can be overridden via the -popup command line toggle.
select_popups=on
# show_color specifies how to set the color mode at startup. A value of
# "never" will force color mode off (treat the terminal as monochrome)
# at startup even if the terminal appears to be color capable. A value of
# "always" will force color mode on even if the terminal appears to be
# monochrome, if this is supported by the library used to build lynx.
# A value of "default" will yield the behavior of assuming
# a monochrome terminal unless color capability is inferred at startup
# based on the terminal type, or the -color command line switch is used, or
# the COLORTERM environment variable is set. The default behavior always is
# used in anonymous accounts or if the "option_save" restriction is set.
# The effect of the saved value can be overridden via
# the -color and -nocolor command line switches.
# The mode set at startup can be changed via the "show color" option in
# the 'o'ptions menu. If the option settings are saved, the "on" and
# "off" "show color" settings will be treated as "default".
show_color=on
# show_cursor specifies whether to 'hide' the cursor to the right (and
# bottom, if possible) of the screen, or to place it to the left of the
# current link in documents, or current option in select popup windows.
# Positioning the cursor to the left of the current link or option is
# helpful for speech or braille interfaces, and when the terminal is
# one which does not distinguish the current link based on highlighting
# or color. A value of "on" will set positioning to the left as the
# default while a value of "off" will set 'hiding' of the cursor.
# The default can be overridden via the -show_cursor command line toggle.
show_cursor=on
# show_dotfiles specifies that the directory listing should include
# "hidden" (dot) files/directories. If set "on", this will be
# honored only if enabled via userdefs.h and/or lynx.cfg, and not
# restricted via a command line switch. If display of hidden files
# is disabled, creation of such files via Lynx also is disabled.
show_dotfiles=on
# If sub_bookmarks is not turned "off", and multiple bookmarks have
# been defined (see below), then all bookmark operations will first
# prompt the user to select an active sub-bookmark file. If the default
# Lynx bookmark_file is defined (see above), it will be used as the
# default selection. When this option is set to "advanced", and the
# user mode is advanced, the 'v'iew bookmark command will invoke a
# statusline prompt instead of the menu seen in novice and intermediate
# user modes. When this option is set to "standard", the menu will be
# presented regardless of user mode.
sub_bookmarks=standard
# user_mode specifies the users level of knowledge with Lynx. The
# default is "NOVICE" which displays two extra lines of help at the
# bottom of the screen to aid the user in learning the basic Lynx
# commands. Set user_mode to "INTERMEDIATE" to turn off the extra info.
# Use "ADVANCED" to see the URL of the currently selected link at the
# bottom of the screen.
user_mode=ADVANCED
# If verbose_images is "on", lynx will print the name of the image
# source file in place of [INLINE], [LINK] or [IMAGE]
# See also VERBOSE_IMAGES in lynx.cfg
verbose_images=on
# If vi_keys is set to "on", then the normal VI movement keys:
# j = down k = up
# h = left l = right
# will be enabled. These keys are only lower case.
# Capital 'H', 'J' and 'K will still activate help, jump shortcuts,
# and the keymap display, respectively.
vi_keys=on
# The visited_links setting controls how Lynx organizes the information
# in the Visited Links Page.
visited_links=LAST_REVERSED
# vim:ft=cfg

14
mailcap Normal file
View File

@ -0,0 +1,14 @@
text/html; lynx -dump %s; copiousoutput; nametemplate=%s.html
image/*; feh %s
text/rtf; catdoc %s; nametemplate=%s.rtf
text/*; vim %s
application/pdf; evince %s; nametemplate=%s.pdf
application/x-pdf; evince %s; nametemplate=%s.pdf
application/acrobat; evince %s; nametemplate=%s.pdf
application/postscript; evince %s; nametemplate=%s.ps
application/vnd.pdf; evince %s; nametemplate=%s.pdf
application/msword; catdoc %s; copiousoutput; nametemplate=%s.doc
application/vnd.ms-excel; catdoc %s; copiousoutput; nametemplate=%s.xls
application/vnd.ms-powerpoint; catdoc %s; copiousoutput; nametemplate=%s.ppt
# text/calendar; ~/bin/add-calendar-item %s; needsterminal;

731
mime.types Normal file
View File

@ -0,0 +1,731 @@
application/activemessage
application/andrew-inset ez
application/applefile
application/atomicmail
application/batch-SMTP
application/beep+xml
application/cals-1840
application/commonground
application/cu-seeme cu
application/cybercash
application/dca-rft
application/dec-dx
application/docbook+xml
application/dsptype tsp
application/dvcs
application/edi-consent
application/edi-x12
application/edifact
application/eshop
application/font-tdpfr
application/futuresplash spl
application/ghostview
application/hta hta
application/http
application/hyperstudio
application/iges
application/index
application/index.cmd
application/index.obj
application/index.response
application/index.vnd
application/iotp
application/ipp
application/isup
application/java-archive jar
application/java-serialized-object ser
application/java-vm class
application/mac-binhex40 hqx
application/mac-compactpro cpt
application/macwriteii
application/marc
application/mathematica nb
application/mathematica-old
application/msaccess mdb
application/msword doc dot
application/news-message-id
application/news-transmission
application/ocsp-request
application/ocsp-response
application/octet-stream bin
application/oda oda
application/ogg ogg
application/parityfec
application/pdf pdf
application/pgp-encrypted
application/pgp-keys key
application/pgp-signature pgp
application/pics-rules prf
application/pkcs10
application/pkcs7-mime
application/pkcs7-signature
application/pkix-cert
application/pkix-crl
application/pkixcmp
application/postscript ps ai eps
application/prs.alvestrand.titrax-sheet
application/prs.cww
application/prs.nprend
application/qsig
application/rar rar
application/rdf+xml rdf
application/remote-printing
application/riscos
application/rss+xml rss
application/rtf
application/sdp
application/set-payment
application/set-payment-initiation
application/set-registration
application/set-registration-initiation
application/sgml
application/sgml-open-catalog
application/sieve
application/slate
application/smil smi smil
application/timestamp-query
application/timestamp-reply
application/vemmi
application/whoispp-query
application/whoispp-response
application/wita
application/wordperfect wpd
application/wordperfect5.1 wp5
application/x400-bp
application/xhtml+xml xhtml xht
application/xml xml xsl
application/xml-dtd
application/xml-external-parsed-entity
application/zip zip
application/vnd.3M.Post-it-Notes
application/vnd.accpac.simply.aso
application/vnd.accpac.simply.imp
application/vnd.acucobol
application/vnd.aether.imp
application/vnd.anser-web-certificate-issue-initiation
application/vnd.anser-web-funds-transfer-initiation
application/vnd.audiograph
application/vnd.bmi
application/vnd.businessobjects
application/vnd.canon-cpdl
application/vnd.canon-lips
application/vnd.cinderella cdy
application/vnd.claymore
application/vnd.commerce-battelle
application/vnd.commonspace
application/vnd.comsocaller
application/vnd.contact.cmsg
application/vnd.cosmocaller
application/vnd.ctc-posml
application/vnd.cups-postscript
application/vnd.cups-raster
application/vnd.cups-raw
application/vnd.cybank
application/vnd.dna
application/vnd.dpgraph
application/vnd.dxr
application/vnd.ecdis-update
application/vnd.ecowin.chart
application/vnd.ecowin.filerequest
application/vnd.ecowin.fileupdate
application/vnd.ecowin.series
application/vnd.ecowin.seriesrequest
application/vnd.ecowin.seriesupdate
application/vnd.enliven
application/vnd.epson.esf
application/vnd.epson.msf
application/vnd.epson.quickanime
application/vnd.epson.salt
application/vnd.epson.ssf
application/vnd.ericsson.quickcall
application/vnd.eudora.data
application/vnd.fdf
application/vnd.ffsns
application/vnd.flographit
application/vnd.framemaker
application/vnd.fsc.weblaunch
application/vnd.fujitsu.oasys
application/vnd.fujitsu.oasys2
application/vnd.fujitsu.oasys3
application/vnd.fujitsu.oasysgp
application/vnd.fujitsu.oasysprs
application/vnd.fujixerox.ddd
application/vnd.fujixerox.docuworks
application/vnd.fujixerox.docuworks.binder
application/vnd.fut-misnet
application/vnd.grafeq
application/vnd.groove-account
application/vnd.groove-identity-message
application/vnd.groove-injector
application/vnd.groove-tool-message
application/vnd.groove-tool-template
application/vnd.groove-vcard
application/vnd.hhe.lesson-player
application/vnd.hp-HPGL
application/vnd.hp-PCL
application/vnd.hp-PCLXL
application/vnd.hp-hpid
application/vnd.hp-hps
application/vnd.httphone
application/vnd.hzn-3d-crossword
application/vnd.ibm.MiniPay
application/vnd.ibm.afplinedata
application/vnd.ibm.modcap
application/vnd.informix-visionary
application/vnd.intercon.formnet
application/vnd.intertrust.digibox
application/vnd.intertrust.nncp
application/vnd.intu.qbo
application/vnd.intu.qfx
application/vnd.irepository.package+xml
application/vnd.is-xpr
application/vnd.japannet-directory-service
application/vnd.japannet-jpnstore-wakeup
application/vnd.japannet-payment-wakeup
application/vnd.japannet-registration
application/vnd.japannet-registration-wakeup
application/vnd.japannet-setstore-wakeup
application/vnd.japannet-verification
application/vnd.japannet-verification-wakeup
application/vnd.koan
application/vnd.lotus-1-2-3
application/vnd.lotus-approach
application/vnd.lotus-freelance
application/vnd.lotus-notes
application/vnd.lotus-organizer
application/vnd.lotus-screencam
application/vnd.lotus-wordpro
application/vnd.mcd
application/vnd.mediastation.cdkey
application/vnd.meridian-slingshot
application/vnd.mif
application/vnd.minisoft-hp3000-save
application/vnd.mitsubishi.misty-guard.trustweb
application/vnd.mobius.daf
application/vnd.mobius.dis
application/vnd.mobius.msl
application/vnd.mobius.plc
application/vnd.mobius.txf
application/vnd.motorola.flexsuite
application/vnd.motorola.flexsuite.adsi
application/vnd.motorola.flexsuite.fis
application/vnd.motorola.flexsuite.gotap
application/vnd.motorola.flexsuite.kmr
application/vnd.motorola.flexsuite.ttc
application/vnd.motorola.flexsuite.wem
application/vnd.mozilla.xul+xml xul
application/vnd.ms-artgalry
application/vnd.ms-asf
application/vnd.ms-excel xls xlb xlt
application/vnd.ms-lrm
application/vnd.ms-pki.seccat cat
application/vnd.ms-pki.stl stl
application/vnd.ms-powerpoint ppt pps
application/vnd.ms-project
application/vnd.ms-tnef
application/vnd.ms-works
application/vnd.mseq
application/vnd.msign
application/vnd.music-niff
application/vnd.musician
application/vnd.netfpx
application/vnd.noblenet-directory
application/vnd.noblenet-sealer
application/vnd.noblenet-web
application/vnd.novadigm.EDM
application/vnd.novadigm.EDX
application/vnd.novadigm.EXT
application/vnd.oasis.opendocument.chart odc
application/vnd.oasis.opendocument.database odb
application/vnd.oasis.opendocument.formula odf
application/vnd.oasis.opendocument.graphics odg
application/vnd.oasis.opendocument.graphics-template otg
application/vnd.oasis.opendocument.image odi
application/vnd.oasis.opendocument.presentation odp
application/vnd.oasis.opendocument.presentation-template otp
application/vnd.oasis.opendocument.spreadsheet ods
application/vnd.oasis.opendocument.spreadsheet-template ots
application/vnd.oasis.opendocument.text odt
application/vnd.oasis.opendocument.text-master odm
application/vnd.oasis.opendocument.text-template ott
application/vnd.oasis.opendocument.text-web oth
application/vnd.osa.netdeploy
application/vnd.palm
application/vnd.pg.format
application/vnd.pg.osasli
application/vnd.powerbuilder6
application/vnd.powerbuilder6-s
application/vnd.powerbuilder7
application/vnd.powerbuilder7-s
application/vnd.powerbuilder75
application/vnd.powerbuilder75-s
application/vnd.previewsystems.box
application/vnd.publishare-delta-tree
application/vnd.pvi.ptid1
application/vnd.pwg-xhtml-print+xml
application/vnd.rapid
application/vnd.rim.cod cod
application/vnd.s3sms
application/vnd.seemail
application/vnd.shana.informed.formdata
application/vnd.shana.informed.formtemplate
application/vnd.shana.informed.interchange
application/vnd.shana.informed.package
application/vnd.smaf mmf
application/vnd.sss-cod
application/vnd.sss-dtf
application/vnd.sss-ntf
application/vnd.stardivision.calc sdc
application/vnd.stardivision.draw sda
application/vnd.stardivision.impress sdd sdp
application/vnd.stardivision.math smf
application/vnd.stardivision.writer sdw vor
application/vnd.stardivision.writer-global sgl
application/vnd.street-stream
application/vnd.sun.xml.calc sxc
application/vnd.sun.xml.calc.template stc
application/vnd.sun.xml.draw sxd
application/vnd.sun.xml.draw.template std
application/vnd.sun.xml.impress sxi
application/vnd.sun.xml.impress.template sti
application/vnd.sun.xml.math sxm
application/vnd.sun.xml.writer sxw
application/vnd.sun.xml.writer.global sxg
application/vnd.sun.xml.writer.template stw
application/vnd.svd
application/vnd.swiftview-ics
application/vnd.symbian.install sis
application/vnd.triscape.mxs
application/vnd.trueapp
application/vnd.truedoc
application/vnd.tve-trigger
application/vnd.ufdl
application/vnd.uplanet.alert
application/vnd.uplanet.alert-wbxml
application/vnd.uplanet.bearer-choice
application/vnd.uplanet.bearer-choice-wbxml
application/vnd.uplanet.cacheop
application/vnd.uplanet.cacheop-wbxml
application/vnd.uplanet.channel
application/vnd.uplanet.channel-wbxml
application/vnd.uplanet.list
application/vnd.uplanet.list-wbxml
application/vnd.uplanet.listcmd
application/vnd.uplanet.listcmd-wbxml
application/vnd.uplanet.signal
application/vnd.vcx
application/vnd.vectorworks
application/vnd.vidsoft.vidconference
application/vnd.visio vsd
application/vnd.vividence.scriptfile
application/vnd.wap.sic
application/vnd.wap.slc
application/vnd.wap.wbxml wbxml
application/vnd.wap.wmlc wmlc
application/vnd.wap.wmlscriptc wmlsc
application/vnd.webturbo
application/vnd.wrq-hp3000-labelled
application/vnd.wt.stf
application/vnd.xara
application/vnd.xfdl
application/vnd.yellowriver-custom-menu
application/x-123 wk
application/x-abiword abw
application/x-apple-diskimage dmg
application/x-bcpio bcpio
application/x-bittorrent torrent
application/x-cdf cdf
application/x-cdlink vcd
application/x-chess-pgn pgn
application/x-core
application/x-cpio cpio
application/x-csh csh
application/x-debian-package deb udeb
application/x-director dcr dir dxr
application/x-dms dms
application/x-doom wad
application/x-dvi dvi
application/x-executable
application/x-flac flac
application/x-font pfa pfb gsf pcf pcf.Z
application/x-freemind mm
application/x-futuresplash spl
application/x-gnumeric gnumeric
application/x-go-sgf sgf
application/x-graphing-calculator gcf
application/x-gtar gtar tgz taz
application/x-hdf hdf
application/x-ica ica
application/x-internet-signup ins isp
application/x-iphone iii
application/x-iso9660-image iso
application/x-java-applet
application/x-java-bean
application/x-java-jnlp-file jnlp
application/x-javascript js
application/x-jmol jmz
application/x-kchart chrt
application/x-kdelnk
application/x-killustrator kil
application/x-koan skp skd skt skm
application/x-kpresenter kpr kpt
application/x-kspread ksp
application/x-kword kwd kwt
application/x-latex latex
application/x-lha lha
application/x-lzh lzh
application/x-lzx lzx
application/x-maker frm maker frame fm fb book fbdoc
application/x-mif mif
application/x-ms-wmd wmd
application/x-ms-wmz wmz
application/x-msdos-program com exe bat dll
application/x-msi msi
application/x-netcdf nc
application/x-ns-proxy-autoconfig pac
application/x-nwc nwc
application/x-object o
application/x-oz-application oza
application/x-pkcs7-certreqresp p7r
application/x-pkcs7-crl crl
application/x-python-code pyc pyo
application/x-quicktimeplayer qtl
application/x-redhat-package-manager rpm
application/x-rx
application/x-sh sh
application/x-shar shar
application/x-shellscript
application/x-shockwave-flash swf swfl
application/x-stuffit sit
application/x-sv4cpio sv4cpio
application/x-sv4crc sv4crc
application/x-tar tar
application/x-tcl tcl
application/x-tex-gf gf
application/x-tex-pk pk
application/x-texinfo texinfo texi
application/x-trash ~ % bak old sik
application/x-troff t tr roff
application/x-troff-man man
application/x-troff-me me
application/x-troff-ms ms
application/x-ustar ustar
application/x-videolan
application/x-wais-source src
application/x-wingz wz
application/x-x509-ca-cert crt
application/x-xcf xcf
application/x-xfig fig
application/x-xpinstall xpi
audio/32kadpcm
audio/basic au snd
audio/dvi4
audio/g.722.1
audio/g722
audio/g723
audio/g726-16
audio/g726-24
audio/g726-32
audio/g726-40
audio/g728
audio/g729
audio/g729d
audio/g729e
audio/gsm
audio/gsm-efr
audio/l8
audio/l16
audio/lpc
audio/midi mid midi kar
audio/mp4a-latm
audio/mpa
audio/mpa-robust
audio/mpeg mpga mpega mp2 mp3 m4a
audio/mpegurl m3u
audio/parityfec
audio/pcma
audio/pcmu
audio/prs.sid sid
audio/qcelp
audio/red
audio/telephone-event
audio/tone
audio/vdvi
audio/vnd.cisco.nse
audio/vnd.cns.anp1
audio/vnd.cns.inf1
audio/vnd.digital-winds
audio/vnd.everad.plj
audio/vnd.lucent.voice
audio/vnd.nortel.vbk
audio/vnd.nuera.ecelp4800
audio/vnd.nuera.ecelp7470
audio/vnd.nuera.ecelp9600
audio/vnd.octel.sbc
audio/vnd.qcelp
audio/vnd.rhetorex.32kadpcm
audio/vnd.vmx.cvsd
audio/x-aiff aif aiff aifc
audio/x-gsm gsm
audio/x-mpegurl m3u
audio/x-ms-wma wma
audio/x-ms-wax wax
audio/x-pn-realaudio-plugin
audio/x-pn-realaudio ra rm ram
audio/x-realaudio ra
audio/x-scpls pls
audio/x-sd2 sd2
audio/x-wav wav
chemical/x-alchemy alc
chemical/x-cache cac cache
chemical/x-cache-csf csf
chemical/x-cactvs-binary cbin cascii ctab
chemical/x-cdx cdx
chemical/x-cerius cer
chemical/x-chem3d c3d
chemical/x-chemdraw chm
chemical/x-cif cif
chemical/x-cmdf cmdf
chemical/x-cml cml
chemical/x-compass cpa
chemical/x-crossfire bsd
chemical/x-csml csml csm
chemical/x-ctx ctx
chemical/x-cxf cxf cef
#chemical/x-daylight-smiles smi
chemical/x-embl-dl-nucleotide emb embl
chemical/x-galactic-spc spc
chemical/x-gamess-input inp gam gamin
chemical/x-gaussian-checkpoint fch fchk
chemical/x-gaussian-cube cub
chemical/x-gaussian-input gau gjc gjf
chemical/x-gaussian-log gal
chemical/x-gcg8-sequence gcg
chemical/x-genbank gen
chemical/x-hin hin
chemical/x-isostar istr ist
chemical/x-jcamp-dx jdx dx
chemical/x-kinemage kin
chemical/x-macmolecule mcm
chemical/x-macromodel-input mmd mmod
chemical/x-mdl-molfile mol
chemical/x-mdl-rdfile rd
chemical/x-mdl-rxnfile rxn
chemical/x-mdl-sdfile sd sdf
chemical/x-mdl-tgf tgf
#chemical/x-mif mif
chemical/x-mmcif mcif
chemical/x-mol2 mol2
chemical/x-molconn-Z b
chemical/x-mopac-graph gpt
chemical/x-mopac-input mop mopcrt mpc dat zmt
chemical/x-mopac-out moo
chemical/x-mopac-vib mvb
chemical/x-ncbi-asn1 asn
chemical/x-ncbi-asn1-ascii prt ent
chemical/x-ncbi-asn1-binary val aso
chemical/x-ncbi-asn1-spec asn
chemical/x-pdb pdb ent
chemical/x-rosdal ros
chemical/x-swissprot sw
chemical/x-vamas-iso14976 vms
chemical/x-vmd vmd
chemical/x-xtel xtel
chemical/x-xyz xyz
image/cgm
image/g3fax
image/gif gif
image/ief ief
image/jpeg jpeg jpg jpe
image/naplps
image/pcx pcx
image/png png
image/prs.btif
image/prs.pti
image/svg+xml svg svgz
image/tiff tiff tif
image/vnd.cns.inf2
image/vnd.djvu djvu djv
image/vnd.dwg
image/vnd.dxf
image/vnd.fastbidsheet
image/vnd.fpx
image/vnd.fst
image/vnd.fujixerox.edmics-mmr
image/vnd.fujixerox.edmics-rlc
image/vnd.mix
image/vnd.net-fpx
image/vnd.svf
image/vnd.wap.wbmp wbmp
image/vnd.xiff
image/x-cmu-raster ras
image/x-coreldraw cdr
image/x-coreldrawpattern pat
image/x-coreldrawtemplate cdt
image/x-corelphotopaint cpt
image/x-icon ico
image/x-jg art
image/x-jng jng
image/x-ms-bmp bmp
image/x-photoshop psd
image/x-portable-anymap pnm
image/x-portable-bitmap pbm
image/x-portable-graymap pgm
image/x-portable-pixmap ppm
image/x-rgb rgb
image/x-xbitmap xbm
image/x-xpixmap xpm
image/x-xwindowdump xwd
inode/chardevice
inode/blockdevice
inode/directory-locked
inode/directory
inode/fifo
inode/socket
message/delivery-status
message/disposition-notification
message/external-body
message/http
message/s-http
message/news
message/partial
message/rfc822
model/iges igs iges
model/mesh msh mesh silo
model/vnd.dwf
model/vnd.flatland.3dml
model/vnd.gdl
model/vnd.gs-gdl
model/vnd.gtw
model/vnd.mts
model/vnd.vtu
model/vrml wrl vrml
multipart/alternative
multipart/appledouble
multipart/byteranges
multipart/digest
multipart/encrypted
multipart/form-data
multipart/header-set
multipart/mixed
multipart/parallel
multipart/related
multipart/report
multipart/signed
multipart/voice-message
text/calendar ics icz
text/comma-separated-values csv
text/css css
text/directory
text/english
text/enriched
text/h323 323
text/html html htm shtml
text/iuls uls
text/mathml mml
text/parityfec
text/plain asc txt text diff pot
text/prs.lines.tag
text/x-psp psp
text/rfc822-headers
text/richtext rtx
text/rtf rtf
text/scriptlet sct wsc
text/t140
text/texmacs tm ts
text/tab-separated-values tsv
text/uri-list
text/vnd.abc
text/vnd.curl
text/vnd.DMClientScript
text/vnd.flatland.3dml
text/vnd.fly
text/vnd.fmi.flexstor
text/vnd.in3d.3dml
text/vnd.in3d.spot
text/vnd.IPTC.NewsML
text/vnd.IPTC.NITF
text/vnd.latex-z
text/vnd.motorola.reflex
text/vnd.ms-mediapackage
text/vnd.sun.j2me.app-descriptor jad
text/vnd.wap.si
text/vnd.wap.sl
text/vnd.wap.wml wml
text/vnd.wap.wmlscript wmls
text/x-bibtex bib
text/x-c++hdr h++ hpp hxx hh
text/x-c++src c++ cpp cxx cc
text/x-chdr h
text/x-crontab
text/x-csh csh
text/x-csrc c
text/x-haskell hs
text/x-java java
text/x-literate-haskell lhs
text/x-makefile
text/x-moc moc
text/x-pascal p pas
text/x-pcs-gcd gcd
text/x-perl pl pm
text/x-python py
text/x-server-parsed-html
text/x-setext etx
text/x-sh sh
text/x-tcl tcl tk
text/x-tex tex ltx sty cls
text/x-vcalendar vcs
text/x-vcard vcf
video/bmpeg
video/bt656
video/celb
video/dl dl
video/dv dif dv
video/fli fli
video/gl gl
video/jpeg
video/h261
video/h263
video/h263-1998
video/h263-2000
video/mp1s
video/mp2p
video/mp2t
video/mp4 mp4
video/mp4v-es
video/mpeg mpeg mpg mpe
video/mpv
video/nv
video/parityfec
video/pointer
video/quicktime qt mov
video/vnd.fvt
video/vnd.motorola.video
video/vnd.motorola.videop
video/vnd.mpegurl mxu
video/vnd.mts
video/vnd.nokia.interleaved-multimedia
video/vnd.vivo
video/x-la-asf lsf lsx
video/x-mng mng
video/x-ms-asf asf asx
video/x-ms-wm wm
video/x-ms-wmv wmv
video/x-ms-wmx wmx
video/x-ms-wvx wvx
video/x-msvideo avi
video/x-sgi-movie movie
video/x-flv flv
x-conference/x-cooltalk ice
x-world/x-vrml vrm vrml wrl

142
mrxvtrc Normal file
View File

@ -0,0 +1,142 @@
mrxvt.profile0.foreground: #ffffff
mrxvt.profile1.foreground: #ffffff
mrxvt.profile2.foreground: #ffffff
mrxvt.profile3.foreground: #ffffff
mrxvt.profile4.foreground: #ffffff
mrxvt.profile0.background: #000000
mrxvt.profile1.background: #000000
mrxvt.profile2.background: #000000
mrxvt.profile3.background: #000000
mrxvt.profile4.background: #000000
mrxvt.profile0.workingDirectory: .
mrxvt.profile0.holdExitText:
Process exited %N with status %S. Press any key to close tab.
mrxvt.profile0.holdExitTitle: (Done) %t
mrxvt.chopEnd: True
mrxvt.highlightTabOnBell: False
mrxvt.syncTabTitle: False
mrxvt.hideTabbar: False
mrxvt.autohideTabbar: True
mrxvt.bottomTabbar: True
mrxvt.hideButtons: False
mrxvt.syncTabIcon: False
mrxvt.veryBoldFont: True
mrxvt.boldColors: False
mrxvt.veryBright: False
mrxvt.title: mrxvt
mrxvt.interceptConsole: False
mrxvt.startIconic: False
mrxvt.maximized: True
mrxvt.fullscreen: False
mrxvt.reverseVideo: False
mrxvt.internalBorder: 2
mrxvt.loginShell: True
mrxvt.tintColor: rgb:00/00/00
mrxvt.shading: 80
mrxvt.backgroundFade: 80
mrxvt.scrollBar: True
mrxvt.scrollbarRight: True
mrxvt.scrollbarFloating: False
mrxvt.scrollTtyOutputInhibit: False
mrxvt.scrollTtyKeypress: False
mrxvt.transparent: False
mrxvt.transparentForce: False
mrxvt.transparentScrollbar: False
mrxvt.transparentMenubar: False
mrxvt.transparentTabbar: False
mrxvt.tabUsePixmap: True
mrxvt.tabTitle: mrxvt
mrxvt.utmpInhibit: False
mrxvt.visualBell: False
mrxvt.currentTabVBell: False
mrxvt.mapAlert: False
mrxvt.meta8: False
mrxvt.mouseWheelScrollPage: False
mrxvt.multibyte_cursor: False
mrxvt.tripleclickwords: False
mrxvt.tabForeground: #9a9a9a
mrxvt.tabBackground: #900000
mrxvt.itabForeground: #909090
mrxvt.itabBackground: #101010
mrxvt.background: #000000
mrxvt.foreground: AntiqueWhite
mrxvt.color0: #000000
mrxvt.color1: #af0000
mrxvt.color2: #00af00
mrxvt.color3: #afaf00
mrxvt.color4: #0000af
mrxvt.color5: #af00af
mrxvt.color6: #00afaf
mrxvt.color7: #9a9a9a
mrxvt.color8: #5f5f5f
mrxvt.color9: #d70000
mrxvt.color10: #00d700
mrxvt.color11: #d7d700
mrxvt.color12: #0000d7
mrxvt.color13: #d700d7
mrxvt.color14: #00d7d7
mrxvt.color15: #d7d7d7
# Display bold and underlined text in color, rather than using the terminal
# attributes. This makes reading man pages a little easier.
mrxvt.colorBD: #00afaf
mrxvt.colorUL: #00af00
# mrxvt.colorRV: #000040
# Display the X selection as highlighted instead of using reverse video.
mrxvt.highlightColor: #303060
# Colors when terminal window looses focus. (Does not work well with Xft).
mrxvt.ufBackground: #202020
mrxvt.backgroundFade: 50
mrxvt.showMenu: False
mrxvt.font: -misc-fixed-medium-r-normal--14-130-75-75-c-70-iso8859-1
mrxvt.font1: -misc-fixed-medium-r-normal--15-140-75-75-c-90-iso8859-1
mrxvt.font2: -misc-fixed-medium-r-normal--18-120-100-100-c-90-iso8859-1
mrxvt.font3: -misc-fixed-medium-r-normal--20-200-75-75-c-100-iso8859-1
mrxvt.font4: -misc-fixed-medium-r-normal--13-120-75-75-c-70-iso8859-1
mrxvt.font5: -misc-fixed-medium-r-normal--14-130-75-75-c-70-iso8859-1
mrxvt.mfont: -*-*-*-r-*-*-*-*-*-c-*-iso8859-1
mrxvt.xft: True
mrxvt.xftFont: DejaVu Sans Mono
mrxvt.xftSize: 9
mrxvt.xftPSize: 9
FvwmConsole.xftSize: 9
mrxvt.xftSlowOutput: False
mrxvt.xftAntialias: True
mrxvt.xftHinting: True
mrxvt.xftAutoHint: True
mrxvt.xftGlobalAdvance: False
mrxvt.cmdAllTabs: False
mrxvt.protectSecondary: False
mrxvt.clientName: mrxvt
mrxvt.iconName: mrxvt
mrxvt.borderLess: False
mrxvt.overrideRedirect: False
mrxvt.broadcast: False
mrxvt.smartResize: True
mrxvt.smoothResize: False
mrxvt.pointerBlank: False
mrxvt.cursorBlink: True
mrxvt.printPipe: lpr
mrxvt.noSysConfig: False
mrxvt.disableMacros: False
mrxvt.linuxHomeEndKey: False
Mrxvt.cutChars: :=/~#@?%&_-.0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ0abcdefghijklmnopqrstuvwxyz
mrxvt.acsChars: .# o+ ----+---__++--|<> =#.
mrxvt.sessionMgt: False
mrxvt.useFifo: False
mrxvt.macro.Ctrl+Shift+V: Paste CLIPBOARD
mrxvt.macro.Ctrl+Shift+C: Exec !/usr/bin/xclip -o | /usr/bin/xclip -selection clipboard
# vim: set ft=mrxvtrc :

309
pylintrc Normal file
View File

@ -0,0 +1,309 @@
[MASTER]
# Specify a configuration file.
#rcfile =
# Python code to execute, usually for sys.path manipulation such as
# pygtk.require().
#init-hook =
# Profiled execution.
profile = no
# Add <file or directory> to the black list. It should be a base name, not a
# path. You may set this option multiple times.
ignore = CVS
ignore = .svn
# Pickle collected data for later comparisons.
persistent = yes
# Set the cache size for astng objects.
cache-size = 500
# List of plugins (as comma separated values of python modules names) to load,
# usually to register additional checkers.
load-plugins =
[MESSAGES CONTROL]
# Enable only checker(s) with the given id(s). This option conflicts with the
# disable-checker option
#enable-checker =
# Enable all checker(s) except those with the given id(s). This option
# conflicts with the enable-checker option
#disable-checker =
# Enable all messages in the listed categories.
#enable-msg-cat =
# Disable all messages in the listed categories.
#disable-msg-cat =
# Enable the message(s) with the given id(s).
#enable-msg =
# Disable the message(s) with the given id(s).
# C0111: docstring
# W0142: * or ** magic
#disable-msg = C0111,W0142
[REPORTS]
# set the output format. Available formats are text, parseable, colorized, msvs
# (visual studio) and html
output-format = colorized
# Include message's id in output
include-ids = yes
# Put messages in a separate file for each module / package specified on the
# command line instead of printing them on stdout. Reports (if any) will be
# written in a file name "pylint_global.[txt|html]".
files-output = no
# Tells whether to display a full report or only the messages
reports = yes
# Python expression which should return a note less than 10 (10 is the highest
# note).You have access to the variables errors warning, statement which
# respectivly contain the number of errors / warnings messages and the total
# number of statements analyzed. This is used by the global evaluation report
# (R0004).
evaluation = 10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10)
# Add a comment according to your evaluation note. This is used by the global
# evaluation report (R0004).
comment = no
# Enable the report(s) with the given id(s).
#enable-report =
# Disable the report(s) with the given id(s).
#disable-report =
# try to find bugs in the code using type inference
#
[TYPECHECK]
# Tells wether missing members accessed in mixin class should be ignored. A
# mixin class is detected if its name ends with "mixin" (case insensitive).
ignore-mixin-members = yes
# When zope mode is activated, consider the acquired-members option to ignore
# access to some undefined attributes.
zope = no
# List of members which are usually get through zope's acquisition mecanism and
# so shouldn't trigger E0201 when accessed (need zope = yes to be considered).
acquired-members = REQUEST,acl_users,aq_parent
# checks for
# * unused variables / imports
# * undefined variables
# * redefinition of variable from builtins or from an outer scope
# * use of variable before assigment
#
[VARIABLES]
# Tells wether we should check for unused import in __init__ files.
init-import = no
# A regular expression matching names used for dummy variables (i.e. not used).
dummy-variables-rgx = _|dummy|garbage|junk
# List of additional names supposed to be defined in builtins. Remember that
# you should avoid to define new builtins when possible.
additional-builtins =
# checks for :
# * doc strings
# * modules / classes / functions / methods / arguments / variables name
# * number of arguments, local variables, branchs, returns and statements in
# functions, methods
# * required module attributes
# * dangerous default values as arguments
# * redefinition of function / method / class
# * uses of the global statement
#
[BASIC]
# Required attributes for module, separated by a comma
required-attributes =
# Regular expression which should only match functions or classes name which do
# not require a docstring
#no-docstring-rgx = __.*__
no-docstring-rgx = .*
# Regular expression which should only match correct module names
module-rgx = (([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$
# Regular expression which should only match correct module level names
const-rgx = (([A-Z_][A-Z1-9_]*)|(__.*__))$
# Regular expression which should only match correct class names
class-rgx = [A-Z_][a-zA-Z0-9]+$
# Regular expression which should only match correct function names
#function-rgx = [a-z_][a-z0-9_]{2,30}$
function-rgx = [a-z_][a-zA-Z0-9_]{2,60}$
# Regular expression which should only match correct method names
#method-rgx = [a-z_][a-z0-9_]{2,30}$
method-rgx = [a-z_][a-zA-Z0-9_]{2,60}$
# Regular expression which should only match correct instance attribute names
#attr-rgx = [a-z_][a-z0-9_]{2,30}$
attr-rgx = [a-z_][a-zA-Z0-9_]{2,60}$
# Regular expression which should only match correct argument names
#argument-rgx = [a-z_][a-z0-9_]{2,30}$
argument-rgx = [a-z_][a-zA-Z0-9_]{2,60}$
# Regular expression which should only match correct variable names
#variable-rgx = [a-z_][a-z0-9_]{2,30}$
variable-rgx = [a-z_][a-zA-Z0-9_]{2,60}$
# Regular expression which should only match correct list comprehension /
# generator expression variable names
inlinevar-rgx = [A-Za-z_][A-Za-z0-9_]*$
# Good variable names which should always be accepted, separated by a comma
good-names = i,j,k,ex,Run,_,da
# Bad variable names which should always be refused, separated by a comma
bad-names = foo,bar,baz,toto,tutu,tata,qwwx,q,z,x,y
# List of builtins function names that should not be used, separated by a comma
bad-functions = map,filter,apply,input,zip
# checks for sign of poor/misdesign:
# * number of methods, attributes, local variables...
# * size, complexity of functions, methods
#
[DESIGN]
# Maximum number of arguments for function / method
max-args = 4
# Maximum number of locals for function / method body
max-locals = 15
# Maximum number of return / yield for function / method body
max-returns = 6
# Maximum number of branch for function / method body
max-branchs = 5
# Maximum number of statements in function / method body
max-statements = 30
# Maximum number of parents for a class (see R0901).
max-parents = 7
# Maximum number of attributes for a class (see R0902).
max-attributes = 7
# Minimum number of public methods for a class (see R0903).
min-public-methods = 0
# Maximum number of public methods for a class (see R0904).
max-public-methods = 20
# checks for :
# * methods without self as first argument
# * overridden methods signature
# * access only to existant members via self
# * attributes not defined in the __init__ method
# * supported interfaces implementation
# * unreachable code
#
[CLASSES]
# List of interface methods to ignore, separated by a comma. This is used for
# instance to not check methods defines in Zope's Interface base class.
ignore-iface-methods =
# List of method names used to declare (i.e. assign) instance attributes.
defining-attr-methods = __init__,__new__,setUp,tearDown
# checks for
# * external modules dependencies
# * relative / wildcard imports
# * cyclic imports
# * uses of deprecated modules
#
[IMPORTS]
# Deprecated modules which should not be used, separated by a comma
deprecated-modules = regsub,string,TERMIOS,Bastion,rexec
# Create a graph of every (i.e. internal and external) dependencies in the
# given file (report R0402 must not be disabled)
import-graph =
# Create a graph of external dependencies in the given file (report R0402 must
# not be disabled)
ext-import-graph =
# Create a graph of internal dependencies in the given file (report R0402 must
# not be disabled)
int-import-graph =
# checks for similarities and duplicated code. This computation may be
# memory / CPU intensive, so you should disable it if you experiments some
# problems.
#
[SIMILARITIES]
# Minimum lines number of a similarity.
min-similarity-lines = 4
# Ignore comments when computing similarities.
#ignore-comments = yes
# Ignore docstrings when computing similarities.
#ignore-docstrings = yes
# checks for:
# * warning notes in the code like FIXME, XXX
# * PEP 263: source code with non ascii character but no encoding declaration
#
[MISCELLANEOUS]
# List of note tags to take in consideration, separated by a comma.
notes = FIXME,XXX,TODO
# checks for :
# * unauthorized constructions
# * strict indentation
# * line length
# * use of <> instead of ! =
#
[FORMAT]
# Maximum number of characters on a single line.
max-line-length = 80
# Maximum number of lines in a module
max-module-lines = 1000
# String used as indentation unit. This is usually " " (4 spaces) or "\t" (1
# tab).
indent-string = ' '
# vim:filetype=cfg

51
python3_startup.py Normal file
View File

@ -0,0 +1,51 @@
# Add auto-completion and a stored history file of commands to your Python
# interactive interpreter. Requires Python 2.0+, readline. Autocomplete is
# bound to the Esc key by default (you can change it - see readline docs).
#
# Store the file in ~/.pystartup, and set an environment variable to point
# to it, e.g. "export PYTHONSTARTUP=/max/home/itamar/.pystartup" in bash.
#
# Note that PYTHONSTARTUP does *not* expand "~", so you have to put in the
# full path to your home directory.
import atexit
import os
import readline
import rlcompleter
history_path = os.path.expanduser("~/.pyhistory")
history_tmp = os.path.expanduser("~/.pyhisttmp.py")
end_marker= "# # # histDUMP # # #"
save_macro = """\
import readline
readline.write_history_file('""" + history_tmp + """')
print '####>>>>>>>>>>'
print ''.join(list(filter(
lambda line_part: not line_part.strip().endswith('""" + end_marker +"""'), \
open('""" + history_tmp + """').readlines())[:])) + '####<<<<<<<<<<'""" + end_marker
readline.parse_and_bind('tab: complete')
readline.parse_and_bind('\C-w: "' + save_macro + '"')
def save_history(history_path=history_path, end_marker=end_marker):
import readline
readline.write_history_file(history_path)
lines = list(filter(lambda line_part, end_marker=end_marker:
not line_part.strip().endswith(end_marker), open(history_path).readlines()))
open(history_path, 'w+').write(''.join(lines))
if os.path.exists(history_path):
readline.read_history_file(history_path)
atexit.register(save_history)
del os, atexit, readline, rlcompleter, save_history, history_path
del history_tmp, end_marker, save_macro

82
todo.cfg Normal file
View File

@ -0,0 +1,82 @@
# === EDIT FILE LOCATIONS BELOW ===
# Your todo.txt directory
#export TODO_DIR="/Users/gina/Documents/todo"
export TODO_DIR="$HOME/Dropbox/buchfam/todo"
# Your todo/done/report.txt locations
export TODO_FILE="$TODO_DIR/todo.txt"
export DONE_FILE="$TODO_DIR/done.txt"
export REPORT_FILE="$TODO_DIR/report.txt"
export TMP_FILE="$TODO_DIR/todo.tmp"
# You can customize your actions directory location
#export TODO_ACTIONS_DIR="$HOME/.todo.actions.d"
# == EDIT FILE LOCATIONS ABOVE ===
# === COLOR MAP ===
## Text coloring and formatting is done by inserting ANSI escape codes.
## If you have re-mapped your color codes, or use the todo.txt
## output in another output system (like Conky), you may need to
## over-ride by uncommenting and editing these defaults.
## If you change any of these here, you also need to uncomment
## the defaults in the COLORS section below. Otherwise, todo.txt
## will still use the defaults!
# export BLACK='\\033[0;30m'
# export RED='\\033[0;31m'
# export GREEN='\\033[0;32m'
# export BROWN='\\033[0;33m'
# export BLUE='\\033[0;34m'
# export PURPLE='\\033[0;35m'
# export CYAN='\\033[0;36m'
# export LIGHT_GREY='\\033[0;37m'
# export DARK_GREY='\\033[1;30m'
# export LIGHT_RED='\\033[1;31m'
# export LIGHT_GREEN='\\033[1;32m'
# export YELLOW='\\033[1;33m'
# export LIGHT_BLUE='\\033[1;34m'
# export LIGHT_PURPLE='\\033[1;35m'
# export LIGHT_CYAN='\\033[1;36m'
# export WHITE='\\033[1;37m'
# export DEFAULT='\\033[0m'
# === COLORS ===
## Uncomment and edit to override these defaults.
## Reference the constants from the color map above,
## or use $NONE to disable highlighting.
#
# Priorities can be any upper-case letter.
# A,B,C are highlighted; you can add coloring for more.
#
# export PRI_A=$YELLOW # color for A priority
# export PRI_B=$GREEN # color for B priority
# export PRI_C=$LIGHT_BLUE # color for C priority
# export PRI_D=... # define your own
# export PRI_X=$WHITE # color unless explicitly defined
# There is highlighting for tasks that have been done,
# but haven't been archived yet.
#
# export COLOR_DONE=$LIGHT_GREY
# === BEHAVIOR ===
## customize list output
#
# TODOTXT_SORT_COMMAND will filter after line numbers are
# inserted, but before colorization, and before hiding of
# priority, context, and project.
#
# export TODOTXT_SORT_COMMAND='env LC_COLLATE=C sort -f -k2'
# TODOTXT_FINAL_FILTER will filter list output after colorization,
# priority hiding, context hiding, and project hiding. That is,
# just before the list output is displayed.
#
# export TODOTXT_FINAL_FILTER='cat'
# vim:filetype=sh

14
toprc Normal file
View File

@ -0,0 +1,14 @@
RCfile for "top with windows" # shameless braggin'
Id:a, Mode_altscr=0, Mode_irixps=1, Delay_time=0.300, Curwin=0
Def fieldscur=AEHIOQTWKNMbcdfgjPlrsuvyzX
winflags=129464, sortindx=10, maxtasks=0
summclr=1, msgsclr=1, headclr=3, taskclr=1
Job fieldscur=ABcefgjlrstuvyzMKNHIWOPQDX
winflags=62777, sortindx=0, maxtasks=0
summclr=6, msgsclr=6, headclr=7, taskclr=6
Mem fieldscur=ANOPQRSTUVbcdefgjlmyzWHIKX
winflags=62777, sortindx=13, maxtasks=0
summclr=5, msgsclr=5, headclr=4, taskclr=5
Usr fieldscur=ABDECGfhijlopqrstuvyzMKNWX
winflags=62777, sortindx=4, maxtasks=0
summclr=3, msgsclr=3, headclr=2, taskclr=3

1
valgrindrc Normal file
View File

@ -0,0 +1 @@
--num-callers=50

119
vimrc.after Normal file
View File

@ -0,0 +1,119 @@
" sourced by Janus
set tabstop=4
set shiftwidth=4
set softtabstop=4
" Set the indent to 2 when working with ruby and markup stuff
autocmd BufNewFile,BufRead *.feature,*.rb,*.ru,*.xml,*.html,*.htm,Gemfile,Rakefile,Procfile set shiftwidth=2
\| set tabstop=2
\| set softtabstop=2
" Set up some sane java compilation bits
autocmd BufRead *.java set efm=%A\ %#[javac]\ %f:%l:\ %m,%-Z\ %#[javac]\ %p^,%-C%.%#
\| set makeprg=ant\ -find\ build.xml
map ,t :w<cr>
map ,m :w\|:make<cr><cr>
map ,- :nohl<cr>
" (en|dis)able crosshairs!
function! EnableCrosshairs()
set cursorline
set cursorcolumn
highlight CursorLine ctermbg=blue
highlight CursorColumn ctermbg=blue
endfunction
function! DisableCrosshairs()
set nocursorline
set nocursorcolumn
endfunction
" MyNext() and MyPrev(): Movement between tabs OR buffers
function! MyNext()
if exists( '*tabpagenr' ) && tabpagenr('$') != 1
" Tab support && tabs open
normal gt
else
" No tab support, or no tabs open
execute ":bnext"
endif
endfunction
function! MyPrev()
if exists( '*tabpagenr' ) && tabpagenr('$') != '1'
" Tab support && tabs open
normal gT
else
" No tab support, or no tabs open
execute ":bprev"
endif
endfunction
" moving between tabs OR buffers
nnoremap L :call MyNext()<CR>
nnoremap H :call MyPrev()<CR>
" easy indentation in visual mode
" This keeps the visual selection active after indenting.
" Usually the visual selection is lost after you indent it.
vmap > >gv
vmap < <gv
" run make
" <F3> or \m
map <silent><F3> :make<CR>
map <silent><leader>m :make<CR>
" Highlight over 80 chars wide for python files
" (to call manually, use the mapping '\py80'
map <silent><leader>py80 :call LambastOver80Wide()<CR>
function! LambastOver80Wide()
highlight NearLength ctermbg=yellow ctermfg=black
match NearLength /\%76v.*/
highlight OverLength ctermbg=red ctermfg=white guibg=#592929
match OverLength /\%81v.*/
endfun
" disable mapping (to call manually use mapping '\nopy80'
map <silent><leader>nopy80 :call DisableLambastOver80Wide()<CR>
function! DisableLambastOver80Wide()
highlight OverLength ctermbg=Black ctermfg=white guibg=#000000
endfun
" call it right away for certain files
autocmd FileType python call LambastOver80Wide()
autocmd FileType moin call LambastOver80Wide()
" autocmd FileType javascript call LambastOver80Wide()
" autocmd FileType actionscript call LambastOver80Wide()
autocmd FileType mail call LambastOver80Wide()
autocmd FileType scons call LambastOver80Wide()
" autocmd FileType cs call LambastOver80Wide()
" strip trailing whitespace
map <silent><leader>SW :call StripTrailingWhitespace()<CR>
function! StripTrailingWhitespace()
:%s/\s\+$//e
endfun
" remove all ^M chars
map <silent><leader>SM :call StripCtrlMs()<CR>
function! StripCtrlMs()
:%s/[ \t\r]\+$//e
endfun
" insert date
map <silent><leader>D :call InsertDate()<CR>
function! InsertDate()
:read !date
endfun
if !has('gui_running')
set t_Co=256
"colorscheme gardener
colorscheme inkpot
endif
let g:valgrind_arguments='--leak-check=yes --num-callers=50'

36
xinitrc Normal file
View File

@ -0,0 +1,36 @@
test -f /etc/rc.conf && source /etc/rc.conf
setxkbmap ${KEYMAP-dvorak}
DEFAULT="ratpoison"
case "$1" in
awe*)
exec awesome
;;
evil*)
exec evilwm
;;
open*)
exec openbox-session
;;
win*)
exec wmaker
;;
flux*)
exec startfluxbox
;;
gno*)
exec gnome-session
;;
rat*)
exec ratpoison
;;
*)
exec $DEFAULT
;;
esac
# vim:filetype=sh

8
zshrc Normal file
View File

@ -0,0 +1,8 @@
HISTFILE=~/.zsh-histfile
HISTSIZE=10000
SAVEHIST=100000
setopt appendhistory extendedglob nomatch
unsetopt autocd beep notify
bindkey -v
autoload -Uz compinit
compinit