Skip to content

Instantly share code, notes, and snippets.

@urob
Last active December 4, 2023 20:55
Show Gist options
  • Save urob/83097f9516f89112f3c55fbf1b18711a to your computer and use it in GitHub Desktop.
Save urob/83097f9516f89112f3c55fbf1b18711a to your computer and use it in GitHub Desktop.
Surfingkeys configuration
// make hjkl usable with Colemak, make sure to order target before remap
api.map(',', 'k'); // up
api.map('k', 'h'); // left
api.map('h', 'j'); // down
api.map('.', 'l'); // right
// prev/next tab
api.map('q', 'E');
api.map('w', 'R');
// back/forward in history
api.map('Q', 'S');
// api.map('W', 'D');
// open link hint in new inactive tab
api.map('F', 'gf');
// go to previous tab
api.map('e', '<Ctrl-6>');
// only keep select shortcuts for gmail.com and twitter
api.unmapAllExcept(['b','f','F','h',',','t','<Ctrl-h>','<Ctrl-,>','T','X'], /mail.google.com|twitter.com/);
// use hint characters that are useful with colemak
api.Hints.setCharacters('rastneiodhuwyp');
// anchor link hints at the left instead of center
settings.hintAlign = "left";
// ---- Search Engines -----
api.removeSearchAlias('b', 's'); // baidu
api.removeSearchAlias('d', 's'); // duckduckgo
api.removeSearchAlias('e', 's'); // wikipedia
// api.removeSearchAlias('g', 's'); // google
api.removeSearchAlias('h', 's'); // github
api.removeSearchAlias('w', 's'); // bing
api.removeSearchAlias('y', 's'); // youtube
api.removeSearchAlias('s', 's'); // stackoverflow
api.addSearchAlias('a', 'amazon', 'https://www.amazon.com/s?k=', 's');
api.addSearchAlias('gh', 'github', 'https://github.com/search?q=', 's');
api.addSearchAlias('r', 'reddit', 'https://www.reddit.com/search?sort=relevance&t=all&q=', 's');
api.addSearchAlias('w', 'wikipedia', 'https://en.wikipedia.org/w/index.php?search=', 's');
// ---- Set Theme -----
settings.theme = `
.sk_theme {
font-family: Input Sans Condensed, Charcoal, sans-serif;
font-size: 10pt;
background: #282828;
color: #ebdbb2;
}
.sk_theme tbody {
color: #b8bb26;
}
.sk_theme input {
color: #d9dce0;
}
.sk_theme .url {
color: #98971a;
}
.sk_theme .annotation {
color: #b16286;
}
.sk_theme .omnibar_highlight {
color: #ebdbb2;
}
.sk_theme #sk_omnibarSearchResult ul li:nth-child(odd) {
background: #282828;
}
.sk_theme #sk_omnibarSearchResult ul li.focused {
background: #d3869b;
}
#sk_status, #sk_find {
font-size: 20pt;
}`;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment