Created
February 18, 2015 20:00
-
-
Save wosc/1104017f149a55128003 to your computer and use it in GitHub Desktop.
Greasmonkey User Script for Slack: Restore Readline Keybindings
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
// ==UserScript== | |
// @name Slack: Restore Readline Keybindings | |
// @namespace http://wosc.de/ | |
// @version 1.0 | |
// @description Don't let Slack capture keybindings for C-u and C-k (use C-o to open omnibox instead) | |
// @author Wolfgang Schnerring <[email protected]> | |
// @match https://*.slack.com/* | |
// @grant none | |
// ==/UserScript== | |
(function(window) { | |
var $ = window.jQuery; | |
var TS = window.TS; | |
$(document).ready(function() { | |
$('#message-input').on('keydown', function(e) { | |
if (! TS.utility.cmdKey(e)) { | |
return; | |
} | |
if (e.which == 75 || e.which == 85) { | |
e.stopPropagation(); | |
} else if (e.which == 79) { | |
e.preventDefault(); | |
TS.ui.omnibox.start(); | |
} | |
}); | |
}); | |
})(window); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment