Commits

David Wolever committed f094bb7

Adding... stuff.

  • Participants
  • Parent commits 4bb2ec0

Comments (0)

Files changed (10)

 --type-set=rst=.rst
 # Ignore virtualenvs
 --ignore-dir=env
+--type-set=ssjs=.ssjs

django_bash_completion

 
         case ${cur} in
             -*)
+                case ${prev} in
+                    test)
+                        opts="$opts --failfast"
+                        ;;
+                esac
+                        
                 COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
                 action=$COMPREPLY
                 return 0
         case ${prev} in
             dumpdata|reset| \
             sql|sqlall|sqlclear|sqlcustom|sqlindexes| \
-            sqlreset|sqlsequencereset|test)
+            sqlreset|sqlsequencereset)
                 # App completion
                 settings=""
                 # If settings.py in the PWD, use that
                 ;;
             *)
                 #COMPREPLY=( $(compgen -W "auth core" -- ${cur}) )
-                COMPREPLY=()
+                COMPREPLY=( ${cur}* )
                 return 0
                 ;;
         esac
     fi
 }
 
-complete -F _django_completion django-admin.py manage.py django-admin
+complete -o filenames -F _django_completion django-admin.py manage.py django-admin
 
 # Support for multiple interpreters.
 unset pythons
 #graphviz = ~/.mercurial/extensions/graphviz.py
 color =
 purge =
-hgext.extdiff = 
 hgext.mq =
 hgext.graphlog = 
 # Attic and record are used for 'shelve'
 hgext.record =
 #shelve = ~/.mercurial/extensions/hgshelve/hgshelve.py
 info = ~/.mercurial/extensions/info.py
-setpath = ~/.mercurial/extensions/setpath.py
 rebase =
 hgext.bookmarks =
 transplant =
 #hgext.zeroconf =
 #hgext.convert=
-
-[extdiff]
-# add new command that runs GNU diff(1) in 'context diff' mode
-cmd.cdiff = diff
-opts.cdiff = -Npr -C5
-
-# add new command called vimdiff, runs vimdiff with DirDiff plugin
-# (see http://www.vim.org/scripts/script.php?script_id=102)
-#opts.vimdiff = -f '+next' '+execute "DirDiff" argv(0) argv(1)'
-# For now, just use normal vimdifff
-cmd.vimdiff = vimdiff
+#hgext.hgk =
+progress =
 
 [ui]
 username = David Wolever <david@wolever.net>
 archivemeta = True
 
 [merge-tools]
-macdiff.args = $local $other -ancestor $base -merge $output
 vimdiff.args = $local $other $base $output
 vimdiff.checkchanged = True
 vimdiff.premerge = True
 diffmerge.binary = False
 diffmerge.symlinks = False
 diffmerge.gui = True
-diffmerge.premerge = True
+diffmerge.premerge = False
+kidff3.args = $base $local $other -o $output
 
 [alias]
 bm = bookmark
 conflicts = resolve -l
 resolved = resolve -m
-mark = bookmark
-stash = shelve -i
 renames = stat -Ca
-pup = pull --update
 nudge = push --rev .
+switch = setpath
 
 [diff]
 # prevent qrefresh from updating timestamps

hgrc.laptop.local

 [extensions]
 #hgsubversion = 
+setpath = ~/code/hg-setpath/setpath.py
 hggit =
 #hgk =
 #mercurial_keyring = 
 #pbranch = ~/.mercurial/extensions/pbranch.py
-#mergediff = ~/code/hg-mergediff/mergediff.py
+mergediff = ~/code/hg-mergediff/mergediff.py
 #review = ~/code/software/hg-review/review/
 
 [hgk]

mercurial/extensions/setpath.py

-# Mercurial extension to provide the 'hg setpath' command
-#
-# Copyright 2010 by David Wolever <david@wolever.net>
-#
-# This software may be used and distributed according to the terms
-# of the GNU General Public License, incorporated herein by reference.
-
-import os
-import re
-
-from mercurial.i18n import _
-from mercurial.node import short, hex
-from mercurial import util
-
-def setpath(ui, repo, targetalias, newpath=None):
-    '''Edit the [paths] section of a repo's .hg/hgrc, setting ALIAS to PATH.
-
-    If no ALIAS is specified, "default" will be used. PATH may be an alias.'''
-    # todo: I don't think this docstring is as clear as it could be.
-
-    if newpath is None:
-        newpath = targetalias
-        targetalias = "default"
-
-    # If 'newpath' doesn't contain a '/' or a '\', treat is as an alias
-    if "/" not in newpath and "\\" not in newpath:
-        resolved_newpath = ui.config("paths", newpath)
-        if resolved_newpath is None:
-            raise util.Abort(_("unknown alias: %s") %(newpath, ))
-        newpath = resolved_newpath
-
-    lines = []
-    aliaslineno = None
-    pathslineno = None
-
-    hgrcpath = os.path.join(repo.path, "hgrc")
-
-    if os.path.exists(hgrcpath):
-        # Note: read .hg/hgrc explicitly here because 'config' (rightly)
-        # doesn't provide a mechanism for determining the file/line
-        # location of a [heading], but we need to find the location of
-        # the [paths] heading in .hg/hgrc.
-        f = open(hgrcpath)
-        lines = f.readlines()
-        f.close()
-
-        sectionre = re.compile(r'\[([^\[]+)\]')
-        itemre = re.compile(r'([^=\s][^=]*?)\s*=\s*(.*\S|)')
-
-        inpaths = False
-        for lineno, line in enumerate(lines):
-            match = sectionre.match(line)
-            if match and inpaths:
-                break
-            if match and match.group(1) == "paths":
-                pathslineno = lineno
-                inpaths = True
-                continue
-            match = itemre.match(line)
-            if inpaths and match and match.groups(1)[0] == targetalias:
-                aliaslineno = lineno
-                break
-
-    if pathslineno is None:
-        # todo: will Windows get upset about these newlines?
-        lines.append("[paths]\n")
-        lines.append("(placeholder)")
-        aliaslineno = len(lines) - 1
-
-    elif aliaslineno is None:
-        lines.insert(pathslineno + 1, "(placeholder)")
-        aliaslineno = pathslineno + 1
-
-    # todo: warn if there isn't already an alias for the old value of default?
-    lines[aliaslineno] = "%s = %s\n" %(targetalias, newpath)
-
-    temphgrcpath = os.path.join(repo.path, ".hgrc.temp")
-    f = open(temphgrcpath, "w")
-    f.write("".join(lines))
-    f.close()
-
-    # todo: make this not explode on Windows (I've looked at
-    # utils.atomictempfile, but it's not immidiatly obvious how to use it
-    # properly).
-    util.rename(temphgrcpath, hgrcpath)
-
-    ui.write(_("set %s to %s\n") %(targetalias, newpath))
-
-cmdtable = {
-    "setpath": (setpath, [], _("hg setpath [ALIAS] PATH"))
-}
-
 
 alias glog="hg glog | less"
 alias viq="vim \`hg root\`/.hg/patches/"
-for HGCMD in tip qser qpo qpop qpu qpush qfin qref qnew di qdi st push rebase pull
+for HGCMD in tip qser qpo qpop qpu qpush qfin qref qnew di qdi st rebase pull nudge
 do
     alias $HGCMD="hg $HGCMD"
 done
+alias push="hg nudge"
 
 # Add our own bin/ directory to PATH
 export PATH="$HOME/.bin:$PATH"

profile.laptop.local

-export PATH="/usr/local/vim_logging/bin/:/usr/local/bin:$PATH:/opt/local/bin:/opt/local/sbin:/usr/local/sbin:/usr/local/texlive/2008basic/bin/universal-darwin:/Users/wolever/bin:/Applications/eclipse/Adobe Flex Builder 3 Plug-in/sdks/3.2.0/bin"
+export FLEX_HOME="/Applications/eclipse/Adobe Flex Builder 3 Plug-in/sdks/3.5/"
+export PATH="/usr/local/vim_logging/bin/:/usr/local/bin:$PATH:/opt/local/bin:/opt/local/sbin:/usr/local/sbin:/usr/local/texlive/2008basic/bin/universal-darwin:/Users/wolever/bin:$FLEX_HOME/bin"
 export MANPATH=/opt/local/share/man:$MANPATH
 export LS_COLORS='no=00:fi=00:di=01;34:ln=01;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:su=37;41:sg=30;43:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.gz=01;31:*.bz2=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.avi=01;35:*.fli=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.flac=01;35:*.mp3=01;35:*.mpc=01;35:*.ogg=01;35:*.wav=01;35:'
-export CDPATH="$CDPATH:~/Workspace/"
+export CDPATH="$CDPATH:~/Verso/Repos/"
 # Load macports bash completion
 . /opt/local/etc/bash_completion
 

vim/colors/print_bw.vim

+" Vim color file
+" Maintainer:   Mike Williams <mrw@eandem.co.uk>
+" Last Change:	2nd June 2003
+" Version:	1.1
+
+" Remove all existing highlighting.
+set background=light
+
+hi clear
+
+if exists("syntax_on")
+  syntax reset
+endif
+
+let g:colors_name = "print_bw"
+
+highlight Normal	    cterm=NONE ctermfg=black ctermbg=white gui=NONE guifg=black guibg=white
+highlight NonText	    ctermfg=black ctermbg=white guifg=black guibg=white
+highlight LineNr        cterm=italic ctermfg=black ctermbg=white gui=italic guifg=black guibg=white 
+
+" Syntax highlighting scheme
+highlight Comment	    cterm=italic ctermfg=black ctermbg=white gui=italic guifg=black guibg=white
+
+highlight Constant	    ctermfg=black ctermbg=white guifg=black guibg=white
+highlight String	    ctermfg=black ctermbg=white guifg=black guibg=white
+highlight Character	    ctermfg=black ctermbg=white guifg=black guibg=white
+highlight Number	    ctermfg=black ctermbg=white guifg=black guibg=white
+" Boolean defaults to Constant
+highlight Float		    ctermfg=black ctermbg=white guifg=black guibg=white
+
+highlight Identifier	ctermfg=black ctermbg=white guifg=black guibg=white
+highlight Function	    ctermfg=black ctermbg=white guifg=black guibg=white
+
+highlight Statement	    ctermfg=black ctermbg=white guifg=black guibg=white
+highlight Conditional	ctermfg=black ctermbg=white guifg=black guibg=white
+highlight Repeat	    ctermfg=black ctermbg=white guifg=black guibg=white
+highlight Label		    ctermfg=black ctermbg=white guifg=black guibg=white
+highlight Operator	    ctermfg=black ctermbg=white guifg=black guibg=white
+" Keyword defaults to Statement
+" Exception defaults to Statement
+
+highlight PreProc	    cterm=bold ctermfg=black ctermbg=white gui=bold guifg=black guibg=white
+" Include defaults to PreProc
+" Define defaults to PreProc
+" Macro defaults to PreProc
+" PreCondit defaults to PreProc
+
+highlight Type		    cterm=bold ctermfg=black ctermbg=white gui=bold guifg=black guibg=white
+" StorageClass defaults to Type
+" Structure defaults to Type
+" Typedef defaults to Type
+
+highlight Special	    cterm=italic ctermfg=black ctermbg=white gui=italic guifg=black guibg=white
+" SpecialChar defaults to Special
+" Tag defaults to Special
+" Delimiter defaults to Special
+highlight SpecialComment cterm=italic ctermfg=black ctermbg=white gui=italic guifg=black guibg=white
+" Debug defaults to Special
+
+highlight Todo		    cterm=italic,bold ctermfg=black ctermbg=white gui=italic,bold guifg=black guibg=white
+" Ideally, the bg color would be white but VIM cannot print white on black!
+highlight Error		    cterm=bold,reverse ctermfg=black ctermbg=grey gui=bold,reverse guifg=black guibg=grey
+
+" vim:et:ff=unix:tw=0:ts=4:sw=4
+" EOF print_bw.vim

vim/ftplugin/python.vim

 map <F9> Oimport rpdb2; rpdb2.start_embedded_debugger("asdf") #BREAK<esc>
 map <F8> Ofrom nose.tools import set_trace; set_trace() #BREAK<esc>
 map <F7> Oimport traceback, sys; traceback.print_exception(*sys.exc_info()) #TRACEBACK<esc>
+map <F7> Oimport traceback, sys; traceback.print_exception(*sys.exc_info()) #TRACEBACK<esc>
+map <F6> Ofrom pprint import pprint; pp = pprint #PPRINT<esc>
 
 if !exists("donePep8")
     let donePep8=1
 set smartcase    " See :help smartcase (trust me, it's useful)
 set incsearch    " Incremental search
 set hlsearch     " Hilight searches
+" I use 'DW: ' to prefix lines during code review - this wraps them properly
+" with 'gq'.
+set comments+=:DW:
 
 " Make sure that the leader is '\'
 let mapleader="\\"
     call setreg('d', oldreg_val, oldreg_type)
 endfun
 
+if has("mouse")
+    set mouse=a
+endif
+
 " Enable perdy 256 color mode
 " set t_Co=256