Skip to content

Instantly share code, notes, and snippets.

@tecfu
Last active July 23, 2023 05:55
Show Gist options
  • Save tecfu/87e5ce07e5c54cfbeed2198fe4f235af to your computer and use it in GitHub Desktop.
Save tecfu/87e5ce07e5c54cfbeed2198fe4f235af to your computer and use it in GitHub Desktop.
Surfingkeys Configuration
const {
aceVimMap,
mapkey,
imap,
imapkey,
getClickableElements,
vmapkey,
map,
unmap,
cmap,
addSearchAlias,
removeSearchAlias,
tabOpenLink,
readText,
Clipboard,
Front,
Hints,
Visual,
RUNTIME
} = api;
// unmap space
api.unmap('<Space>');
// api.mapkey('<Space>;', 'Show me the money', function() {
// // Front.showPopup('a well-known phrase uttered by characters in the 1996 film Jerry Maguire (Escape to close).');
// });
const hintsCss = "font: 16px 'MesloLGS NF', sans, monospace; border: solid 1px #8c7001; color:#FFF; padding: 1px 3px; background: initial; background-color: #FF0000;";
Hints.style(hintsCss);
Hints.style(hintsCss, 'text');
Visual.style('marks', 'background-color: #52C19699;');
Visual.style('cursor', 'background-color: #81A2BE;');
// tab right
api.map('K', 'R');
// tab left
api.map('J', 'E');
// go back in history
api.unmap('H');
api.map('H', 'S');
// go forward in history
api.unmap('L');
api.map('L', 'D');
// simplify search
api.map('o', 'og');
// fist tab
api.map('<Space>a', 'g0');
// last tab
api.map('<Space>;', 'g$');
// should work but doesn't
//aceVimMap('<Space>a', '^', 'normal');
//aceVimMap('<Space>;', '$', 'normal');
//onAceVimKeymapInit(function(dk) {
// dk.unshift(
// {
// keys: '<Space>a',
// type: 'motion',
// motion: 'moveToEol',
// motionArgs: {},
// context: 'normal'
// }
// );
//});
// scroll speed
settings.scrollStepSize = 500;
solarizedDark = `
.sk_theme {
background: #100a14dd;
color: #4f97d7;
}
.sk_theme tbody {
color: #292d;
}
.sk_theme input {
color: #d9dce0;
}
.sk_theme .url {
color: #2d9574;
}
.sk_theme .annotation {
color: #a31db1;
}
.sk_theme .omnibar_highlight {
color: #333;
background: #ffff00aa;
}
.sk_theme #sk_omnibarSearchResult ul li:nth-child(odd) {
background: #5d4d7a55;
}
.sk_theme #sk_omnibarSearchResult ul li.focused {
background: #5d4d7aaa;
}
.sk_theme #sk_omnibarSearchResult .omnibar_folder {
color: #a31db1;
}
`;
zenbonse = `
.sk_theme {
font-family: SauceCodePro Nerd Font, Consolas, Menlo, monospace;
font-size: 10pt;
background: #f0edec;
color: #2c363c;
}
.sk_theme tbody {
color: #f0edec;
}
.sk_theme input {
color: #2c363c;
}
.sk_theme .url {
color: #1d5573;
}
.sk_theme .annotation {
color: #2c363c;
}
.sk_theme .omnibar_highlight {
color: #88507d;
}
.sk_theme #sk_omnibarSearchResult ul li:nth-child(odd) {
background: #f0edec;
}
.sk_theme #sk_omnibarSearchResult ul li.focused {
background: #cbd9e3;
}
#sk_status,
#sk_find {
font-size: 10pt;
}
`;
settings.theme = `
@media (prefers-color-scheme: dark) {
${solarizedDark}
}
@media (prefers-color-scheme: light) {
${zenbonse}
}
}
`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment