roam-toolkit icon indicating copy to clipboard operation
roam-toolkit copied to clipboard

remapping 'close sidebar' to single key like 'q' breaks typing

Open alok opened this issue 5 years ago • 2 comments
trafficstars

If I map q to close the sidebar but then try to type anything in that sidebar that requires me to press q in insert mode, it types the letter q and exits.

alok avatar Aug 24 '20 02:08 alok

Currently, the "close sidebar" shortcut works in all modes. Maybe we should make it only work in normal mode: I think it'd just mean changing map to nmap here: https://sourcegraph.com/github.com/roam-unofficial/roam-toolkit@master/-/blob/src/ts/core/features/vim-mode/commands/panel-commands.ts#L20:1

tntmarket avatar Aug 27 '20 01:08 tntmarket

I think it's actually nice to have it working in insert mode. That said - as this issue highlights - it's not very meaningful to allow 1-char mappings for insert mode.
I think ultimately it'd be nice to allow people to select what modes given shortcut applies in

Stvad avatar Aug 27 '20 02:08 Stvad