4e0d0927fa6b

Merge.
[view raw] [browse files]
author Steve Losh <steve@stevelosh.com>
date Tue, 23 Sep 2014 19:58:55 -0400
parents fc0eea69eb35 (current diff) cbcb1ac55566 (diff)
children 33d393113753 fd448e6793d1
branches/tags (none)
files .hgsubstate vim/custom-dictionary.utf-8.add vim/vimrc zsh/bcvi.zsh zsh/django.zsh zsh/keys.zsh zsh/misc.zsh zsh/pip.zsh zsh/tasks.zsh zsh/urls.zsh zsh/vagrant.zsh zshrc

Changes

--- a/.hgsub	Tue Sep 23 19:57:16 2014 -0400
+++ b/.hgsub	Tue Sep 23 19:58:55 2014 -0400
@@ -40,6 +40,6 @@
 vim/bundle/surround              = [git]git://github.com/tpope/vim-surround.git
 vim/bundle/syntastic             = [git]git://github.com/scrooloose/syntastic.git
 vim/bundle/timl                  = [git]git://github.com/tpope/timl.git
-vim/bundle/tslime                = [git]git://github.com/sjl/tslime.vim.git
+vim/bundle/tslime2               = [git]git://github.com/sjl/tslime2.vim.git
 vim/bundle/vitality              = [hg]https://bitbucket.org/sjl/vitality.vim
 vim/bundle/yankring              = [git]git://github.com/vim-scripts/YankRing.vim.git
--- a/.hgsubstate	Tue Sep 23 19:57:16 2014 -0400
+++ b/.hgsubstate	Tue Sep 23 19:58:55 2014 -0400
@@ -31,7 +31,7 @@
 1b4b8f1a8f1c88d8caae6c1b12c22c52ef418f32 vim/bundle/python-mode
 eb8baa5428bde10ecc1cb14eed1d6e16f5f24695 vim/bundle/rainbow-parentheses
 613eb1c81261adfa5dead315089c432ff6dbbc51 vim/bundle/repeat
-cfc1a90540f648492086a20e39fde7514c469fa7 vim/bundle/scala
+b87b9164084c093e0cbd5bff08dbbe01ea59d412 vim/bundle/scala
 1f797fda2c457202cf62d9a082a3fccd4278e3bf vim/bundle/scaladoc
 10d6c6b52fcdd12f3ba457126f66fee4ccceec04 vim/bundle/securemodelines
 0377b100382c19295b42018289fe8d42a7d57e80 vim/bundle/sparkup
@@ -39,7 +39,7 @@
 26fbdd7d1f1aa5600d2ebf39bbdd292c38aac16e vim/bundle/strftimedammit
 1a73f607f8f5477d6942df2eb6e7245c4864f4d3 vim/bundle/surround
 14cb306414dda411b1809a088e18eb2796030095 vim/bundle/syntastic
-71420eb8c2f9580f6a9258b317f0311732a5b243 vim/bundle/timl
-d143308c5f385cce76dba5abf7b8b3737d711a4f vim/bundle/tslime
+c4dda1da8d6b290c9d01f5568cfb6f0effeeb3de vim/bundle/timl
+bf4a599901e0a9c85238158c661351dfaa1c91c2 vim/bundle/tslime2
 84365f56fc87c11f1f04eed487d256cf8b128f7c vim/bundle/vitality
 a884f3a161fa3cd8c996eb53a3d1c68631f60c21 vim/bundle/yankring
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bin/base36-to-uuid	Tue Sep 23 19:58:55 2014 -0400
@@ -0,0 +1,11 @@
+#!/usr/bin/env python
+
+import sys, uuid
+
+s = ''
+if len(sys.argv) != 2 or sys.argv[1] == '-':
+    s = sys.stdin.read().strip()
+else:
+    s = sys.argv[1]
+
+print uuid.UUID(hex(int(s, 36))[2:-1].zfill(32))
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bin/longass	Tue Sep 23 19:58:55 2014 -0400
@@ -0,0 +1,20 @@
+#!/usr/bin/env python
+
+import sys
+
+if len(sys.argv) > 1:
+    n = int(sys.argv[1]) - 1
+else:
+    n = 20
+
+print r'''
+_______
+   \   \
+    \   \
+''',
+print '     |   |\n' * n,
+print r'''     |   |
+    /   /
+___/___/
+'''
+
--- a/bin/myctags	Tue Sep 23 19:57:16 2014 -0400
+++ b/bin/myctags	Tue Sep 23 19:58:55 2014 -0400
@@ -5,8 +5,9 @@
 /usr/local/bin/ctags -R . && sed -i .bak -E -e '/^[^	]+	[^	]+.py	.+v$/d' tags
 
 mv tags tags1
+touch tags2
 
-ffind '.js' --literal |  xargs jsctags -f tags2
+ffind '.js' --literal | xargs jsctags -f tags2 || echo > tags2
 
 
 echo '!_TAG_FILE_FORMAT	2	/extended format; --format=1 will not append ;" to lines/' > tags
--- a/bin/sort-scala-imports	Tue Sep 23 19:57:16 2014 -0400
+++ b/bin/sort-scala-imports	Tue Sep 23 19:58:55 2014 -0400
@@ -5,6 +5,7 @@
 
 
 bracket_padding = None
+MAX_LINE_WIDTH = 100
 
 def next_line():
     return sys.stdin.readline().rstrip('\n')
@@ -30,6 +31,7 @@
         """
         prefix = self.prefix
         guts = self.guts
+        guts.sort(key=lambda s: s.lower())
 
         if not prefix:
             # This is just a single-line, single-item import, so we don't need
@@ -40,10 +42,9 @@
                                  bracket_padding,
                                  ', '.join(guts),
                                  bracket_padding)
-        if len(single) > 100:
+        if len(single) > MAX_LINE_WIDTH:
             self.main_line = prefix + '{'
             self.guts = guts
-            self.guts.sort(key=lambda s: s.lower())
         else:
             self.main_line = single
             self.guts = []
--- a/dotjs/500px.com.js	Tue Sep 23 19:57:16 2014 -0400
+++ b/dotjs/500px.com.js	Tue Sep 23 19:58:55 2014 -0400
@@ -1,8 +0,0 @@
-$(function() {
-    var i = $("img#mainphoto.clickable").attr("src");
-
-    $('body').append("<img width=40 height=40 id='fucking-let-me-drag-you-assholes' src='" + i + "'>");
-
-    $('#fucking-let-me-drag-you-assholes').css('position', 'absolute').css('top', '40px').css('left', '40px');
-
-});
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dotjs/jenkins.banksimple.com.js	Tue Sep 23 19:58:55 2014 -0400
@@ -0,0 +1,12 @@
+var css = '* { -webkit-transition: none !important; -moz-transition: none !important; -o-transition: none !important; -ms-transition: none !important; transition: none !important; }'
+var head = document.head || document.getElementsByTagName('head')[0]
+var style = document.createElement('style');
+ 
+style.type = 'text/css';
+if (style.styleSheet){
+style.styleSheet.cssText = css;
+} else {
+style.appendChild(document.createTextNode(css));
+}
+ 
+head.appendChild(style);
--- a/fish/config.fish	Tue Sep 23 19:57:16 2014 -0400
+++ b/fish/config.fish	Tue Sep 23 19:58:55 2014 -0400
@@ -19,6 +19,10 @@
 function ....;  cd ../../..; end
 function .....; cd ../../../..; end
 
+# I give up
+alias :q exit
+alias :qa exit
+
 # }}}
 # Completions {{{
 
@@ -69,7 +73,6 @@
 # prepend_to_path "/usr/local/share/python"
 prepend_to_path "/usr/local/sbin"
 prepend_to_path "/usr/local/share/npm/bin"
-prepend_to_path "$HOME/bin"
 prepend_to_path "$HOME/lib/dotfiles/bin"
 prepend_to_path "/opt/local/bin"
 prepend_to_path "/opt/subversion/bin"
@@ -78,7 +81,7 @@
 prepend_to_path "/usr/local/Cellar/ruby/1.9.3-p194/bin"
 prepend_to_path "/Applications/Postgres.app/Contents/MacOS/bin"
 prepend_to_path "$HOME/.rbenv/shims"
-prepend_to_path "$NIX_LINK/bin"
+prepend_to_path "$HOME/bin"
 
 set BROWSER open
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fish/functions/gg.fish	Tue Sep 23 19:58:55 2014 -0400
@@ -0,0 +1,3 @@
+function gg -d "git g"
+    git g $argv
+end
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fish/functions/hex.fish	Tue Sep 23 19:58:55 2014 -0400
@@ -0,0 +1,3 @@
+function hex -d "Open a file in Hex Fiend"
+    open -a Hex\ Fiend $argv
+end
--- a/gitconfig	Tue Sep 23 19:57:16 2014 -0400
+++ b/gitconfig	Tue Sep 23 19:58:55 2014 -0400
@@ -73,10 +73,23 @@
     uu = !git merge --ff-only upstream/`git currentbranch`
 
     fuu = "!sh -c 'git fu && git uu' -"
+    fuum = "!sh -c 'git co master && git fuu' -"
 
     addremove = !git add . && git add -u
     addrem = !git addremove
 
+    sl = "!sh -c 'git show --color=always $1 | less -R' -"
+
+    find-merge = "!sh -c 'git log $1..master --merges -n1' -"
+
+    fuck-up-history-from = pull --rebase
+
+
+    g = !git fuum
+
+    ; BEGIN KALEIDOSCOPE SECTION
+    ; GAZE INTO THE ABYSS
+
     ; Find all commits in the given ref that aren't also in master
     ; TODO: Make this take a second optional argument
     find-unmerged-commits = "!sh -c 'git log $1 --format='''%H''' --not master --' -"
@@ -92,7 +105,7 @@
 
     ; ksshow will open a single specific commit in kaleidoscope
     ; it includes the commit log info as a separate file
-    ksshow = "!sh -c 'export KSID=`uuid`; git log -n1 $1 > .git/LOG_MESSAGE; ksdiff --partial-changeset --UUID $KSID -- /dev/null .git/LOG_MESSAGE; git ksdiffid $1^..$1; ksdiff --mark-changeset-as-closed $KSID' -"
+    ksshow = "!sh -c 'export KSID=`uuidgen`; git log -n1 $1 > .git/LOG_MESSAGE_$KSID; ksdiff --partial-changeset --UUID $KSID -- /dev/null .git/LOG_MESSAGE_$KSID; git ksdiffid $1^..$1; ksdiff --mark-changeset-as-closed $KSID' -"
 
     ; ksreview takes a branch, finds all commits in that branch that aren't
     ; merged into master, and opens them one-by-one with ksshow.  It's good for
@@ -100,11 +113,12 @@
     ksreview = "!sh -c 'git find-unmerged-commits $1 | xargs -n1 git ksshow' -"
     ksreviewfor = "!sh -c 'git find-unmerged-commits-for $1 $2 | xargs -n1 git ksshow' -"
 
-    sl = "!sh -c 'git show --color=always $1 | less -R' -"
+    ; review takes a pull request URL and reviews it
+    ; only works if you have the PR-fetching turned on and shit
+    review = "!sh -c 'git fetch upstream && git ksreviewfor `echo $1 | sed -Ee \"s_.*pull/([0-9]+)_refs/pull/upstream/\\1_\"` upstream/master' -"
 
-    find-merge = "!sh -c 'git log $1..master --merges -n1' -"
+    ; END KALEIDOSCOPE SECTION
 
-    fuck-up-history-from = pull --rebase
 [push]
     default = current
 
--- a/tmux/tmux.conf	Tue Sep 23 19:57:16 2014 -0400
+++ b/tmux/tmux.conf	Tue Sep 23 19:58:55 2014 -0400
@@ -11,7 +11,7 @@
 set -g quiet on
 
 # Mouse
-set -g mode-mouse on
+set -g mode-mouse copy
 setw -g mouse-select-window on
 setw -g mouse-select-pane on
 
@@ -28,8 +28,8 @@
 bind r source-file ~/.tmux.conf \; display "Reloaded ~/.tmux.conf"
 
 # Saner splitting.
-bind v split-window -h
-bind s split-window -v
+bind v split-window -h -c '#{pane_current_path}'
+bind s split-window -v -c '#{pane_current_path}'
 bind S choose-session
 
 # Pane movement
@@ -66,6 +66,7 @@
 bind -r ) select-window -t :+
 bind-key -r H swap-window -t -1
 bind-key -r L swap-window -t +1
+bind m command-prompt "move-window -t %%"
 
 # 256 colors please
 set -g default-terminal "screen-256color"
@@ -103,6 +104,7 @@
 # Better name management
 bind c new-window
 bind , command-prompt "rename-window '%%'"
+bind > run-shell "tmux rename-window `basename #{pane_current_path}`"
 
 # Copy mode
 setw -g mode-keys vi
--- a/vim/after/ftplugin/markdown.vim	Tue Sep 23 19:57:16 2014 -0400
+++ b/vim/after/ftplugin/markdown.vim	Tue Sep 23 19:58:55 2014 -0400
@@ -4,25 +4,51 @@
 " this code can be placed in file
 "   $HOME/.vim/after/ftplugin/markdown.vim
 
-func! Foldexpr_markdown(lnum)
+function! Get_Markdown_Header_Level(lnum) " {{{
     let l1 = getline(a:lnum)
 
     if l1 =~ '^\s*$'
-        " ignore empty lines
-        return '='
+        " a blank line is never a header
+        return 0
     endif
 
     let l2 = getline(a:lnum+1)
 
     if  l2 =~ '^==\+\s*'
         " next line is underlined (level 1)
-        return '>1'
+        return 1
     elseif l2 =~ '^--\+\s*'
         " next line is underlined (level 2)
-        return '>2'
+        return 2
     elseif l1 =~ '^#'
         " current line starts with hashes
-        return '>'.matchend(l1, '^#\+')
+        return matchend(l1, '^#\+')
+    endif
+
+    return 0
+endfunction " }}}
+
+function! Foldexpr_markdown(lnum) " {{{
+    let line = getline(a:lnum)
+    let anchor_re = '\v^\<a name.*'
+
+    if line =~ anchor_re
+        let next_line_hval = Get_Markdown_Header_Level(a:lnum + 1)
+        if next_line_hval
+            return '>' . next_line_hval
+        else
+            return '='
+        endif
+    endif
+
+    let line_hval = Get_Markdown_Header_Level(a:lnum)
+
+    if line_hval
+        if getline(a:lnum - 1) =~ anchor_re
+            return line_hval
+        else
+            return '>' . line_hval
+        endif
     elseif a:lnum == 1
         " fold any 'preamble'
         return '>1'
@@ -30,8 +56,30 @@
         " keep previous foldlevel
         return '='
     endif
-endfunc
+endfunction " }}}
+
+function! MarkdownFoldText() " {{{
+    let line = getline(v:foldstart)
+
+    let anchor_re = '\v^\<a name.*'
+    if line =~ anchor_re
+        let line = getline(v:foldstart + 1)
+    end
 
+    let nucolwidth = &fdc + &number * &numberwidth
+    let windowwidth = winwidth(0) - nucolwidth - 3
+    let foldedlinecount = v:foldend - v:foldstart
+
+    " expand tabs into spaces
+    let onetab = strpart('          ', 0, &tabstop)
+    let line = substitute(line, '\t', onetab, 'g')
+
+    let line = strpart(line, 0, windowwidth - 2 -len(foldedlinecount))
+    let fillcharcount = windowwidth - len(line) - len(foldedlinecount)
+    return line . '…' . repeat(" ",fillcharcount) . foldedlinecount . '…' . ' '
+endfunction " }}}
+
+setlocal foldtext=MarkdownFoldText()
 setlocal foldexpr=Foldexpr_markdown(v:lnum)
 setlocal foldmethod=expr
 
--- a/vim/custom-dictionary.utf-8.add	Tue Sep 23 19:57:16 2014 -0400
+++ b/vim/custom-dictionary.utf-8.add	Tue Sep 23 19:58:55 2014 -0400
@@ -162,3 +162,5 @@
 meatspace
 scrollback
 tmux
+precompute
+fuckery
--- a/vim/vimrc	Tue Sep 23 19:57:16 2014 -0400
+++ b/vim/vimrc	Tue Sep 23 19:58:55 2014 -0400
@@ -23,8 +23,8 @@
 " specifying files to load and none of them work?
 "
 " Computers are bullshit.
-let $BASH_ENV = "~/.bash_profile"
-set shell=/bin/bash
+" let $BASH_ENV = "~/.bash_profile"
+set shell=/bin/bash\ --login
 
 filetype off
 call pathogen#infect()
@@ -293,6 +293,9 @@
 nnoremap <leader>( :tabprev<cr>
 nnoremap <leader>) :tabnext<cr>
 
+" Wrap
+nnoremap <leader>W :set wrap!<cr>
+
 " Copying text to the system clipboard.
 "
 " For some reason Vim no longer wants to talk to the OS X pasteboard through "*.
@@ -468,6 +471,9 @@
 nnoremap <leader>r :silent !ranger %:h<cr>:redraw!<cr>
 nnoremap <leader>R :silent !ranger<cr>:redraw!<cr>
 
+" Jump (see the J mini-plugin later on)
+nnoremap <leader>J :J<space>
+
 " Insert Mode Completion {{{
 
 inoremap <c-f> <c-x><c-f>
@@ -748,7 +754,7 @@
     au FileType clojure setlocal report=100000
 
     " Things that should be indented 2-spaced
-    au FileType clojure setlocal lispwords+=when-found,defform,when-valid
+    au FileType clojure setlocal lispwords+=when-found,defform,when-valid,try
 
     au FileType clojure RainbowParenthesesActivate
     au syntax clojure RainbowParenthesesLoadRound
@@ -1190,10 +1196,9 @@
     " Send to tmux with localleader e
     au FileType pgsql nnoremap <buffer> <silent> <localleader>e :let psql_tslime_view = winsaveview()<cr>vip"ry:call SendToTmux(@r)<cr>:call winrestview(psql_tslime_view)<cr>
 
-augroup END
-
     " kill pager with q
     au FileType pgsql nnoremap <buffer> <silent> <localleader>q :call SendToTmuxRaw("q")<cr>
+augroup END
 
 " }}}
 " Puppet {{{
@@ -1263,15 +1268,36 @@
 " }}}
 " Scala {{{
 
+function! DispatchMavenTest()
+    let view = winsaveview()
+    let zreg = @z
+
+    " Move to the top of the file
+    normal! gg
+
+    " Find the spec name
+    call search('\vclass (.*Spec)')
+    normal! w"zyiw
+
+    let spec = @z
+
+    execute "Dispatch mvn -q -B test -Dtest=" . spec
+
+    let @z = zreg
+    call winrestview(view)
+endfunction
+
 augroup ft_scala
     au!
     au Filetype scala setlocal foldmethod=marker foldmarker={,}
     au Filetype scala setlocal textwidth=100
+    au Filetype scala setlocal shiftwidth=2
     au Filetype scala compiler maven
     au Filetype scala let b:dispatch = 'mvn -B package install'
     au Filetype scala nnoremap <buffer> <localleader>s mz:%!sort-scala-imports<cr>`z
     au Filetype scala nnoremap <buffer> M :call scaladoc#Search(expand("<cword>"))<cr>
     au Filetype scala vnoremap <buffer> M "ry:call scaladoc#Search(@r)<cr>
+    au Filetype scala nnoremap <buffer> <localleader>t :call DispatchMavenTest()<cr>
     au Filetype scala nmap <buffer> <localleader>( ysiwbi
     au Filetype scala nmap <buffer> <localleader>[ ysiwri
     ")]
@@ -1441,6 +1467,7 @@
 
 let g:ctrlp_map = '<leader>,'
 nnoremap <leader>. :CtrlPTag<cr>
+nnoremap <leader>E :CtrlP ../
 
 let g:ctrlp_prompt_mappings = {
 \ 'PrtSelectMove("j")':   ['<c-j>', '<down>', '<s-tab>'],
@@ -1976,7 +2003,8 @@
     diffupdate
 endfunc
 
-nnoremap <leader>W :call ToggleDiffWhitespace()<CR>
+" TODO: Figure out the diffexpr shit necessary to make this buffer-local.
+" nnoremap <leader>W :call ToggleDiffWhitespace()<CR>
 
 " }}}
 " Error Toggles {{{
@@ -2174,6 +2202,15 @@
 nnoremap <leader>Hb :HgBlame<cr>
 
 " }}}
+" J {{{
+
+function! s:JumpTo(dest)
+  call system("tmux split-window -h 'j " . a:dest . "; and myctags &; and vim .'")
+endfunction
+
+command! -nargs=1 J call s:JumpTo(<f-args>)
+
+" }}}
 " Ack motions {{{
 
 " Motions to Ack for things.  Works with pretty much everything, including:
@@ -2370,6 +2407,20 @@
 " vnoremap <leader>M :MarkUnchanged<cr>
 
 " }}}
+" MS to UTC {{{
+
+function! MS2UTC(ms)
+    let seconds = strpart(a:ms, 0, strlen(a:ms) - 3)
+    return substitute(system("date -ur " . seconds), "\n\n*", "", "")
+endfunction
+
+function! MS2UTCWord()
+    return MS2UTC(expand("<cword>"))
+endfunction
+
+nnoremap <leader>U :echo MS2UTCWord()<cr>
+
+" }}}
 
 " }}}
 " Environments (GUI/Console) ---------------------------------------------- {{{
--- a/weechat/alias.conf	Tue Sep 23 19:57:16 2014 -0400
+++ b/weechat/alias.conf	Tue Sep 23 19:58:55 2014 -0400
@@ -1,5 +1,5 @@
 #
-# alias.conf -- weechat v0.4.2
+# alias.conf -- weechat v0.4.3
 #
 
 [cmd]
--- a/weechat/aspell.conf	Tue Sep 23 19:57:16 2014 -0400
+++ b/weechat/aspell.conf	Tue Sep 23 19:58:55 2014 -0400
@@ -1,5 +1,5 @@
 #
-# aspell.conf -- weechat v0.4.2
+# aspell.conf -- weechat v0.4.3
 #
 
 [color]
--- a/weechat/buffers.conf	Tue Sep 23 19:57:16 2014 -0400
+++ b/weechat/buffers.conf	Tue Sep 23 19:58:55 2014 -0400
@@ -1,5 +1,5 @@
 #
-# buffers.conf -- weechat v0.4.2
+# buffers.conf -- weechat v0.4.3
 #
 
 [color]
--- a/weechat/charset.conf	Tue Sep 23 19:57:16 2014 -0400
+++ b/weechat/charset.conf	Tue Sep 23 19:58:55 2014 -0400
@@ -1,5 +1,5 @@
 #
-# charset.conf -- weechat v0.4.2
+# charset.conf -- weechat v0.4.3
 #
 
 [default]
--- a/weechat/logger.conf	Tue Sep 23 19:57:16 2014 -0400
+++ b/weechat/logger.conf	Tue Sep 23 19:58:55 2014 -0400
@@ -1,5 +1,5 @@
 #
-# logger.conf -- weechat v0.4.2
+# logger.conf -- weechat v0.4.3
 #
 
 [look]
@@ -15,8 +15,8 @@
 info_lines = off
 mask = "$plugin.$name.weechatlog"
 name_lower_case = on
-nick_prefix = ""
-nick_suffix = ""
+nick_prefix = " <"
+nick_suffix = "> "
 path = "%h/logs/"
 replacement_char = "_"
 time_format = "%Y-%m-%d %H:%M:%S"
--- a/weechat/plugins.conf	Tue Sep 23 19:57:16 2014 -0400
+++ b/weechat/plugins.conf	Tue Sep 23 19:58:55 2014 -0400
@@ -1,5 +1,5 @@
 #
-# plugins.conf -- weechat v0.4.2
+# plugins.conf -- weechat v0.4.3
 #
 
 [var]
@@ -18,7 +18,7 @@
 perl.buffers.color_whitelist_low = ""
 perl.buffers.color_whitelist_message = ""
 perl.buffers.color_whitelist_private = ""
-perl.buffers.hide_merged_buffers = "on"
+perl.buffers.hide_merged_buffers = "all"
 perl.buffers.indenting = "on"
 perl.buffers.indenting_number = "on"
 perl.buffers.short_names = "on"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/weechat/python/autoload/quotes.py	Tue Sep 23 19:58:55 2014 -0400
@@ -0,0 +1,87 @@
+import subprocess
+
+SCRIPT_NAME = 'quotes'
+SCRIPT_AUTHOR = 'Steve Losh <steve@stevelosh.com>'
+SCRIPT_VERSION = '1.0'
+SCRIPT_LICENSE = 'MIT/X11'
+SCRIPT_DESC = 'Grab quotes and shove them into a text file.'
+SCRIPT_COMMAND = 'quo'
+
+QUOTE_FILE = '/Users/sjl/Dropbox/quotes.txt'
+
+import_ok = True
+
+try:
+    import weechat
+except ImportError:
+    print 'This is a weechat script, what are you doing, run it in weechat, jesus'
+    import_ok = False
+
+weechat_version = 0
+
+def hd(fn, name, obj, attr):
+    return fn(weechat.hdata_get(name), obj, attr)
+
+def hdp(name, obj, attr):
+    return hd(weechat.hdata_pointer, name, obj, attr)
+
+def hds(name, obj, attr):
+    return hd(weechat.hdata_string, name, obj, attr)
+
+def get_lines(buffer):
+    lines = hdp("buffer", buffer, "own_lines")
+    if not lines:
+        # null pointer wat do
+        return None
+
+    last_lines = []
+
+    line = hdp("lines", lines, "last_line")
+    for _ in range(15):
+        if not line:
+            # shit we're at the top of the buffer
+            break
+
+        data = hdp("line", line, "data")
+        msg = hds("line_data", data, "message")
+        pre = hds("line_data", data, "prefix")
+
+        msg = weechat.string_remove_color(msg, "")
+        pre = weechat.string_remove_color(pre, "")
+
+        last_lines.append("<%s> %s" % (pre.strip(), msg.strip()))
+
+        line = hdp("line", line, "prev_line")
+
+    last_lines.reverse()
+    return last_lines
+
+def quote_grab(data, buffer, args):
+    lines = get_lines(buffer)
+
+    with open(QUOTE_FILE, 'a') as f:
+        f.write("\n---\n")
+        f.write('\n'.join(lines))
+
+    subprocess.call(["vim", QUOTE_FILE,
+                     # start at the bottom of the file
+                     "+",
+                     # move up N lines, where N is how many we appended
+                     "-c", "normal! %dk" % len(lines)])
+    weechat.command("", "/window refresh")
+
+    return weechat.WEECHAT_RC_OK
+
+if __name__ == '__main__' and import_ok:
+    if weechat.register(SCRIPT_NAME, SCRIPT_AUTHOR, SCRIPT_VERSION,
+                        SCRIPT_LICENSE, SCRIPT_DESC, '', ''):
+        weechat_version = weechat.info_get('version_number', '') or 0
+        weechat.hook_command(
+            SCRIPT_COMMAND,
+            'Appends the last 15 lines of the current buffer to your quotes '
+            'file and opens it in Vim so you can trim it.',
+            '',
+            '',
+            '',
+            'quote_grab',
+            '')
--- a/weechat/relay.conf	Tue Sep 23 19:57:16 2014 -0400
+++ b/weechat/relay.conf	Tue Sep 23 19:58:55 2014 -0400
@@ -1,5 +1,5 @@
 #
-# relay.conf -- weechat v0.4.2
+# relay.conf -- weechat v0.4.3
 #
 
 [look]
--- a/weechat/rmodifier.conf	Tue Sep 23 19:57:16 2014 -0400
+++ b/weechat/rmodifier.conf	Tue Sep 23 19:58:55 2014 -0400
@@ -1,5 +1,5 @@
 #
-# rmodifier.conf -- weechat v0.4.2
+# rmodifier.conf -- weechat v0.4.3
 #
 
 [look]
--- a/weechat/script.conf	Tue Sep 23 19:57:16 2014 -0400
+++ b/weechat/script.conf	Tue Sep 23 19:58:55 2014 -0400
@@ -1,5 +1,5 @@
 #
-# script.conf -- weechat v0.4.2
+# script.conf -- weechat v0.4.3
 #
 
 [look]
--- a/weechat/sec.conf	Tue Sep 23 19:57:16 2014 -0400
+++ b/weechat/sec.conf	Tue Sep 23 19:58:55 2014 -0400
@@ -1,5 +1,5 @@
 #
-# sec.conf -- weechat v0.4.2
+# sec.conf -- weechat v0.4.3
 #
 
 [crypt]
--- a/weechat/urlgrab.conf	Tue Sep 23 19:57:16 2014 -0400
+++ b/weechat/urlgrab.conf	Tue Sep 23 19:58:55 2014 -0400
@@ -1,5 +1,5 @@
 #
-# urlgrab.conf -- weechat v0.4.2
+# urlgrab.conf -- weechat v0.4.3
 #
 
 [color]
--- a/weechat/weechat.conf	Tue Sep 23 19:57:16 2014 -0400
+++ b/weechat/weechat.conf	Tue Sep 23 19:58:55 2014 -0400
@@ -36,7 +36,7 @@
 day_change_message_2dates = "-- %%a, %%d %%b %%Y (%a, %d %b %Y) --"
 eat_newline_glitch = off
 highlight = "sjl,slosh,slj,clojerks"
-highlight_regex = "(^all[,:]|backend(ia)?[^s/]|red[- ]tape|steve ?losh|rob ford|(jesus )?fucking christ|bring me my [A-Za-z0-9_]+ (pant|breeche|kilt|skirt|short|jort|plort)s?)"
+highlight_regex = "(^all[,:]|backend(ia)?[^s/]|red[- ]tape|steve ?losh|rob ford|(jesus )?fucking christ|bring me my [A-Za-z0-9_]+ (pant|breeche|kilt|skirt|short|jort|plort)s?|([[:<:]]((mother)?fuck([ie]ng?|er)?|(god?)?damn(ed)?|dammit|(bull|horse)?shite?)[[:>:]].*){3,})"
 highlight_tags = ""
 hotlist_add_buffer_if_away = on
 hotlist_buffer_separator = ", "
@@ -116,7 +116,7 @@
 chat_inactive_buffer = darkgray
 chat_inactive_window = darkgray
 chat_nick = lightcyan
-chat_nick_colors = "027,048,068,070,081,082,099,112,129,136,169,178,208,226"
+chat_nick_colors = "027,048,068,028,081,082,099,112,129,136,169,178,208,226,113,196,161,23,59,222"
 chat_nick_offline = darkgray
 chat_nick_offline_highlight = default
 chat_nick_offline_highlight_bg = darkgray
@@ -349,6 +349,8 @@
 meta2-19~ = "/window +1"
 meta2-1;3A = "/buffer -1"
 meta2-1;3B = "/buffer +1"
+meta2-1;9A = "/buffer move -1"
+meta2-1;9B = "/buffer move +1"
 meta2-1;3C = "/buffer +1"
 meta2-1;3D = "/buffer -1"
 meta2-1;5A = "/input history_global_previous"
--- a/weechat/xfer.conf	Tue Sep 23 19:57:16 2014 -0400
+++ b/weechat/xfer.conf	Tue Sep 23 19:58:55 2014 -0400
@@ -1,5 +1,5 @@
 #
-# xfer.conf -- weechat v0.4.2
+# xfer.conf -- weechat v0.4.3
 #
 
 [look]
@@ -30,6 +30,7 @@
 auto_accept_chats = off
 auto_accept_files = off
 auto_accept_nicks = ""
+auto_check_crc32 = off
 auto_rename = on
 auto_resume = on
 convert_spaces = on
--- a/zsh/bcvi.zsh	Tue Sep 23 19:57:16 2014 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,4 +0,0 @@
-#!/usr/bin/env zsh
-
-alias ss='bcvi --wrap-ssh -- '
-alias bcvid='dtach -A /tmp/bcvi.socket bcvi --listener'
--- a/zsh/django.zsh	Tue Sep 23 19:57:16 2014 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-alias djangotests="PYTHONPATH=..:$PYTHONPATH ./runtests.py --settings=test_sqlite"
--- a/zsh/keys.zsh	Tue Sep 23 19:57:16 2014 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,2 +0,0 @@
-alias key-dan='echo "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA47M4qmsZT2Ztju1/l/NLVOYKwYSnhTFHG4WuFIc2RfhfQ7Zj1D8Y3renX/uVYtERk6A6axRjAbfqS7Cl73u/UapMnap0a5ysP3AP31+jmEAEfyz3DhellcN08sgIxV5YTC8kpfBi752XhdK9gfVzzxlzQHiGbFMQkMXUnxPsqObdRsAafMFxy7QcZU9s4mL+w2dSWdN24Dg84REAuDP3Rt1P3ORTHbzxLsRAUPG5OTChfjG/ITZYDdmv/g2R0vEcdoSGxGVsja3DTfaUz1kgWtbDA+w0w7VJT6THkz2tkMqwqcRh1w3uG4qvtw2TE84Vj5b73w29kbpcNEcQwtlTtQ== dumbwaiterdesign@Dumbwaiter-Designs-MacBook-Pro.local" | pbcopy'
-alias key-sawyer='echo "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEApiTmz7vDqoAYU2XwtedoVWOwEIZ9uoiMBoIBYi+ukzmw2Z4t+fKGVuSyAp++LscWppXwoRnHs1tdOPOhX0LcPtOXM1QXlRGen/mfLUDptTXMI/1nkcWTPvF+0rKZd/uBPW4ud+0a47KhnfPh+ShLc1ZVK/iib8GHd1qctKEdrVFgCoEDpAEFxFeM4J3vbBOOVeSODD9jWi0aELPPgHotnoyUElaSP6H9lZmZSw8XHiezPLgxgUBsA1tfWLM5f36+sjWQOtKBRreQ1d6Y5lUMHckwBpQINbsjn6r9ZQuenhVxbCjxpHk+wYwu1yDt0dBcCMV2DCkyjtXzQ74MHzDZoQ== dan@Daniel-Jaouens-iMac.local" | pbcopy'
--- a/zsh/misc.zsh	Tue Sep 23 19:57:16 2014 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,117 +0,0 @@
-alias h=hg
-alias g=git
-
-alias ghcm='ghc --make -optl"-Wl,-read_only_relocs,suppress"'
-alias pbc='pbcopy'
-alias pbp='pbpaste'
-
-alias m='mvim .'
-
-alias f='fab'
-alias fd='fab dev'
-
-alias weechat='weechat-curses'
-
-alias spotlight-off='sudo mdutil -a -i off && sudo mv /System/Library/CoreServices/Search.bundle/ /System/Library/CoreServices/SearchOff.bundle/ && killall SystemUIServer'
-alias spotlight-on='sudo mdutil -a -i on && sudo mv /System/Library/CoreServices/SearchOff.bundle/ /System/Library/CoreServices/Search.bundle/ && killall SystemUIServer'
-alias spotlight-wat='sudo fs_usage -w -f filesys mdworker | grep "open"'
-
-alias mutt='cd ~/Desktop; mutt'
-alias hi='pygmentize'
-
-function cj() { curl "$*" | python -mjson.tool | pygmentize -l javascript; }
-
-function mdown () {
-    (echo '
-        <head>
-            <style>
-                body {
-                    font-family: Georgia;
-                    font-size: 17px;
-                    line-height: 24px;
-                    color: #222;
-                    text-rendering: optimizeLegibility;
-                    width: 670px;
-                    margin: 20px auto;
-                    padding-bottom: 80px;
-                }
-                h1, h2, h3, h4, h5, h6 {
-                    font-weight: normal;
-                    margin-top: 48px;
-                }
-                h1 { font-size: 48px; }
-                h2 {
-                    font-size: 36px;
-                    border-bottom: 6px solid #ddd;
-                    padding: 0 0 6px 0;
-                }
-                h3 {
-                    font-size: 24px;
-                    border-bottom: 6px solid #eee;
-                    padding: 0 0 2px 0;
-                }
-                h4 { font-size: 20px; }
-                pre {
-                    background-color: #f5f5f5;
-                    font: normal 15px Menlo;
-                    line-height: 24px;
-                    padding: 8px 10px;
-                    overflow-x: scroll;
-                }
-            </style>
-        </head>
-    '; markdown $@) | bcat
-}
-
-# Updated verison of SVN.
-export DYLD_LIBRARY_PATH="/opt/subversion/lib:$DYLD_LIBRARY_PATH"
-export PYTHONPATH="/opt/subversion/lib/svn-python:$PYTHONPATH"
-export PATH="/opt/subversion/bin:$PATH"
-
-
-# What the hell did I do the other day?
-function whatthehelldididoon() {
-    for repo in `find . -name '.hg'`
-    do
-        echo $repo
-        h .. -R $repo/.. -d "$1" -u 'Steve Losh'
-    done
-}
-
-alias dv='dvtm -m "^f"'
-alias dvt='dtach -A /tmp/dvtm-session.sock -r winch dvtm -m "^f"'
-alias swank='dtach -A /tmp/dtach-swank.sock -r winch lein swank'
-alias target='dtach -A /tmp/target -r winch zsh'
-alias us-solr='wo unisubs && dtach -A /tmp/dtach-unisubs-solr.sock -r winch python manage.py run_solr --settings=dev_settings'
-
-alias goawayswapfilesyouareswapfilesidontevenneedyou='rm ~/.vim/tmp/swap/*'
-
-function fack () {
-    find . -name $@ | grep -v '/\.hg\|/\.git'
-}
-
-alias collapse="sed -e 's/  */ /g'"
-alias cuts="cut -d' '"
-alias clc="./get-last-commit-url.py | pbc"
-alias count="sort | uniq -c | sort -n"
-
-function psg() {
-    ps auxww | grep --color=always $* | grep -v grep | collapse | cuts -f 2,11-
-}
-
-# sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.atrun.plist
-function gn() {
-    MINS=$1; shift
-
-    if [[ "x$MINS" == "x1" ]]; then
-        echo "one"
-        UNITS="minute"
-    else
-        echo "two"
-        UNITS="minutes"
-    fi
-
-    echo growlnotify -sm "'$*'" | at now + $MINS $UNITS
-}
-
-alias lc='longcat | lolcat'
--- a/zsh/pip.zsh	Tue Sep 23 19:57:16 2014 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,13 +0,0 @@
-#!/usr/bin/env zsh
-
-export PIP_VIRTUALENV_BASE=$WORKON_HOME
-
-PIP_BIN="`which pip`"
-alias pip-sys="$PIP_BIN"
-
-pip() {
-    if [ -n "$VIRTUAL_ENV" ]
-    then $PIP_BIN -E "$VIRTUAL_ENV" "$@"
-    else echo "Not currently in a venv -- use pip-sys to work system-wide."
-    fi
-}
\ No newline at end of file
--- a/zsh/tasks.zsh	Tue Sep 23 19:57:16 2014 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,11 +0,0 @@
-#!/usr/bin/env zsh
-
-alias t='~/lib/t/t.py --task-dir="~/Dropbox/tasks" --list=tasks.txt'
-
-alias p='~/lib/t/t.py --task-dir="~/Dropbox/tasks" --list=pack.txt'
-alias pa='~/lib/t/t.py --task-dir="~/Dropbox/tasks" --list=pack-archive'
-
-function packfor() {
-    cp "$HOME/Dropbox/tasks/pack-archive" "$HOME/Dropbox/tasks/pack.txt"
-    touch "$HOME/Dropbox/tasks/.pack.txt.done"
-}
--- a/zsh/urls.zsh	Tue Sep 23 19:57:16 2014 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,8 +0,0 @@
-function urlopen() {
-    open "http://$*"
-}
-
-alias -s com=urlopen
-alias -s org=urlopen
-alias -s net=urlopen
-alias -s io=urlopen
--- a/zsh/vagrant.zsh	Tue Sep 23 19:57:16 2014 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,12 +0,0 @@
-alias v='vagrant'
-alias vs='vagrant suspend'
-alias vp='vagrant provision'
-alias vu='vagrant up'
-alias vh='vagrant halt'
-alias vss='vagrant ssh'
-
-function turnoffthedamnboxvagrant () {
-    VBoxManage list vms | grep "$1" | cut -d' ' -f1 | tr -d '"\n ' | xargs -0 -I BOX VBoxManage controlvm BOX poweroff
-}
-
-alias biv='bcvi --install vagrant'
--- a/zshrc	Tue Sep 23 19:57:16 2014 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,77 +0,0 @@
-export ZSH="$HOME/lib/oh-my-zsh"
-export ZSH_THEME="prose"
-export DISABLE_AUTO_UPDATE="true"
-export OH_MY_ZSH_DEBUG="true"
-plugins=(command-coloring pip fabric lein redis-cli vagrant)
-
-#test -f "$HOME/src/hgd/hd" && export OH_MY_ZSH_HG="$HOME/src/hgd/hd" || export OH_MY_ZSH_HG='hg'
-
-source $ZSH/oh-my-zsh.sh
-
-# Custom options -------------------------------------------------------------
-unsetopt promptcr
-
-# Useful aliases -------------------------------------------------------------
-alias j='z'
-alias fab='fab -i ~/.ssh/stevelosh'
-alias oldgcc='export CC=/usr/bin/gcc-4.0'
-alias tm='tmux -u2'
-alias c='clear'
-alias bp='bpython'
-alias oi='offlineimap'
-
-export DISABLE_AUTO_TITLE="true"
-
-# Environment variables ------------------------------------------------------
-export EDITOR='vim'
-export PATH="$HOME/.gem/ruby/1.8/bin:${PATH}"
-export PATH="$HOME/bin:${PATH}"
-export PATH="$HOME/lib/dotfiles/bin:${PATH}"
-export PATH="$HOME/bin:/usr/local/bin:/usr/local/sbin:/opt/local/bin:$PATH"
-export PATH="/opt/subversion/bin:${PATH}"
-export PATH="/usr/local/Cellar/ruby/1.9.2-p290/bin:${PATH}"
-export PATH="/usr/local/Cellar/ruby/1.9.3-p125/bin:${PATH}"
-export GREP_OPTIONS='--color=auto'
-export HISTSIZE=1000
-export HISTFILESIZE=1000
-export HISTCONTROL=erasedups
-export COMMAND_MODE=unix2003
-export RUBYOPT=rubygems
-export CLASSPATH="$CLASSPATH:/usr/local/Cellar/clojure-contrib/1.2.0/clojure-contrib.jar"
-
-# Python variables -----------------------------------------------------------
-export PIP_DOWNLOAD_CACHE="$HOME/.pip/cache"
-export PYTHONSTARTUP="$HOME/.pythonrc.py"
-export WORKON_HOME="${HOME}/lib/virtualenvs"
-export PATH="${PATH}:/Developer/usr/bin/"
-export PATH="${PATH}:/usr/local/share/python/"
-export PATH="${PATH}:$HOME/.lein/bin"
-export PYTHONPATH="$PYTHONPATH:/usr/local/Cellar/python/2.7.1/lib/python2.7/site-packages"
-export PYTHONPATH="$PYTHONPATH:/usr/local/lib/python2.7.1/site-packages"
-export PYTHONPATH="$PYTHONPATH:/usr/local/lib/python2.7/site-packages"
-export PYTHONPATH="$PYTHONPATH:/usr/local/lib/python2.6/site-packages"
-export VEW_PATH="$HOME/lib/python/virtualenvwrapper/virtualenvwrapper.sh"
-export VEW_PATH="/usr/local/share/python/virtualenvwrapper.sh"
-export PYTHONPATH="$HOME/lib/python/see:$PYTHONPATH"
-export NODE_PATH="$NODE_PATH:/usr/local/lib/node:/usr/local/lib/node_modules"
-
-# Mercurial variables --------------------------------------------------------
-export PATH="$HOME/lib/hg/hg-stable:$PATH"
-export PYTHONPATH="$HOME/lib/hg/hg-stable:$PYTHONPATH"
-
-# Extra ----------------------------------------------------------------------
-source `brew --prefix`/etc/profile.d/z.sh
-
-# Pre-Prompt Command ---------------------------------------------------------
-function precmd () {
-    z --add "$(pwd -P)"
-}
-
-# Local Settings -------------------------------------------------------------
-if [[ -s $HOME/.zshrc_local ]] ; then source $HOME/.zshrc_local ; fi
-
-# Emacs... -------------------------------------------------------------------
-alias e='emacsclient -nc .'
-
-# GRC
-source "`brew --prefix grc`/etc/grc.bashrc"