Skip to content

Instantly share code, notes, and snippets.

@anka-213
Forked from karlredman/surfingkeys.js
Created June 15, 2017 18:39
Show Gist options
  • Save anka-213/07c73884cd0b1773413459a831e89f8a to your computer and use it in GitHub Desktop.
Save anka-213/07c73884cd0b1773413459a831e89f8a to your computer and use it in GitHub Desktop.
my surfingkeys.js (google chrome surfingkeys extension configuration)
// an example to create a new mapping `ctrl-y`
/*
mapkey('<Ctrl-y>', 'Show me the money', function() {
Front.showPopup('a well-known phrase uttered by characters in the 1996 film Jerry Maguire (Escape to close).');
});
*/
// an example to replace `u` with `?`, click `Default mappings` to see how `u` works.
map('?', 'u');
// an example to remove mapkey `Ctrl-i`
//unmap('<Ctrl-i>');
// click `Save` button to make above settings to take effect.
// set theme
settings.theme = `
.sk_theme {
background: #000;
color: #fff;
}
.sk_theme tbody {
color: #000;
}
.sk_theme input {
color: #317ef3;
}
.sk_theme .url {
color: #38f;
}
.sk_theme .annotation {
color: #38f;
}
.sk_theme .focused {;f
background: #aaa;
}`;
//##############################################
//my key mapings -to better match qutebrowser and dwb browsers
//----------------------------------------------
//added: move tab to the right
map('gr', '<<');
//added: move tab to the right
map('gl', '>>');
//mapkey('H', '#Go back in history', 'history.go(-1)', {repeatIgnore: true});
//added: go back in history
map('H', 'S');
//mapkey('L', '#Go forward in history', 'history.go(1)', {repeatIgnore: true});
//added: go forward in history
map('L', 'D');
//mapkey('J', '#3Go one tab left', 'RUNTIME("previousTab")');
//added: move tab left
map('J', 'E');
//mapkey('K', '#3Go one tab right', 'RUNTIME("nextTab")');
//added: move tab right
map('K', 'R');
//added: open hint in background tab
map(';r', 'cf');
//added: open a (hint) link in new background tab
map(';f', 'gf');
//added: 'Go one tab history back'
// NOTE: added to be consistant with remapping 'Go one tab history forward'
map(';B', 'B');
//##############################################
// **REMAPS** -Note: order is important
//----------------------------------------------
//added: Duplicate current tab
map(';t','yt');
//remap: copy current page's title
// NOTE: this keybinding overwrites the binding for 'Duplicate current tab'
map('yt','yl');
//remap: restore closed tab
// NOTE: this keybinding overwrites the binding for 'Show usage'
map('u', 'X');
// added: 'Go one tab history forward'
map(';F', 'F');
//remap: open a (hint) link in new tab
// NOTE: this keybinding overwrites the binding for 'Go one tab history forward'
map('F', 'af');
//##############################################
// New Key Mappings
//----------------------------------------------
mapkey(';Q', '#1Click on an Image or button in new tab',
'Hints.create("img, button",Hints.dispatchMouseClick, {tabbed: true})');
mapkey(';q', '#1Click on an Image or button in new non-active tab',
'Hints.create("img, button", Hints.dispatchMouseClick, {tabbed: true, active: false})');Ijkki
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment