Guide › Settings

Keyboard shortcuts and the command palette

Every command in Mayhap has a place on the keyboard, and the mouse is the other way to reach it. F1 lists every command with its key, the command palette finds and runs any of them by name, and you may give any command the keys you like.

Seeing every key

To see every command with its key, press F1. A card opens over the page with the commands in groups, named for where their keys work: File, Show, Nudge, Alternatives, Alternatives panel, Settle, Find, Help, Editing and Moving. You may also click the keyboard at the right end of the top bar, or choose Keyboard Shortcuts in the file menu.

The Keyboard shortcuts card over the page, its commands in groups, each with its key

The card always shows the keys as they are now. If you've given a command keys of your own, those are the ones listed, and a command without a key shows a dash. Press Esc or F1 again, or click outside the card, to close it.

Don't worry about learning the keys up front. Whenever you do something from a menu that has a key, a hint in the bottom bar names that key, once.

Running a command by name

The command palette finds any command by name and runs it. Press CtrlK⌘K or CtrlShiftP⇧⌘P, and a card with a search field opens under the top bar. It lists every command from the keyboard shortcuts, each with its key.

The command palette with version typed, listing the commands that hold it, each with its key

As you type, the list keeps the commands that hold every word you've typed, in any order. Parts of words are enough. For example, type pdf and Export PDF… is left; type par st and you get Start of the paragraph.

Press ↑ or ↓ to pick a command, then Return to run it. It runs where you were, exactly as its key would there, so a command with nothing to act on does nothing. Esc or a click outside closes the palette and puts you back where you were.

While text is selected, CtrlK⌘K makes a link instead. To open the palette then, press CtrlShiftP⇧⌘P.

Keys at a glance

Sometimes you may only need the key for a button you're looking at. Hold Ctrl⌘ on its own for half a second, and each control in the top and bottom bars shows its key in a small badge. They're written without the key you're already holding: 1, 2 and 3 for Alternatives, Nudge and Aside. Let go, press another key or click, and they're gone.

If you'd rather not see them, turn off Show keys while holding Ctrl in Settings › Look.

How the keys are laid out

Mayhap's keys follow a pattern, so a key tells you what kind of thing it does:

  • Everyday actions take one modifier: CtrlS⌘S saves and CtrlJ⌘J jots a thought.
  • Adding Shift acts on the selection, or does a bigger version of the same thing: CtrlShiftA⇧⌘A makes versions of the selected words, and CtrlShiftS⇧⌘S saves as a new file.
  • Ctrl with Alt changes the view, and sets headings with its digits: CtrlAltM⌥⌘M shows Markdown's marks and CtrlAlt2⌥⌘2 makes a second-level heading.
  • Alt steps through things in place: Alt↓⌥↓ shows the next version at the caret, and AltN⌘] goes to Nudge's next flag.

The bottom bar's panels are numbered in their order: Ctrl1⌘1 for Alternatives, Ctrl2⌘2 for Nudge, Ctrl3⌘3 for Aside, and Ctrl4⌘4 for History beside them.

Changing a key

Any command in the keyboard shortcuts may be given other keys, or none. So may the keys that work inside menus and inside Settings. To get started, open Settings with Ctrl,⌘, and choose Shortcuts. Every command is listed in its group, each key shown as a chip.

To find a command, type in Search commands or keys. It finds a name or a key, so typing ctrl j finds whatever CtrlJ⌘J does now.

Next, click the chip you'd like to change, or move to it and press Return. It says Press keys…, and the next key you press takes its place. For example, if you would like Jot a thought on F9 as well, search for jot, click the + beside its key and press F9. Pressing Esc while a chip waits leaves the key as it was.

A few things to know as you go:

  • A command without a key shows a dashed no key chip. Click it to give the command one.
  • To take a key off, move to its chip and press Backspace or Delete.
  • Reset shows beside a command whose keys you've changed, and gives it its default keys back.
  • A key that another command uses in the same place asks first, under the row: Ctrl+J is Jot a thought. Choose Use it here to move the key, or Cancel.
  • A key that types a character on its own, such as a letter, is never taken. The chip goes on waiting and tells you to hold a modifier with it.

Each change applies at once, in every window, and is saved straight away.

The keymap file

If you prefer to edit a file, your keys live in keymap.json, beside settings.json. While Shortcuts is open, Open keymap.json at the foot of the sections opens it in your system's app for it. You can learn where the folder is in Settings.

The file holds only your changes, never the defaults. It's grouped by where the keys work, under the names file, show, nudge, alternatives, alternatives-panel, settle, editing, find, moving, help, menus and settings. In each group, a command's id is given a key, a list of keys, or null for none. Keys are written as you'd say them, in lowercase with plus signs: "ctrl+shift+s", "alt+]", "f9", or "cmd+s" on a Mac.

For example, the line "jot-a-thought": ["ctrl+j", "f9"] under "editing" gives Jot a thought both keys. A command named in the file loses its default keys, so list every key you want it to keep. The file may hold comments, and an editor that reads JSON schemas completes the groups and ids for you from keymap.schema.json, which Mayhap writes beside it.

Save the file and every window takes the change a moment later. If a line can't be used, the top bar says so after the document's name, for example keymap.json has 1 problem. Click it to see the line and what's wrong, often with a guess at what you meant. Everything else in the file still applies.

The keys you'll use most

Command
Keyboard shortcuts F1F1
Command palette CtrlK, CtrlShiftP⌘K, ⇧⌘P
Settings… Ctrl,⌘,
File menu AltFno key
New document CtrlN⌘N
Open… CtrlO⌘O
Recent files CtrlShiftO⇧⌘O
Save CtrlS⌘S
Save As… CtrlShiftS⇧⌘S
Alternatives panel Ctrl1⌘1
Nudge Ctrl2⌘2
Aside Ctrl3⌘3
History Ctrl4⌘4
Alternatives for selection CtrlShiftA⇧⌘A
Next / previous version at the caret Alt↓ / Alt↑⌥↓ / ⌥↑
Alternatives layer CtrlAltA⌥⌘A
Markdown marks CtrlAltM⌥⌘M
Mark as maybe / Keep it CtrlShiftM, Ctrl/⇧⌘M, ⌘/
Set it aside CtrlShiftX⇧⌘X
Jot a thought CtrlJ⌘J
Settle CtrlE⌘E
Focus CtrlShiftD⇧⌘D
Full screen F11⌃⌘F
Find CtrlF⌘F
Replace CtrlH⌥⌘F
Find in folder CtrlShiftF⇧⌘F
Bold / Italic CtrlB / CtrlI⌘B / ⌘I
Link… CtrlK on selected text, CtrlShiftK⌘K on selected text, ⇧⌘K
Undo CtrlZ⌘Z
Redo CtrlShiftZ, CtrlY⇧⌘Z
Close the window CtrlW⌘W
Quit CtrlQ⌘Q

Nothing in the guide matches. Write to us