Last active
March 27, 2021 09:11
-
-
Save TfTHacker/18d7055d89f6a8bff0f308f3e13d6e7d 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
// Roam42 is a prerequisite for this code, as it uses Roam42 libraries | |
// Install & Config: | |
// Add the code in this gist to a roam/js block in your roam graph and enable it | |
// change the text between quotes "" where it says let txt = "....." | |
// You can change the custom keys where it says hotkeys('ctrl+shift+7) | |
// this uses the hotkeys library, so explore more key combinations at: https://wangchujiang.com/hotkeys/ | |
// after changing the text below, you may have to refresh Roam for it to take effect. | |
setTimeout(()=>{ | |
Mousetrap.unbind('ctrl+shift+7') | |
Mousetrap.bind('ctrl+shift+7', function(event, handler) { | |
let txt = "{{[[TODO]]}} #action " | |
event.preventDefault() | |
if (event.srcElement.localName == "textarea") { | |
roam42.common.setEmptyNodeValue(document.getElementById(event.srcElement.id), txt + event.srcElement.innerHTML ) | |
} | |
}); | |
},5000) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment