Last active
October 10, 2024 09:36
-
-
Save pablospe/981db2bf206d82df08a0b61fa4720745 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// navigation - back/fordward | |
api.map("<Alt-a>", "S"); | |
api.unmap('<Alt-s>'); // disable suspend with Atl+s | |
api.map("<Alt-s>", "D"); | |
// remove mapkey alt-i | |
api.unmap('<atl-i>'); | |
// If you would like to use original pdf viewer provided by Chrome itself, use ;s to toggle that. | |
// ;s | |
// https://github.com/brookhong/Surfingkeys/issues/366#issuecomment-1086835589 | |
chrome.storage.local.set({"noPdfViewer": 1}) | |
// navigation - pageup + pagedown | |
api.mapkey("<Ctrl-u>", '#2Scroll a page up', function() { | |
api.Normal.scroll("pageUp"); | |
}, {repeatIgnore: true}); | |
api.mapkey("<Ctrl-d>", '#2Scroll a page up', function() { | |
api.Normal.scroll("pageDown"); | |
}, {repeatIgnore: true}); | |
// left-hand navigation | |
api.unmap('s'); api.map('s',"k"); | |
api.unmap('d'); api.map('d',"j"); | |
// replace default v behavior. I want to select the word after selecting the link hints | |
api.map("v","zv"); | |
// undo close tab | |
api.map("z","X"); | |
// to see history / download | |
api.unmap("<ctrl-h>"); | |
api.unmap("<ctrl-j>"); | |
// api.unmap("<ctrl-w>"); | |
// an example to replace `T` with `gt`, click `Default mappings` to see how `T` works. | |
api.map('gt', 'T'); | |
// an example to remove mapkey `Ctrl-i` | |
api.unmap('<ctrl-i>'); | |
// sm - for google maps | |
api.addSearchAlias('m', 'google', 'https://www.google.com/maps/search/?q=', 's', 'https://www.google.com/maps/search/?q=', function(response) { | |
var res = JSON.parse(response.text); | |
return res[1]; | |
}); | |
// customise theme | |
settings.theme = ` | |
.sk_theme { | |
font-family: Input Sans Condensed, Charcoal, sans-serif; | |
font-size: 10pt; | |
background: #24272e; | |
color: #abb2bf; | |
} | |
.sk_theme tbody { | |
color: #fff; | |
} | |
.sk_theme input { | |
color: #d0d0d0; | |
} | |
.sk_theme .url { | |
color: #61afef; | |
} | |
.sk_theme .annotation { | |
color: #56b6c2; | |
} | |
.sk_theme .omnibar_highlight { | |
color: #528bff; | |
} | |
.sk_theme .omnibar_timestamp { | |
color: #e5c07b; | |
} | |
.sk_theme .omnibar_visitcount { | |
color: #98c379; | |
} | |
.sk_theme #sk_omnibarSearchResult>ul>li:nth-child(odd) { | |
background: #303030; | |
} | |
.sk_theme #sk_omnibarSearchResult>ul>li.focused { | |
background: #3e4452; | |
} | |
.sk_theme .separator { | |
color: white; | |
} | |
#sk_omnibar { | |
width: 50%; | |
left: 25%; | |
} | |
#sk_status, #sk_find { | |
font-size: 16pt; | |
right: auto; | |
} | |
`; | |
// link hints | |
api.Hints.style(` | |
background: initial !important; | |
background-color: #3a5f82 !important; | |
border: solid 3px #3a5f82 !important; | |
color: #fff !important; | |
font-size: 9pt !important; | |
font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Helvetica,Arial, sans-serif !important; | |
letter-spacing: 2px; | |
transition: opacity .2s !important; | |
`); | |
settings.theme= ` | |
:root { | |
--theme-ace-bg:#282828ab; /*Note the fourth channel, this adds transparency*/ | |
--theme-ace-bg-accent:#3c3836; | |
--theme-ace-fg:#ebdbb2; | |
--theme-ace-fg-accent:#7c6f64; | |
--theme-ace-cursor:#928374; | |
--theme-ace-select:#458588; | |
} | |
#sk_editor { | |
height: 50% !important; /*Remove this to restore the default editor size*/ | |
background: var(--theme-ace-bg) !important; | |
} | |
.ace_dialog-bottom{ | |
border-top: 1px solid var(--theme-ace-bg) !important; | |
} | |
.ace-chrome .ace_print-margin, .ace_gutter, .ace_gutter-cell, .ace_dialog{ | |
background: var(--theme-ace-bg-accent) !important; | |
} | |
.ace-chrome{ | |
color: var(--theme-ace-fg) !important; | |
} | |
.ace_gutter, .ace_dialog { | |
color: var(--theme-ace-fg-accent) !important; | |
} | |
.ace_cursor{ | |
color: var(--theme-ace-cursor) !important; | |
} | |
.normal-mode .ace_cursor{ | |
background-color: var(--theme-ace-cursor) !important; | |
border: var(--theme-ace-cursor) !important; | |
} | |
.ace_marker-layer .ace_selection { | |
background: var(--theme-ace-select) !important; | |
}`; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment