# HG changeset patch # User Steve Losh # Date 1333120113 14400 # Node ID cd7424ed2e9d35e55022d3e59b44abd2f28d1137 # Parent 2b78b064b4153b85c987ceceb356eece23315983 Moar. diff -r 2b78b064b415 -r cd7424ed2e9d .hgsub --- a/.hgsub Wed Mar 28 10:18:06 2012 -0400 +++ b/.hgsub Fri Mar 30 11:08:33 2012 -0400 @@ -23,11 +23,11 @@ vim/bundle/indent-object = [git]git://github.com/michaeljsmith/vim-indent-object.git vim/bundle/fugitive = [git]git://github.com/tpope/vim-fugitive.git vim/bundle/nosecompiler = [git]git://github.com/olethanh/Vim-nosecompiler.git -vim/bundle/rainbow-parentheses = [git]git://github.com/kien/rainbow_parentheses.vim.git vim/bundle/AnsiEsc.vim = [git]git://github.com/vim-scripts/AnsiEsc.vim.git vim/bundle/powerline = [git]git://github.com/Lokaltog/vim-powerline.git vim/bundle/yankring = [git]git://github.com/vim-scripts/YankRing.vim.git vim/bundle/badwolf = [hg]https://bitbucket.org/sjl/badwolf/ vim/bundle/tslime = [git]git://github.com/sjl/tslime.vim.git +vim/bundle/smartinput = [git]git://github.com/kana/vim-smartinput.git keymando/Plugins/abbrev = [git]git://github.com/keymando/abbrev.git diff -r 2b78b064b415 -r cd7424ed2e9d .hgsubstate --- a/.hgsubstate Wed Mar 28 10:18:06 2012 -0400 +++ b/.hgsubstate Fri Mar 30 11:08:33 2012 -0400 @@ -15,8 +15,8 @@ b7889db57c90824ff5092da4fdde9e05689f24fa vim/bundle/nosecompiler 99277d9eed97a59cacc1db8c1dece2bcfd96d877 vim/bundle/powerline 1d60548ce9543c462a1fc36830c5e7ec33a57b78 vim/bundle/python-mode -45e270d2001d07165d24cf8e6936fdcba5724cfb vim/bundle/rainbow-parentheses 86228e5aaf622c6386ab4e98c3bca144ca333ba1 vim/bundle/slimv +c01d81a697de5e28452f32762a9c8fbe3eac0496 vim/bundle/smartinput c6197a10ace82e0fe0c08e5cf5c017b7069a978e vim/bundle/sparkup 6eec2c131213850ed65fd6da494dfd1a0d620a4e vim/bundle/strftimedammit 5a38ce8b600e11941f695523363fe04e6478549a vim/bundle/supertab diff -r 2b78b064b415 -r cd7424ed2e9d dotjs/github.com.js --- a/dotjs/github.com.js Wed Mar 28 10:18:06 2012 -0400 +++ b/dotjs/github.com.js Fri Mar 30 11:08:33 2012 -0400 @@ -1,40 +1,44 @@ $(function() { - $('.site').prepend(''); - $('#toggle-merges-button').css('position', 'absolute').css('top', '10px').css('left', '10px'); + if ($('body').hasClass('page-commits')) { + + $('ul.pagehead-actions').prepend('
  • Review
  • '); - $('#toggle-merges-button').toggle(function() { - $('li.commit').each(function() { - var t = $(this).find('a.message').text().substring(0, 5); - if (t === 'Merge' || t === 'merge') { - $(this).hide(); - return; - } - t = $(this).find('a.message').text().substring(0, 24); - if (t === 'Updated integration repo' || t === 'updated integration repo') { - $(this).hide(); - return; - } - t = $(this).find('a.message').text().substring(0, 23); - if (t === 'Update integration repo' || t === 'update integration repo') { - $(this).hide(); - return; - } - t = $(this).find('a.message').text().substring(0, 26); - if (t === 'Update unisubs-integration' || t === 'update unisubs-integration') { - $(this).hide(); - return; - } - t = $(this).find('a.message').text().substring(0, 65); - if (t === 'Updated transiflex translations -- through update_translations.sh') { - $(this).hide(); - return; - } - if ($(this).find('span.author-name').text() === 'sjl') { - $(this).hide(); - return; - } + $('#toggle-merges-button').toggle(function() { + $('li.commit').each(function() { + var t = $(this).find('a.message').text().substring(0, 5); + if (t === 'Merge' || t === 'merge') { + $(this).hide(); + return; + } + t = $(this).find('a.message').text().substring(0, 24); + if (t === 'Updated integration repo' || t === 'updated integration repo') { + $(this).hide(); + return; + } + t = $(this).find('a.message').text().substring(0, 23); + if (t === 'Update integration repo' || t === 'update integration repo') { + $(this).hide(); + return; + } + t = $(this).find('a.message').text().substring(0, 26); + if (t === 'Update unisubs-integration' || t === 'update unisubs-integration') { + $(this).hide(); + return; + } + t = $(this).find('a.message').text().substring(0, 65); + if (t === 'Updated transiflex translations -- through update_translations.sh') { + $(this).hide(); + return; + } + if ($(this).find('span.author-name').text() === 'sjl') { + $(this).hide(); + return; + } + }); + $('span.text', this).text('Stop reviewing'); + }, function() { + $('li.commit').show(); + $('span.text', this).text('Review'); }); - }, function() { - $('li.commit').show(); - }); + } }); diff -r 2b78b064b415 -r cd7424ed2e9d dotjs/unisubs.sifterapp.com.js --- a/dotjs/unisubs.sifterapp.com.js Wed Mar 28 10:18:06 2012 -0400 +++ b/dotjs/unisubs.sifterapp.com.js Fri Mar 30 11:08:33 2012 -0400 @@ -1,3 +1,98 @@ +/* + * jQuery Hotkeys Plugin + * Copyright 2010, John Resig + * Dual licensed under the MIT or GPL Version 2 licenses. + * + * Based upon the plugin by Tzury Bar Yochay: + * http://github.com/tzuryby/hotkeys + * + * Original idea by: + * Binny V A, http://www.openjs.com/scripts/events/keyboard_shortcuts/ +*/ +(function(jQuery){ + jQuery.hotkeys = { + version: "0.8", + + specialKeys: { + 8: "backspace", 9: "tab", 13: "return", 16: "shift", 17: "ctrl", 18: "alt", 19: "pause", + 20: "capslock", 27: "esc", 32: "space", 33: "pageup", 34: "pagedown", 35: "end", 36: "home", + 37: "left", 38: "up", 39: "right", 40: "down", 45: "insert", 46: "del", + 96: "0", 97: "1", 98: "2", 99: "3", 100: "4", 101: "5", 102: "6", 103: "7", + 104: "8", 105: "9", 106: "*", 107: "+", 109: "-", 110: ".", 111 : "/", + 112: "f1", 113: "f2", 114: "f3", 115: "f4", 116: "f5", 117: "f6", 118: "f7", 119: "f8", + 120: "f9", 121: "f10", 122: "f11", 123: "f12", 144: "numlock", 145: "scroll", 191: "/", 224: "meta" + }, + + shiftNums: { + "`": "~", "1": "!", "2": "@", "3": "#", "4": "$", "5": "%", "6": "^", "7": "&", + "8": "*", "9": "(", "0": ")", "-": "_", "=": "+", ";": ": ", "'": "\"", ",": "<", + ".": ">", "/": "?", "\\": "|" + } + }; + function keyHandler( handleObj ) { + // Only care when a possible input has been specified + if ( typeof handleObj.data !== "string" ) { + return; + } + + var origHandler = handleObj.handler, + keys = handleObj.data.toLowerCase().split(" "); + + handleObj.handler = function( event ) { + // Don't fire in text-accepting inputs that we didn't directly bind to + if ( this !== event.target && (/textarea|select/i.test( event.target.nodeName ) || + event.target.type === "text") ) { + return; + } + + // Keypress represents characters, not special keys + var special = event.type !== "keypress" && jQuery.hotkeys.specialKeys[ event.which ], + character = String.fromCharCode( event.which ).toLowerCase(), + key, modif = "", possible = {}; + + // check combinations (alt|ctrl|shift+anything) + if ( event.altKey && special !== "alt" ) { + modif += "alt+"; + } + + if ( event.ctrlKey && special !== "ctrl" ) { + modif += "ctrl+"; + } + + // TODO: Need to make sure this works consistently across platforms + if ( event.metaKey && !event.ctrlKey && special !== "meta" ) { + modif += "meta+"; + } + + if ( event.shiftKey && special !== "shift" ) { + modif += "shift+"; + } + + if ( special ) { + possible[ modif + special ] = true; + + } else { + possible[ modif + character ] = true; + possible[ modif + jQuery.hotkeys.shiftNums[ character ] ] = true; + + // "$" can be triggered as "Shift+4" or "Shift+$" or just "$" + if ( modif === "shift+" ) { + possible[ jQuery.hotkeys.shiftNums[ character ] ] = true; + } + } + + for ( var i = 0, l = keys.length; i < l; i++ ) { + if ( possible[ keys[i] ] ) { + return origHandler.apply( this, arguments ); + } + } + }; + } + jQuery.each([ "keydown", "keyup", "keypress" ], function() { + jQuery.event.special[ this ] = { add: keyHandler }; + }); +})($); + $(function() { $('ul.state li.priority').each(function(idx, el) { $(el).closest('.issue').find('h2').append( @@ -6,25 +101,38 @@ $(el).remove(); }); - $('body').keydown(function(e) { + $tickets = $('tr.issue td.subject a'); + + if ($tickets.length) { + for (var i=0; i < 9; i++) { + var $t = $tickets.eq(i); - $tickets = $('tr.issue td.subject a'); + $t.prepend('' + (i + 1) + ''); + $t.css('position', 'relative'); + $('span.keyshortcut', $t) + .css('position', 'absolute') + .css('color', '#D3DEE7') + .css('left', '-90px') + .css('font-weight', 'bold') + .css('top', '-1px') + } - cmds = { - '49': function() { - document.location = $tickets.eq(0).attr('href'); - }, - '50': function() { - document.location = $tickets.eq(1).attr('href'); - }, - '51': function() { - document.location = $tickets.eq(2).attr('href'); - } + $d = $(document); + + $d.bind('keydown', '1', function(e) { go(e); }); + $d.bind('keydown', '2', function(e) { go(e); }); + $d.bind('keydown', '3', function(e) { go(e); }); + $d.bind('keydown', '4', function(e) { go(e); }); + $d.bind('keydown', '5', function(e) { go(e); }); + $d.bind('keydown', '6', function(e) { go(e); }); + $d.bind('keydown', '7', function(e) { go(e); }); + $d.bind('keydown', '8', function(e) { go(e); }); + $d.bind('keydown', '9', function(e) { go(e); }); + + var go = function(e) { + var num = parseInt(e.data, 0) - 1; + document.location = $tickets.eq(num).attr('href'); }; - - if (typeof cmds[e.keyCode] === 'function') { - cmds[e.keyCode](); - } - }); + } }); diff -r 2b78b064b415 -r cd7424ed2e9d keyremap4macbook/private.xml --- a/keyremap4macbook/private.xml Wed Mar 28 10:18:06 2012 -0400 +++ b/keyremap4macbook/private.xml Fri Mar 30 11:08:33 2012 -0400 @@ -18,11 +18,23 @@ private.shifts_to_parens + --KeyOverlaidModifier-- KeyCode::SHIFT_R, ModifierFlag::SHIFT_R | ModifierFlag::NONE, KeyCode::SHIFT_R, KeyCode::KEY_0, ModifierFlag::SHIFT_L - --KeyOverlaidModifier-- KeyCode::SHIFT_L, ModifierFlag::SHIFT_L | ModifierFlag::NONE, KeyCode::SHIFT_L, KeyCode::KEY_9, ModifierFlag::SHIFT_R + --KeyOverlaidModifier-- KeyCode::SHIFT_L, ModifierFlag::SHIFT_L | ModifierFlag::NONE, KeyCode::SHIFT_L, KeyCode::KEY_9, ModifierFlag::SHIFT_R + --KeyToKey-- KeyCode::SHIFT_L, ModifierFlag::SHIFT_R, KeyCode::KEY_0, ModifierFlag::SHIFT_L, KeyCode::KEY_9, ModifierFlag::SHIFT_L --KeyToKey-- KeyCode::SHIFT_R, ModifierFlag::SHIFT_L, KeyCode::KEY_9, ModifierFlag::SHIFT_L, KeyCode::KEY_0, ModifierFlag::SHIFT_L + + + --KeyToKey-- KeyCode::SPACE, ModifierFlag::SHIFT_R, KeyCode::KEY_0, ModifierFlag::SHIFT_L, KeyCode::SPACE diff -r 2b78b064b415 -r cd7424ed2e9d vim/.vimrc --- a/vim/.vimrc Wed Mar 28 10:18:06 2012 -0400 +++ b/vim/.vimrc Fri Mar 30 11:08:33 2012 -0400 @@ -494,9 +494,6 @@ " cursor happens to be. nnoremap zO zCzO -" Use ,z to "focus" the current fold. -nnoremap z zMzvzz - function! MyFoldText() " {{{ let line = getline(v:foldstart) @@ -679,6 +676,8 @@ " }}} " HTML and HTMLDjango {{{ +let g:html_indent_tags = ['p', 'li'] + augroup ft_html au! @@ -1102,31 +1101,6 @@ let g:pymode_rope_always_show_complete_menu = 0 " }}} -" Rainbox Parentheses {{{ - -nnoremap R :RainbowParenthesesToggle -let g:rbpt_colorpairs = [ - \ ['brown', 'RoyalBlue3'], - \ ['Darkblue', 'SeaGreen3'], - \ ['darkgray', 'DarkOrchid3'], - \ ['darkgreen', 'firebrick3'], - \ ['darkcyan', 'RoyalBlue3'], - \ ['darkred', 'SeaGreen3'], - \ ['darkmagenta', 'DarkOrchid3'], - \ ['brown', 'firebrick3'], - \ ['gray', 'RoyalBlue3'], - \ ['black', 'SeaGreen3'], - \ ['darkmagenta', 'DarkOrchid3'], - \ ['Darkblue', 'firebrick3'], - \ ['darkgreen', 'RoyalBlue3'], - \ ['darkcyan', 'SeaGreen3'], - \ ['darkred', 'DarkOrchid3'], - \ ['red', 'firebrick3'], - \ ] -let g:rbpt_max = 16 - - -" }}} " Scratch {{{ command! ScratchToggle call ScratchToggle() diff -r 2b78b064b415 -r cd7424ed2e9d vim/after/indent/html.vim --- a/vim/after/indent/html.vim Wed Mar 28 10:18:06 2012 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,3 +0,0 @@ -let g:html_indent_tags .= '\|p' -let g:html_indent_tags .= '\|li' - diff -r 2b78b064b415 -r cd7424ed2e9d vim/after/syntax/python.vim --- a/vim/after/syntax/python.vim Wed Mar 28 10:18:06 2012 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,4 +0,0 @@ -RainbowParenthesesLoadSquare -RainbowParenthesesLoadBraces -RainbowParenthesesLoadRound - diff -r 2b78b064b415 -r cd7424ed2e9d vim/bundle/django-custom/syntax/django.vim --- a/vim/bundle/django-custom/syntax/django.vim Wed Mar 28 10:18:06 2012 -0400 +++ b/vim/bundle/django-custom/syntax/django.vim Fri Mar 30 11:08:33 2012 -0400 @@ -94,5 +94,3 @@ endif let b:current_syntax = "django" - -source $HOME/.vim/bundle/html5/syntax/html/html5.vim diff -r 2b78b064b415 -r cd7424ed2e9d vim/plugin/autoclose.vim --- a/vim/plugin/autoclose.vim Wed Mar 28 10:18:06 2012 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,238 +0,0 @@ -" File: autoclose.vim -" Author: Karl Guertin -" Version: 1.2 -" Last Modified: June 18, 2009 -" Description: AutoClose, closes what's opened. -" -" This plugin closes opened parenthesis, braces, brackets, quotes as you -" type them. As of 1.1, if you type the open brace twice ({{), the closing -" brace will be pushed down to a new line. -" -" You can enable or disable this plugin by typing \a (or a if you -" changed your Leader char). You can define your own mapping and will need -" to do so if you have something else mapped to \a since this plugin won't -" clobber your mapping. Here's how to map \x: -" -" nmap x ToggleAutoCloseMappings -" -" You'll also probably want to know you can type ( if mswin is -" set) and the next character you type doesn't have mappings applied. This -" is useful when you want to insert only an opening paren or something. -" -" NOTE: If you're using this on a terminal and your arrow keys are broken, -" be sure to :set ttimeout and :set ttimeoutlen=100 -" -" Version Changes: --------------------------------------------------{{{2 -" 1.2 -- Fixed some edge cases where double the closing characters are -" entered when exiting insert mode. -" Finally (!) reproduced the arrow keys problem other people were -" running into and fixed. -" Typing a closing character will now behave consistently (jump -" out) regardless of the plugin's internal state. -" -" As a part of the close fix, I've opted to not try tracking the -" position of the closing characters through all the things that -" could be done with them, so arrowing/jumping around and not -" winding up back where you started will cause the input to not be -" repeatable. -" June 18, 2009 -" 1.1.2 -- Fixed a mapping typo and caught a double brace problem, -" September 20, 2007 -" 1.1.1 -- Missed a bug in 1.1, September 19, 2007 -" 1.1 -- When not inserting at the end, previous version would eat chars -" at end of line, added double open->newline, September 19, 2007 -" 1.0.1 -- Cruft from other parts of the mapping, knew I shouldn't have -" released the first as 1.0, April 3, 2007 - -" Setup -----------------------------------------------------{{{2 -if exists('g:autoclose_loaded') || &cp - finish -endif - - -let g:autoclose_loaded = 1 -let s:cotstate = &completeopt - -if !exists('g:autoclose_on') - let g:autoclose_on = 1 -endif - -" (Toggle) Mappings -----------------------------{{{1 -" -nmap ToggleAutoCloseMappings :call ToggleAutoCloseMappings() -if (!hasmapto( 'ToggleAutoCloseMappings', 'n' )) - nmap a ToggleAutoCloseMappings -endif -fun ToggleAutoCloseMappings() " --- {{{2 - if g:autoclose_on - iunmap " - iunmap ' - iunmap ( - iunmap ) - iunmap [ - iunmap ] - iunmap { - iunmap } - iunmap - iunmap - let g:autoclose_on = 0 - echo "AutoClose Off" - else - inoremap " =QuoteDelim('"') - inoremap ' =match(getline('.')[col('.') - 2],'\w') == 0 && getline('.')[col('.')-1] != "'" ? "'" : QuoteDelim("'") - inoremap ( (=CloseStackPush(')') - inoremap ) =CloseStackPop(')') - inoremap [ [=CloseStackPush(']') - inoremap ] =CloseStackPop(']') - "inoremap { {=CloseStackPush('}') - inoremap { =OpenSpecial('{','}') - inoremap } =CloseStackPop('}') - inoremap =OpenCloseBackspace() - inoremap =OpenCloseBackspace() - "the following simply creates an ambiguous mapping so vim fully - "processes the escape sequence for terminal keys, see 'ttimeout' for a - "rough explanation, this just forces it to work - if &term[:4] == "xterm" - inoremap OC - endif - let g:autoclose_on = 1 - if a:0 == 0 - "this if is so this message doesn't show up at load - echo "AutoClose On" - endif - endif -endf -let s:closeStack = [] - -" AutoClose Utilities -----------------------------------------{{{1 -function OpenSpecial(ochar,cchar) " ---{{{2 - let line = getline('.') - let col = col('.') - 2 - "echom string(col).':'.line[:(col)].'|'.line[(col+1):] - if a:ochar == line[(col)] && a:cchar == line[(col+1)] "&& strlen(line) - (col) == 2 - "echom string(s:closeStack) - while len(s:closeStack) > 0 - call remove(s:closeStack, 0) - endwhile - return "\a\;\".a:cchar."\\"_xk$\"_xa" - endif - return a:ochar.CloseStackPush(a:cchar) -endfunction - -function CloseStackPush(char) " ---{{{2 - "echom "push" - let line = getline('.') - let col = col('.')-2 - if (col) < 0 - call setline('.',a:char.line) - else - "echom string(col).':'.line[:(col)].'|'.line[(col+1):] - call setline('.',line[:(col)].a:char.line[(col+1):]) - endif - call insert(s:closeStack, a:char) - "echom join(s:closeStack,'').' -- '.a:char - return '' -endf - -function JumpOut(char) " ----------{{{2 - let column = col('.') - 1 - let line = getline('.') - let mcol = match(line[column :], a:char) - if a:char != '' && mcol >= 0 - "Yeah, this is ugly but vim actually requires each to be special - "cased to avoid screen flashes/not doing the right thing. - echom len(line).' '.(column+mcol) - if line[column] == a:char - return "\" - elseif column+mcol == len(line)-1 - return "\A" - else - return "\f".a:char."\" - endif - else - return a:char - endif -endf -function CloseStackPop(char) " ---{{{2 - "echom "pop" - if(a:char == '') - pclose - endif - if len(s:closeStack) == 0 - return JumpOut(a:char) - endif - let column = col('.') - 1 - let line = getline('.') - let popped = '' - let lastpop = '' - "echom join(s:closeStack,'').' || '.lastpop - while len(s:closeStack) > 0 && ((lastpop == '' && popped == '') || lastpop != a:char) - let lastpop = remove(s:closeStack,0) - let popped .= lastpop - "echom join(s:closeStack,'').' || '.lastpop.' || '.popped - endwhile - "echom ' --> '.popped - if line[column : column+strlen(popped)-1] != popped - return JumpOut('') - endif - if column > 0 - call setline('.',line[:column-1].line[(column+strlen(popped)):]) - else - call setline('.','') - endif - return popped -endf - -function QuoteDelim(char) " ---{{{2 - let line = getline('.') - let col = col('.') - if line[col - 2] == "\\" - "Inserting a quoted quotation mark into the string - return a:char - elseif line[col - 1] == a:char - "Escaping out of the string - return "\=".s:SID()."CloseStackPop(\"\\".a:char."\")\" - else - "Starting a string - return a:char."\=".s:SID()."CloseStackPush(\"\\".a:char."\")\" - endif -endf - -" The strings returned from QuoteDelim aren't in scope for , so I -" have to fake it using this function (from the Vim help, but tweaked) -function s:SID() - return matchstr(expand(''), '\d\+_\zeSID$') -endfun - -function OpenCloseBackspace() " ---{{{2 - "if pumvisible() - " pclose - " call StopOmni() - " return "\" - "else - let curline = getline('.') - let curpos = col('.') - let curletter = curline[curpos-1] - let prevletter = curline[curpos-2] - if (prevletter == '"' && curletter == '"') || -\ (prevletter == "'" && curletter == "'") || -\ (prevletter == "(" && curletter == ")") || -\ (prevletter == "{" && curletter == "}") || -\ (prevletter == "[" && curletter == "]") - if len(s:closeStack) > 0 - call remove(s:closeStack,0) - endif - return "\\" - else - return "\" - endif - "endif -endf - -" Initialization ----------------------------------------{{{1 -if g:autoclose_on - let g:autoclose_on = 0 - silent call ToggleAutoCloseMappings() -endif -" vim: set ft=vim ff=unix et sw=4 ts=4 : -" vim600: set foldmethod=marker foldmarker={{{,}}} foldlevel=1 :