Why limit yourself to default keyboard shortcuts in the Block Editor when you could add extra ones that you’ll probably never remember? (but for me this one’s better 👟 )

Why limit yourself to default keyboard shortcuts in the Block Editor when you could add extra ones that you’ll probably never remember? (but for me this one’s better 👟 )
<?php
// Block Editor: Cmd+Shift+Plus to Toggle Block Inserter
// https://snipsnip.pro/s/174
namespace n12UckiJ;
function block_editor_toggle_inserter_shortcut(){
if ( !function_exists( '\get_current_screen' ) ) { return false; }
$screen = \get_current_screen();
if ( method_exists( $screen, 'is_block_editor' ) && $screen->is_block_editor() ) {
?>
<script>
let n12UckiJ = {};
n12UckiJ.domReady = cb => {
"interactive" === document.readyState ||
"complete" === document.readyState ?
cb() : document.addEventListener("DOMContentLoaded", cb)
};
n12UckiJ.domReady(() => {
setTimeout(()=>{
document.addEventListener("keydown", function(e) {
if (e.shiftKey && e.metaKey && e.keyCode === 187) {
e.preventDefault();
let el = document.querySelector('button[aria-label="Toggle block inserter"]');
el && el.click();
}
});
console.log('Block Editor: Cmd+Shift+Plus to Toggle Block Inserter [SnipSnip.pro]');
},6000);
});
</script>
<?php
}
}
\add_action( 'admin_print_footer_scripts', '\n12UckiJ\block_editor_toggle_inserter_shortcut' );