[surfingkeys] Add command to capture the current page in org-mode

This commit is contained in:
Tom Willemse 2023-06-02 00:48:29 -07:00
parent 34c3fbdec8
commit af77f610b6

View file

@ -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');