From af77f610b6733906e349d0c72397a919a950c088 Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Fri, 2 Jun 2023 00:48:29 -0700 Subject: [surfingkeys] Add command to capture the current page in org-mode --- surfingkeys/surfingkeys.js | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'surfingkeys') 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('', '#7Open commands', function() { api.Front.openOmnibar({type: "Commands"}); }); +api.mapkey('cc', '#13Capture current page', orgCapture); + api.map('', 'h'); api.map('', 'j'); api.map('', 'k'); -- cgit v1.2.3-54-g00ecf