Notes: Keyboard shortcut for switching preview/edit

Created on 7 May 2020  Â·  9Comments  Â·  Source: nextcloud/notes

Is your feature request related to a problem? Please describe.
Switching between editor and preview requires switching hands to the mouse and then going into a drop-down menu where the middle item needs to be selected. This is quite cumbersome when you're in deep in a writing flow and just want a quick preview.

Describe the solution you'd like
Define a keyboard shortcut (maybe Alt+P) that switches between edit and preview modes.

Describe alternatives you've considered
Display the preview on the side of the Markdown editor.


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

feature request

Most helpful comment

Typora is a popular markdown editor among macOS users (yet also available for Windows and Linux) because of its slick design and powerful functionality (table import, mermaid, typewriter mode, etc.). They use ctrl+/ (forward slash; to go from default preview-like mode to 'source code mode' in Markdown syntax. So far I haven't faced complications with global shortcuts (Ubuntu 18.04).

Good point @ecogit, thanks for that note! :) Sounds better indeed, especially as Typora is specifically a distraction-free text / Markdown app with live preview of Markdown just like us. What do you think about Ctrl / @korelstar @stefan-niedermann? (Deep link to that shortcut: https://support.typora.io/Shortcut-Keys/#view)

All 9 comments

Sound like a good enhancement. @jancborchardt which keyboard shortcut is recommendable for this? How could we advertise this?

Btw.: this issue is kind-of related to #366.

Sound like a good enhancement. @jancborchardt which keyboard shortcut is recommendable for this? How could we advertise this?

Good question, there’s not really a standard:

Short version: Out of all of them, Visual Studio Code’s Markdown preview uses Ctrl Shift V is the only one which does not conflict with anything existing and is also a widely used software, so let’s go for that one.

ctrl shift v is often used to paste formatted text without the formatting. Not sure if this is relevant here, just wanted to note.

Thanks for the overview, @jancborchardt . But due to the comment by @stefan-niedermann , I'm confused, now 😕 . Should we still use Ctrl Shift V? How could we advertise this to the user?

I’d say let’s go for Ctrl Shift V as that is used by Visual Studio Code – it seems quite difficult here to find any shortcut which at the same time is established and does not conflict with anything, so let’s just go with that. Possibly in the future a de-facto standard will evolve. :)

How we usually advertise shortcuts is in the text or tooltips of the buttons. Since it is a longer shortcut, it definitely needs to be in the tooltip.

Sound like a good enhancement. @jancborchardt which keyboard shortcut is recommendable for this? How could we advertise this?

Good question, there’s not really a standard:

* [Github comments use `Ctrl Shift P`](https://help.github.com/en/github/getting-started-with-github/keyboard-shortcuts#comments) but this conflicts with "New Private Window"

* Same for [Simplenote using `Ctrl Shift P`](https://github.com/Automattic/simplenote-electron/pull/1983)

* [Atom’s Markdown preview uses `Ctrl Shift M`](https://github.com/atom/markdown-preview#markdown-preview-package) which in GNOME at least triggers the magnifying glass accessibility feature.

* [iA Writer for macOS uses `Command R`](https://ia.net/writer/support/general/markdown-guide) (or swiping) which of course on the web would conflict with refreshing the page

* [Visual Studio Code’s Markdown preview uses `Ctrl Shift V`](https://code.visualstudio.com/docs/languages/markdown#_markdown-preview) which seems to not conflict with anything

Short version: Out of all of them, Visual Studio Code’s Markdown preview uses Ctrl Shift V is the only one which does not conflict with anything existing and is also a widely used software, so let’s go for that one.

Typora is a popular markdown editor among macOS users (yet also available for Windows and Linux) because of its slick design and powerful functionality (table import, mermaid, typewriter mode, etc.). They use ctrl+/ (forward slash; to go from default preview-like mode to 'source code mode' in Markdown syntax. So far I haven't faced complications with global shortcuts (Ubuntu 18.04).

Typora is a popular markdown editor among macOS users (yet also available for Windows and Linux) because of its slick design and powerful functionality (table import, mermaid, typewriter mode, etc.). They use ctrl+/ (forward slash; to go from default preview-like mode to 'source code mode' in Markdown syntax. So far I haven't faced complications with global shortcuts (Ubuntu 18.04).

Good point @ecogit, thanks for that note! :) Sounds better indeed, especially as Typora is specifically a distraction-free text / Markdown app with live preview of Markdown just like us. What do you think about Ctrl / @korelstar @stefan-niedermann? (Deep link to that shortcut: https://support.typora.io/Shortcut-Keys/#view)

Agree, ctrl + / sounds good, indeed. I only know that it's used by atlassian apps like Jira and Confluence for search, but that shouldn't affect us at all.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

eladhen picture eladhen  Â·  7Comments

trymeouteh picture trymeouteh  Â·  6Comments

korelstar picture korelstar  Â·  5Comments

artemanufrij picture artemanufrij  Â·  6Comments

Tuxyso picture Tuxyso  Â·  5Comments