Hi! I’m quite new to SilverBullet, so sorry if there is already a solution for this. Also sorry for the giant wall of text, I’m a verbose person…
TL;DR: There are some unnecessary steps involved in leaving and re-entering a code block, which could perhaps be solved by a keyboard shortcut that toggles between editing and showing the results.
The Problem
When I’m working with complicated templates or Mermaid charts, I frequently find myself wanting to quickly check the result of the current code block, and then quickly get back into editing it. However, I feel like doing that takes a lot of steps.
As far as I can tell, the only way to leave editing mode is to move the cursor out of the code block, which either involves moving my hand over to the mouse and finding a selectable element, or doing something like Ctrl+Home
that would consistently bring the cursor out of the block (but this could move the cursor very far away from the block, making it difficult to quickly return to it). And then to return to editing, the process involves clicking into the code block / moving the cursor back into it, and then - because the cursor is always reset to the top of the block - finding the position where you were previously, and then navigating back to that position. When working with complicated / lengthy blocks, it can be disorienting trying to figure out where you were when the code was completely hidden moments ago.
A Possible Solution
My idea to solve these papercuts is a keyboard shortcut that would toggle editing the current code block. While editing a code block, pressing it would take you out of editing mode (rendering the results, as if your cursor had left the block) and then pressing it again would take you back into editing mode at the same position you were previously.
This might seem like a minor improvement, but I think it would really improve efficiency when working with code blocks. To compare the two processes…
Current:
- Grab the mouse
- Find somewhere to click that would move the cursor
- Click
(Look at results) - Click the code block to leave editing mode
- Find where you were in the code
- Click the position
Proposed:
- Press the keybinding to show the results
(Look at results) - Press the same keybinding to resume editing
For the keybinding itself, my first thought was something like Ctrl+E
or Alt+E
(“E” for “Edit”). Or maybe it would be simplest to make this an additional function of Alt+Q
, since showing the results of a template/query is very similar to its current function of refreshing templates/query results… though that might be a bit of a stretch…
Anyway, that’s it! Thanks for your time! SilverBullet is awesome!