Permalink
Browse files

Moar.

  • Loading branch information...
sjl committed Mar 30, 2012
1 parent fb71ab9 commit d9586c535f45b71179252b7fa7af59ac9eee10a4
View
2 .hgsub
@@ -23,11 +23,11 @@ vim/bundle/linediff = [git]git://github.com/AndrewRadev/linediff.vim.git
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
View
@@ -15,8 +15,8 @@ fdc0f091c78cd9a474ac3e3cf40ba7d6933ef9da vim/bundle/markdown
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
View
@@ -1,40 +1,44 @@
$(function() {
- $('.site').prepend('<button id="toggle-merges-button">Review</button>');
- $('#toggle-merges-button').css('position', 'absolute').css('top', '10px').css('left', '10px');
+ if ($('body').hasClass('page-commits')) {
- $('#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;
- }
+ $('ul.pagehead-actions').prepend('<li><a class="minibutton btn-watch" href="#" id="toggle-merges-button"><span><span class="icon"></span><span class="text">Review</span></span></a></li>');
+
+ $('#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();
- });
+ }
});
@@ -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 @@ $(function() {
$(el).remove();
});
- $('body').keydown(function(e) {
-
- $tickets = $('tr.issue td.subject a');
+ $tickets = $('tr.issue td.subject a');
- 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');
- }
- };
+ if ($tickets.length) {
+ for (var i=0; i < 9; i++) {
+ var $t = $tickets.eq(i);
- if (typeof cmds[e.keyCode] === 'function') {
- cmds[e.keyCode]();
+ $t.prepend('<span class="keyshortcut">' + (i + 1) + '</span>');
+ $t.css('position', 'relative');
+ $('span.keyshortcut', $t)
+ .css('position', 'absolute')
+ .css('color', '#D3DEE7')
+ .css('left', '-90px')
+ .css('font-weight', 'bold')
+ .css('top', '-1px')
}
- });
+
+ $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');
+ };
+ }
});
@@ -18,11 +18,23 @@
<identifier>private.shifts_to_parens</identifier>
+ <!-- This is the basic mapping. -->
<autogen>--KeyOverlaidModifier-- KeyCode::SHIFT_R, ModifierFlag::SHIFT_R | ModifierFlag::NONE, KeyCode::SHIFT_R, KeyCode::KEY_0, ModifierFlag::SHIFT_L</autogen>
- <autogen>--KeyOverlaidModifier-- KeyCode::SHIFT_L, ModifierFlag::SHIFT_L | ModifierFlag::NONE, KeyCode::SHIFT_L, KeyCode::KEY_9, ModifierFlag::SHIFT_R</autogen>
+ <autogen>--KeyOverlaidModifier-- KeyCode::SHIFT_L, ModifierFlag::SHIFT_L | ModifierFlag::NONE, KeyCode::SHIFT_L, KeyCode::KEY_9, ModifierFlag::SHIFT_R</autogen>
+ <!--
+ Remap the "rolls" of () and )( because it's too easy to hit one
+ before finishing the other, and there's no other reason to be
+ pressing both shift keys at once anyway
+ -->
<autogen>--KeyToKey-- KeyCode::SHIFT_L, ModifierFlag::SHIFT_R, KeyCode::KEY_0, ModifierFlag::SHIFT_L, KeyCode::KEY_9, ModifierFlag::SHIFT_L</autogen>
<autogen>--KeyToKey-- KeyCode::SHIFT_R, ModifierFlag::SHIFT_L, KeyCode::KEY_9, ModifierFlag::SHIFT_L, KeyCode::KEY_0, ModifierFlag::SHIFT_L</autogen>
+
+ <!--
+ Remap Rshift+Space to ') ', because when typing an end paren and
+ then a space I tend to hit space before I let go of rshift.
+ -->
+ <autogen>--KeyToKey-- KeyCode::SPACE, ModifierFlag::SHIFT_R, KeyCode::KEY_0, ModifierFlag::SHIFT_L, KeyCode::SPACE</autogen>
</item>
</list>
View
@@ -494,9 +494,6 @@ vnoremap <Space> za
" cursor happens to be.
nnoremap zO zCzO
-" Use ,z to "focus" the current fold.
-nnoremap <leader>z zMzvzz
-
function! MyFoldText() " {{{
let line = getline(v:foldstart)
@@ -679,6 +676,8 @@ augroup END
" }}}
" HTML and HTMLDjango {{{
+let g:html_indent_tags = ['p', 'li']
+
augroup ft_html
au!
@@ -1101,31 +1100,6 @@ let g:pymode_rope_guess_project = 1
let g:pymode_rope_goto_def_newwin = 0
let g:pymode_rope_always_show_complete_menu = 0
-" }}}
-" Rainbox Parentheses {{{
-
-nnoremap <leader>R :RainbowParenthesesToggle<cr>
-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 {{{
@@ -1,3 +0,0 @@
-let g:html_indent_tags .= '\|p'
-let g:html_indent_tags .= '\|li'
-
@@ -1,4 +0,0 @@
-RainbowParenthesesLoadSquare
-RainbowParenthesesLoadBraces
-RainbowParenthesesLoadRound
-
@@ -94,5 +94,3 @@ if version >= 508 || !exists("did_django_syn_inits")
endif
let b:current_syntax = "django"
-
-source $HOME/.vim/bundle/html5/syntax/html/html5.vim
Oops, something went wrong.

0 comments on commit d9586c5

Please sign in to comment.