Skip to content

Instantly share code, notes, and snippets.

@sschuldenzucker
Last active October 21, 2020 21:42
Show Gist options
  • Save sschuldenzucker/7196bfc2c573033e5d197c4713a9f0ed to your computer and use it in GitHub Desktop.
Save sschuldenzucker/7196bfc2c573033e5d197c4713a9f0ed to your computer and use it in GitHub Desktop.
// restore original behavior of Alt+Left in Roam Research.
// Without this, there's not back shortcut AFAIA, which is just insane.
// USAGE: Anywhere, create a block with content {{[[roam/js]]}}.
// Place the following code nested below that block.
// Then execute the block by clicking the button.
// (this only needs to be done once; it'll be done automatically for you from now on until you stop or delete the code block)
document.addEventListener('keydown', (ev)=> {
if (ev.altKey && ev.shiftKey==false && ev.ctrlKey==false && ev.code=='ArrowLeft') {
window.history.back()
}
} )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment