aboutsummaryrefslogtreecommitdiffstats
path: root/surfingkeys
diff options
context:
space:
mode:
authorGravatar Tom Willemse2023-06-02 00:48:29 -0700
committerGravatar Tom Willemse2023-06-02 00:48:29 -0700
commitaf77f610b6733906e349d0c72397a919a950c088 (patch)
tree2a7d5899e6b383d9cf9a23631c9ac6c4c162dbbd /surfingkeys
parent34c3fbdec8b846f9bff113253034c0c37ac603f3 (diff)
downloadnew-dotfiles-af77f610b6733906e349d0c72397a919a950c088.tar.gz
new-dotfiles-af77f610b6733906e349d0c72397a919a950c088.zip
[surfingkeys] Add command to capture the current page in org-mode
Diffstat (limited to 'surfingkeys')
-rw-r--r--surfingkeys/surfingkeys.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/surfingkeys/surfingkeys.js b/surfingkeys/surfingkeys.js
index adf707d..960d4c5 100644
--- a/surfingkeys/surfingkeys.js
+++ b/surfingkeys/surfingkeys.js
@@ -1,9 +1,20 @@
+function orgCapture() {
+ location.href = 'org-protocol://capture?'
+ + new URLSearchParams({
+ template: 'U',
+ url: window.location.href,
+ title: document.title,
+ body: window.getSelection()});
+}
+
api.unmap(':');
api.mapkey('<Alt-x>', '#7Open commands', function() {
api.Front.openOmnibar({type: "Commands"});
});
+api.mapkey('cc', '#13Capture current page', orgCapture);
+
api.map('<Ctrl-b>', 'h');
api.map('<Ctrl-n>', 'j');
api.map('<Ctrl-p>', 'k');