Add some default keybindings for toggling scripts

Those follow the following pattern:

1) "t" for 'toggle"
2) "s" for "scripts", upper-casing ("S") to make the toggle permanent
3) "h" for host, "H" for host with subdomains, "u" for the exact URL
This commit is contained in:
Florian Bruhin 2018-02-22 07:33:46 +01:00
parent cfeeb7460b
commit 5c4277aac8
3 changed files with 13 additions and 0 deletions

View File

@ -582,8 +582,14 @@ Default:
* +pass:[sk]+: +pass:[set-cmd-text -s :bind]+
* +pass:[sl]+: +pass:[set-cmd-text -s :set -t]+
* +pass:[ss]+: +pass:[set-cmd-text -s :set]+
* +pass:[tSH]+: +pass:[config-cycle -p -u *://*.{url:host}/* content.javascript.enabled ;; reload]+
* +pass:[tSh]+: +pass:[config-cycle -p -u *://{url:host}/* content.javascript.enabled ;; reload]+
* +pass:[tSu]+: +pass:[config-cycle -p -u {url} content.javascript.enabled ;; reload]+
* +pass:[th]+: +pass:[back -t]+
* +pass:[tl]+: +pass:[forward -t]+
* +pass:[tsH]+: +pass:[config-cycle -p -t -u *://*.{url:host}/* content.javascript.enabled ;; reload]+
* +pass:[tsh]+: +pass:[config-cycle -p -t -u *://{url:host}/* content.javascript.enabled ;; reload]+
* +pass:[tsu]+: +pass:[config-cycle -p -t -u {url} content.javascript.enabled ;; reload]+
* +pass:[u]+: +pass:[undo]+
* +pass:[v]+: +pass:[enter-mode caret]+
* +pass:[wB]+: +pass:[set-cmd-text -s :bookmark-load -w]+

View File

@ -63,6 +63,7 @@ def replace_variables(win_id, arglist):
QUrl.FullyEncoded | QUrl.RemovePassword),
'url:pretty': lambda: _current_url(tabbed_browser).toString(
QUrl.DecodeReserved | QUrl.RemovePassword),
'url:host': lambda: _current_url(tabbed_browser).host(),
'clipboard': utils.get_clipboard,
'primary': lambda: utils.get_clipboard(selection=True),
}

View File

@ -2329,6 +2329,12 @@ bindings.default:
<Ctrl-p>: tab-pin
q: record-macro
"@": run-macro
tsh: config-cycle -p -t -u *://{url:host}/* content.javascript.enabled ;; reload
tSh: config-cycle -p -u *://{url:host}/* content.javascript.enabled ;; reload
tsH: config-cycle -p -t -u *://*.{url:host}/* content.javascript.enabled ;; reload
tSH: config-cycle -p -u *://*.{url:host}/* content.javascript.enabled ;; reload
tsu: config-cycle -p -t -u {url} content.javascript.enabled ;; reload
tSu: config-cycle -p -u {url} content.javascript.enabled ;; reload
insert:
<Ctrl-E>: open-editor
<Shift-Ins>: insert-text {primary}