Skip to content

Instantly share code, notes, and snippets.

@wosc
Created February 18, 2015 20:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wosc/1104017f149a55128003 to your computer and use it in GitHub Desktop.
Save wosc/1104017f149a55128003 to your computer and use it in GitHub Desktop.
Greasmonkey User Script for Slack: Restore Readline Keybindings
// ==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 <wosc@wosc.de>
// @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