1. Steve Losh
  2. dotfiles

Commits

Steve Losh  committed e2adcd8

Moar.

  • Participants
  • Parent commits 103f13a
  • Branches default

Comments (0)

Files changed (11)

File dotcss/debuggex.com.css

View file
+h2 { display: none; }
+div.centered-text { display: none; }
+div { display: none; }
+div.topcontainer { display: block; }
+div.topcontainer div { display: block; }
+div.nfa { display: block; }
+div.ui-slider { display: block; }

File dotcss/dpaste.com.css

View file
+pre {
+    font-family: Menlo;
+    font-size: 12px;
+}

File dotcss/gist.github.com.css

View file
+
+.line-data, .file-data pre, .line-number {
+    font-family: Menlo;
+    line-height: 1.4;
+    font-size: 12px;
+}

File dotcss/linkedin.com.css

View file
+#network-stat-widget,
+#jobsForYou,
+#groupsForYou,
+#companiesForYou,
+#pymk,
+#today-news-wrapper,
+.guided-setup
+{
+    display: none;
+}
+
+.member-photo, .feed-photo {
+    margin-left: 10px !important;
+    border: 1px solid black !important;
+}

File dotcss/unisubs.sifterapp.com.css

View file
     padding: 8px 8px 6px 0px !important;
 }
 tr.issue td.subject span.assignee {
-    display: none;
+    /* display: none; */
 }
 tr.issue td {
     border-bottom: 1px solid #eee !important;

File dotcss/weather.com.css

View file
+// First grab Stylebot: https://chrome.google.com/webstore/detail/stylebot/oiaejidbmkiecgbjeifoejpgmdaleoha?hl=en
+
+#wx-breaking-now {
+    display: none;
+}
+
+#wx-wrapper {
+    border-style: none;
+}
+
+#wx-rail {
+    display: none;
+}
+
+div.wx-inner {
+    display: none;
+}
+
+div.wx-module.wx-gptADS {
+    display: none;
+}
+
+div.wx-next a {
+    display: none;
+}
+
+div.wx-nav-arrow.wx-k-lg-rt {
+    display: none;
+}
+
+div.wx-content {
+    display: none;
+}
+
+div.wx-social-share-ls-wrapper ul {
+    display: none;
+}
+
+div.wx-search form input {
+    display: none;
+}
+
+div.wx-searchButton {
+    display: none;
+}
+
+div.wx-search {
+    display: none;
+}
+
+#wx-bottom-inner {
+    height: 400px;
+}
+
+dl.wx-1 {
+    display: none;
+}
+
+dl.wx-2 {
+    display: none;
+}
+
+dl.wx-3 {
+    display: none;
+}
+
+dl.wx-4 {
+    display: none;
+}
+
+ul.wx-social {
+    display: none;
+}
+
+div.wx-legal {
+    display: none;
+}
+
+#wx-Strip {
+    display: none;
+}
+
+#wx-header-tools {
+    display: none;
+}
+
+div.wx-desktop-weather-btn a {
+    display: none;
+}
+
+div.wx-desktop-weather-bg {
+    display: none;
+}
+
+span.wx-icon.wx-desktop-weather {
+    display: none;
+}
+
+li.twc-weather-edit-location {
+    display: none;
+}
+
+div.wx-grid6of6 {
+    height: 0;
+    margin-bottom: 0;
+    padding-bottom: 0;
+}
+
+#wx-inner-rail {
+    clear: left;
+}
+
+div.fby-tab.fby-tab-r a {
+    display: none;
+}
+
+div.fby-tab.fby-tab-r {
+    display: none;
+}
+
+div.wx-prev a {
+    display: none;
+}
+
+div.wx-nav-arrow.wx-k-lg-lt {
+    display: none;
+}
+
+div.wx-free-title h3 {
+    display: none;
+}
+
+a.wx-icon.wx-cond.wx-phone {
+    display: none;
+}
+
+a.wx-icon.wx-cond.wx-desktop {
+    display: none;
+}
+
+a.wx-icon.wx-cond.wx-tablet {
+    display: none;
+}
+
+div.wx-social-share-bar {
+    display: none;
+}
+
+div.wx-lifestyles div {
+    display: none;
+}
+
+#fsr_modalOverlay {
+    display: none;
+}
+
+div.fsrwin {
+    display: none;
+}
+
+div.wx-24hour.wx-module.wx-grid3of6.wx-weather {
+    margin-left: 0;
+    padding-left: 0;
+}
+
+div#wx-footer {
+    border-top: 0;
+}
+
+div#wx-top-wrap {
+    width: 660px;
+}
+
+div#wx-main {
+    float: none;
+    margin: 0 auto;
+}
+
+div.trc_rbox_outer {
+    display: none;
+}
+
+div.trc_rbox_header.trc_rbox_border_elm {
+    display: none;
+}
+
+div.trc_rbox_container div {
+    display: none;
+}
+
+div.wx-map {
+    margin-left: 165px;
+}
+
+div#wx-forecast-container div.wx-map {
+    margin-left: 0;
+}
+
+.wx-grid6of6 {
+    width: auto;
+}
+
+div.wx-corsican {
+    display: none;
+}
+
+div.wx-module.wx-featured.wx-wwir-module.wx-cond-bg {
+    display: none;
+}

File dotjs/unisubs.sifterapp.com.js

View file
-/*
- * 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(
-            '<span class="new-priority">' + $(el).text() + '</span>'
-        );
+            '<span class="new-priority">' + $(el).text() + '</span>');
         $(el).remove();
     });
 
-    $tickets = $('tr.issue td.subject a');
-
-    if ($tickets.length) {
-        for (var i=0; i < 9; i++) {
-            var $t = $tickets.eq(i);
-
-            $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');
-        };
-    }
-
     $('div.comment').each(function (idx, el) {
         var id = $(el).attr('id');
         var link = '<a href="#' + id + '">permalink</a>';

File fish/config.fish

View file
 function eg; vim ~/.gitconfig; end
 function es; vim ~/.slate; end
 
+function fixopenwith
+    /System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -kill -r -domain local -domain system -domain user
+end
+
 function ss; bcvi --wrap-ssh -- $argv; end
 function bcvid; dtach -A /tmp/bcvi.socket bcvi --listener; end
 
 
 function weechat; weechat-curses $argv; end
 
-function collapse; "sed -e 's/  */ /g'"; end
-function cuts; "cut -d' '"; end
+function collapse; sed -e 's/  */ /g'; end
+function cuts; cut -d' '; end
 
 function v; vim $argv; end
 function V; vim . $argv; end

File mutt/muttrc

View file
 macro pager \Cu "|urlview<enter>" "call urlview to open links"
 macro pager s "<pipe-message>cat > ~/Desktop/"  "save message as"
 
+# Quickly change mailboxes
+macro pager \' "<exit><change-folder>+steve-stevelosh.com/INBOX<enter>"   "go to stevelosh/INBOX"
+macro pager \" "<exit><change-folder>+steve-stevelosh.com/archive<enter>" "go to stevelosh/archive"
+
 # }}}
 # Compose {{{
 

File pentadactylrc

View file
 
 " Shut up.
 javascript dactyl.beep = function() { return false; }
+
+" Okay DDG let's see if I can stand you.
+" nope set defsearch=duckduckgo
+
+" Train myself to use t instead of cmd-t
+nmap -builtin <m-t> <nop>

File vim/vimrc

View file
 function! MakeSpacelessIabbrev(from, to)
     execute "iabbrev <silent> ".a:from." ".a:to."<C-R>=EatChar('\\s')<CR>"
 endfunction
+function! MakeSpacelessBufferIabbrev(from, to)
+    execute "iabbrev <silent> <buffer> ".a:from." ".a:to."<C-R>=EatChar('\\s')<CR>"
+endfunction
 
 call MakeSpacelessIabbrev('sl/',  'http://stevelosh.com/')
 call MakeSpacelessIabbrev('bb/',  'http://bitbucket.org/')
 " Don't move on *
 nnoremap * *<c-o>
 
-" Use c-\ to do c-] but open it in a new split.
-nnoremap <c-\> <c-w>v<c-]>zvzz
+" Jumping to tags.
+"
+" Basically, <c-]> jumps to tags (like normal) and <c-\> opens the tag in a new
+" split instead.
+"
+" Both of them will align the destination line to the upper middle part of the
+" screen.  Both will pulse the cursor line so you can see where the hell you
+" are.  <c-\> will also fold everything in the buffer and then unfold just
+" enough for you to see the destination line.
+nnoremap <c-]> <c-]>mzzvzz15<c-e>`z:Pulse<cr>
+nnoremap <c-\> <c-w>v<c-]>mzzMzvzz15<c-e>`z:Pulse<cr>
 
 " Keep search matches in the middle of the window.
 nnoremap n nzzzv
 
     au FileType javascript setlocal foldmethod=marker
     au FileType javascript setlocal foldmarker={,}
+    au FileType javascript call MakeSpacelessBufferIabbrev('clog', 'console.log();<left><left>')
 
     " Make {<cr> insert a pair of brackets in such a way that the cursor is correctly
     " positioned inside of them AND the following code doesn't get unfolded.
 augroup END
 
 " }}}
+" Lilypond {{{
+
+augroup ft_lilypond
+    au!
+
+    au FileType lilypond setlocal foldmethod=marker foldmarker={,}
+augroup END
+
+" }}}
 " Lisp {{{
 
 augroup ft_lisp
 let NERDTreeHighlightCursorline = 1
 let NERDTreeIgnore = ['.vim$', '\~$', '.*\.pyc$', 'pip-log\.txt$', 'whoosh_index',
                     \ 'xapian_index', '.*.pid', 'monitor.py', '.*-fixtures-.*.json',
-                    \ '.*\.o$', 'db.db', 'tags.bak']
+                    \ '.*\.o$', 'db.db', 'tags.bak', '.*\.pdf$', '.*\.mid$',
+                    \ '.*\.midi$']
 
 let NERDTreeMinimalUI = 1
 let NERDTreeDirArrows = 1
 " Motion for "next/last object".  "Last" here means "previous", not "final".
 " Unfortunately the "p" motion was already taken for paragraphs.
 "
-" Next acts on the next object of the given type in the current line, last acts
-" on the previous object of the given type in the current line.
+" Next acts on the next object of the given type, last acts on the previous
+" object of the given type.  These don't necessarily have to be in the current
+" line.
 "
-" Currently only works for (, [, {, b, r, B, ', and ".
+" Currently works for (, [, {, and their shortcuts b, r, B. 
+"
+" Next kind of works for ' and " as long as there are no escaped versions of
+" them in the string (TODO: fix that).  Last is currently broken for quotes
+" (TODO: fix that).
 "
 " Some examples (C marks cursor positions, V means visually selected):
 "
 "                                                      foo = bar
 "                                                               C
 "
-" vil"  -> select inside last double quotes            print "hello ", name
-"                                                                        C
+" vin"  -> select inside next double quotes            print "hello ", name
+"                                                       C
 "                                                      print "hello ", name
 "                                                             VVVVVV
 
-onoremap an :<c-u>call <SID>NextTextObject('a', 'f')<cr>
-xnoremap an :<c-u>call <SID>NextTextObject('a', 'f')<cr>
-onoremap in :<c-u>call <SID>NextTextObject('i', 'f')<cr>
-xnoremap in :<c-u>call <SID>NextTextObject('i', 'f')<cr>
+onoremap an :<c-u>call <SID>NextTextObject('a', '/')<cr>
+xnoremap an :<c-u>call <SID>NextTextObject('a', '/')<cr>
+onoremap in :<c-u>call <SID>NextTextObject('i', '/')<cr>
+xnoremap in :<c-u>call <SID>NextTextObject('i', '/')<cr>
 
-onoremap al :<c-u>call <SID>NextTextObject('a', 'F')<cr>
-xnoremap al :<c-u>call <SID>NextTextObject('a', 'F')<cr>
-onoremap il :<c-u>call <SID>NextTextObject('i', 'F')<cr>
-xnoremap il :<c-u>call <SID>NextTextObject('i', 'F')<cr>
+onoremap al :<c-u>call <SID>NextTextObject('a', '?')<cr>
+xnoremap al :<c-u>call <SID>NextTextObject('a', '?')<cr>
+onoremap il :<c-u>call <SID>NextTextObject('i', '?')<cr>
+xnoremap il :<c-u>call <SID>NextTextObject('i', '?')<cr>
+
 
 function! s:NextTextObject(motion, dir)
-  let c = nr2char(getchar())
+    let c = nr2char(getchar())
+    let d = ''
 
-  if c ==# "b"
-      let c = "("
-  elseif c ==# "B"
-      let c = "{"
-  elseif c ==# "r"
-      let c = "["
-  endif
+    if c ==# "b" || c ==# "(" || c ==# ")"
+        let c = "("
+    elseif c ==# "B" || c ==# "{" || c ==# "}"
+        let c = "{"
+    elseif c ==# "r" || c ==# "[" || c ==# "]"
+        let c = "["
+    elseif c ==# "'"
+        let c = "'"
+    elseif c ==# '"'
+        let c = '"'
+    else
+        return
+    endif
 
-  exe "normal! ".a:dir.c."v".a:motion.c
+    " Find the next opening-whatever.
+    execute "normal! " . a:dir . c . "\<cr>"
+
+    if a:motion ==# 'a'
+        " If we're doing an 'around' method, we just need to select around it
+        " and we can bail out to Vim.
+        execute "normal! va" . c
+    else
+        " Otherwise we're looking at an 'inside' motion.  Unfortunately these
+        " get tricky when you're dealing with an empty set of delimiters because
+        " Vim does the wrong thing when you say vi(.
+
+        let open = ''
+        let close = ''
+
+        if c ==# "(" 
+            let open = "("
+            let close = ")"
+        elseif c ==# "{"
+            let open = "{"
+            let close = "}"
+        elseif c ==# "["
+            let open = "\\["
+            let close = "\\]"
+        elseif c ==# "'"
+            let open = "'"
+            let close = "'"
+        elseif c ==# '"'
+            let open = '"'
+            let close = '"'
+        endif
+
+        " We'll start at the current delimiter.
+        let start_pos = getpos('.')
+        let start_l = start_pos[1]
+        let start_c = start_pos[2]
+
+        " Then we'll find it's matching end delimiter.
+        if c ==# "'" || c ==# '"'
+            " searchpairpos() doesn't work for quotes, because fuck me.
+            let end_pos = searchpos(open)
+        else
+            let end_pos = searchpairpos(open, '', close)
+        endif
+
+        let end_l = end_pos[0]
+        let end_c = end_pos[1]
+
+        call setpos('.', start_pos)
+
+        if start_l == end_l && start_c == (end_c - 1)
+            " We're in an empty set of delimiters.  We'll append an "x"
+            " character and select that so most Vim commands will do something
+            " sane.  v is gonna be weird, and so is y.  Oh well.
+            execute "normal! ax\<esc>\<left>"
+            execute "normal! vi" . c
+        elseif start_l == end_l && start_c == (end_c - 2)
+            " We're on a set of delimiters that contain a single, non-newline
+            " character.  We can just select that and we're done.
+            execute "normal! vi" . c
+        else
+            " Otherwise these delimiters contain something.  But we're still not
+            " sure Vim's gonna work, because if they contain nothing but
+            " newlines Vim still does the wrong thing.  So we'll manually select
+            " the guts ourselves.
+            let whichwrap = &whichwrap
+            set whichwrap+=h,l
+
+            execute "normal! va" . c . "hol"
+
+            let &whichwrap = whichwrap
+        endif
+    endif
 endfunction
 
 " }}}