Last active
March 30, 2018 01:57
-
-
Save mi-lee/c0bb604f678c10dc143705dc9473c2e1 to your computer and use it in GitHub Desktop.
Bookmarklet: Vim bindings for Piazza [draft]
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// jj: select post below | |
// kk: select post above | |
// checks to see if you're not typing/focused on any element. click outside to activate | |
javascript:var previous; var arrowKey = function(event) { if ($(document.activeElement)[0].tagName === "BODY") { if (event.keyCode == 74 && previous == 74) { $('.feed_item.selected').next().click(); previous = null; } if (event.keyCode == 75 && previous == 75) { $('.feed_item.selected').prev().click(); previous = null; } else { previous = event.keyCode; } } }; $(document).on('keydown', arrowKey); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment