Skip to content

Instantly share code, notes, and snippets.

@blacklight
Last active August 29, 2020 23:36
Show Gist options
  • Save blacklight/e346f22e0eadf90be73339802d81974e to your computer and use it in GitHub Desktop.
Save blacklight/e346f22e0eadf90be73339802d81974e to your computer and use it in GitHub Desktop.
surfingkeys
// 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 `T` with `gt`, click `Default mappings` to see how `T` works.
map('gt', 'T');
// an example to remove mapkey `Ctrl-i`
unmap('<Ctrl-i>');
// set theme
settings.theme = `
.sk_theme {
font-family: Input Sans Condensed, Charcoal, sans-serif;
font-size: 10pt;
background: #f4f7fe;
color: #3b323f;
}
.sk_theme tbody {
color: black;
}
.sk_theme input {
color: #303030;
}
.sk_theme .url {
color: #217f7f;
}
.sk_theme .annotation {
color: #265662;
}
.sk_theme .omnibar_highlight {
color: #225bbb;
}
.sk_theme .omnibar_timestamp {
color: #95602b;
}
.sk_theme .omnibar_visitcount {
color: #489359;
}
.sk_theme #sk_omnibarSearchResult ul li:nth-child(even) {
background: white;
}
.sk_theme #sk_omnibarSearchResult ul li:nth-child(odd) {
background: #eeeeee;
}
.sk_theme #sk_omnibarSearchResult ul li.focused {
background: #cef4ff;
}
#sk_status, #sk_find {
font-size: 20pt;
}`;
map("J", "d");
map("K", "e");
map("d", "x");
map("H", "S");
map("L", "D");
map("F", "af");
map("§c", "on");
map("§h", "E");
map("§l", "R");
map("`c", "on");
map("`h", "E");
map("`l", "R");
map("gT", "E");
map("gt", "R");
map("gb", "S");
map("gn", "D");
//Hints.characters = '0123456789';
Hints.numericHints = true;
settings.smoothScroll = false;
settings.omnibarSuggestion = true;
settings.blacklistPattern = /.*mail.google.com.*|.*docs.google.com.*|.*feedly.com.*|.*messenger.com.*|.*mail.protonmail.com.*/i;
// Search engines configuration
searchEngines = [
{
alias: 'a',
text: 'WolframAlpha',
url: 'https://wolframalpha.com/input/?i=',
},
{
alias: 'i',
text: 'DuckDuckGo images',
url: 'https://duckduckgo.com/?iax=images&ia=images&q=',
},
{
alias: 's',
text: 'StackOverflow',
url: 'https://stackoverflow.com/search?q=',
},
{
alias: 't',
text: 'GitHub',
url: 'https://github.com/search?q=',
},
{
alias: 'u',
text: 'UltimateGuitar',
url: 'https://www.ultimate-guitar.com/search.php?search_type=title&value=',
},
{
alias: 'w',
text: 'Wikipedia',
url: 'https://en.wikipedia.org/wiki/Special:Search/',
},
];
removeSearchAlias('b');
for (const engine of searchEngines) {
removeSearchAlias(engine.alias);
addSearchAlias(engine.alias, engine.text, engine.url);
mapkey('o' + engine.alias, '#8Open Search with alias ' + engine.alias, () => {
Front.openOmnibar({type: 'SearchEngine', extra: engine.alias});
});
}
settings.defaultSearchEngine = 'd';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment