Throughout 2024 one of our top requests has been shortcuts within the Sanity portable text editor. It's been a bit of a pain-point and the one QOL productivity feature that's missing.
Now guess what dropped just before the end of the year.
So you know what that means: if you're not already using the auto-updating Sanity Studio, make sure you run
npm i sanity@latest
We're going to go through a couple of useful ones and something that I guarantee will trip you up if you've been building client websites for a while.
Cheat Sheet
We thought we'd make it easy and just include a cheat sheet for if you're planning to use these straight away after upgrading.
Headings
#
- Heading 1
##
- Heading 2
###
- Heading 3
####
- Heading 4
#####
- Heading 5
######
- Heading 6
Lists
>
- Blockquote
1.
- Ordered list
-
or *
- Unordered list
Pitfall to be aware of
If you're anything like us, you probably restricted <h1>
from being used within the portable text editor. Naturally, the first thing you are going to test from the cheat sheet above is # and then see if a <h1>
appears... Yes we made the same mistake, and quickly forgot we weren't including <h1>
.
Make sure whatever markdown shortcut you're trying to use, actually exists inside of your portable text editor.
Keyboard shortcuts exist as well
You may be aware of a couple markdown shortcuts we have missed from above. Specifically bold and italic. Well, the good news is, they're in there, but just with keyboard shortcuts instead.
For example, highlight some text and hit:
⌘ + B
- Make text bold
⌘ + I
- Make text italic
Bonus tip: full-screen portable text editor
If you're like us, everything is so distracting, if you want to run a fullscreen editor, you can do so by hitting the expand editor at the top right (or hitting ⌘ + ⏎ (enter)
) and clicking the top of each of the side panels to collapse them.