Home User guideKeyboard shortcuts

User guide pages

Keyboard shortcuts

Since 0.2.0

On the web, some of these keys differ: see Keyboard shortcuts on the web.

On a phone or a tablet used by touch, Mahfouz doesn’t show keys: menus, the command palette, the / menu and tooltips leave them out, and Keyboard shortcuts and Settings → Shortcuts aren’t offered. A keyboard connected to the device still runs every shortcut, and a tablet used with a trackpad shows them as usual. Since 0.20.0

Remappable app shortcuts (.config/settings.md, ## Shortcuts table). Mod = ⌘ on macOS, Ctrl elsewhere:

Shortcut Action
ModN New note (sibling of selection)
ModAltShiftN New note (child of selection)
ModAltN New note (parent level)
Mod? Open keyboard shortcuts help
ModW Close active tab
ModS Manual save + commit
ModAltG Commit notes…: pick which uncommitted notes to commit
Mod\ Toggle left sidebar
ModShift\ Toggle right sidebar
Mod1 Go to all notes
Mod2 Go to tasks (was Mod6) Since 0.14.0
Mod3 Go to people Since 0.14.0
Mod9 Show notifications Since 0.14.0
Mod0 Open the account menu Since 0.14.0
ModAltK Go to bookmarks (was Mod2) Since 0.14.0
ModAltX Go to trash (was Mod4) Since 0.14.0
ModShiftF Open the Search tab to search note contents, starting from the Find bar’s query or the selection Since 0.13.0
ModK Open the command palette
ModAltF Find the next occurrence of the selection, or of the word under the cursor (row find_selection)
ModAlt; Add the word under the cursor to the vault dictionary
None Remove the word under the cursor from the vault dictionary (no default key)
None Toggle auto-commit for note (no default key)
None Open the vault mind map (no default key; action “Open mind map”)
None Create a database (no default key; action “New database”)
None Open today’s note, creating it if needed (no default key; action “Today’s note”, row today_note) Since 0.20.0
None Add a comment on the selection, or reply to the comment under the cursor (no default key; action “Add comment”)
None Set the active note’s page icon (no default key; action “Set note icon”)
None Find the notes that mention the person at the cursor: opens the Search tab on person:handle for the @mention the cursor is on (no default key; action “Find mentions of person”, row find_mentions) Since 0.13.0
None Copy a link to the heading the cursor is on (no default key; action “Copy link to heading”, row copy_heading_link) Since 0.14.0
None Copy the active note’s permalink (no default key; action “Copy permalink”, row copy_permalink) Since 0.16.0
None Share the active note through the system share sheet (no default key; row share_note; in the macOS app and in browsers that can share)
ModShiftR Reveal the active note in Finder / File Explorer (row reveal_in_file_manager)
ModShiftP Switch the active note between Source and Preview (row toggle_source_preview) Since 0.20.0
F8 / ShiftF8 Go to the next or previous suggestion (rows next_suggestion, previous_suggestion) Since 0.20.0
F6 / ShiftF6 Move focus to the next or previous region: editor, toolbar, outline, right sidebar, bottom bar (rows focus_next_region, focus_previous_region; see Writing from the keyboard) Since 0.20.0
None Switch between Editing and Suggesting, Accept all suggestions, Reject all suggestions, Publish the active note, Focus the note’s comments, Focus the note’s editor (no default keys; rows toggle_suggesting, accept_all_suggestions, reject_all_suggestions, publish_note, focus_comments, focus_editor) Since 0.20.0
ModAltEnter Present active note as slides (a plugin command: its row is mahfouz/slidev:present-fullscreen; needs the Slidev presentations plugin 1.9.1 or later). Its old default, ModShiftP, now switches Source and Preview Since 0.20.0

If your vault’s ## Shortcuts table already gives ModShiftP, F8, ShiftF8, F6 or ShiftF6 to another action, that action keeps it. Since 0.20.0

The rail’s keys follow its order: the items at the top count up from Mod1 (all notes, tasks, people), and the ones at the bottom count back from Mod0 (the account menu, then notifications). Each rail button’s tooltip shows its key. Since 0.14.0 Each key belongs to its action, not to a place on the rail: it keeps working when you move or hide the rail item. Since 0.15.0

A vault whose ## Shortcuts table still holds the old default keys (Mod6 for tasks, Mod2 for bookmarks, Mod4 for trash) gets the new ones. If your vault already gives Mod3, Mod9 or Mod0 to another action, that action keeps it, and Go to people, Show notifications or Open the account menu has no key until you give it one in Settings → Shortcuts. Since 0.14.0

Fixed editor shortcuts (not remappable):

Shortcut Action
ModB Bold
ModI Italic
ModShiftX Strikethrough
ModE Inline code
ModAlt, (comma) Subscript
ModAlt. (period) Superscript
ModShiftH Highlight
ModShiftK Link the selection (asks for the URL)
ModAlt1 to 6 Heading 1 to 6 (4 to 6 Since 0.13.0)
ModShift8 Bullet list
ModShift7 Ordered list
ModShift9 Checklist
ModShift. Blockquote
ModShiftM Insert media or file
ModEnter Open the link, mention, tag or path at the cursor, or tick its task; elsewhere add a blank line Since 0.20.0
Mod. Open the menu for what’s at the cursor, or a link’s, tag’s or person’s card (also ShiftF10 and the Menu key) Since 0.20.0
Enter / Delete or Backspace On a selected image, diagram or other block in Preview: open it, or remove it (not a database view) Since 0.20.0
Click / Cmd/Ctrl+click / Shift+click In Preview, on a link, tag or person: follow it / open a note in the background / extend the selection (see Clicking in Preview) Since 0.20.0
Alt↑ / Alt↓ Move the heading’s section, the list item, or the line Since 0.20.0
Esc From the toolbar, outline, right sidebar or bottom bar, go back to the note Since 0.20.0

These keys are explained in Writing from the keyboard. Since 0.20.0

Other useful bindings: Tab/Enter inside a checklist or list continue it (Since 0.20.0 on other lines, Tab and ShiftTab move focus out of the editor); in Source, Cmd/Ctrl+click opens a link or wikilink in the background Since 0.20.0; [[ triggers wikilink autocomplete; { opens the field menu and a space then ! the date menu. Since 0.13.0 The Find and Replace bar has its own keys, listed under Find and replace; the Search tab shares them. Code blocks have their own fold keys, listed under Folding code. Since 0.13.0

The sidebar from the keyboard Since 0.13.0

The sidebar’s notes, folders, Bookmarks and Notes headers, and Trash entries are one stop when you press Tab: focus lands on the row of the open note, or on the row you last moved to. Then:

Key Action
↓ / ↑ Move to the next or previous row
Home / End Move to the first or last row
→ Expand a row, or move to its first child when it’s already expanded
← Collapse a row, or move to its parent when it’s already collapsed
Enter Open a note (ModEnter opens it in a new tab), expand or collapse a folder or header, or preview a Trash entry
F2 Rename the focused note or folder (the Rename note shortcut, so a new key you give it works here too)
ShiftF10 Open the row’s menu, as ⋯ would

In the Search tab, ↓ and ↑ in the search field move through each note’s title and its matching lines, Enter opens the note at that line (at its top on its title) and ModEnter opens it in a new tab. Since 0.13.0

The menu bar (desktop)

Every app action above is also in the desktop menu bar, next to its shortcut:

  • File: new notes (sibling, child, parent level), New Folder, New Database, New Vault, Open Vault, Save, Import Since 0.16.0, Export, Share (macOS only), Close Tab.
  • Edit: the usual editing commands, Find and Replace, Find Selection, Find in All Notes Since 0.13.0, Command Palette.
  • Note: acts on the note in the active tab. It has Bookmark, Auto-commit, Rename, Duplicate, Move, the Copy commands (Copy Permalink Since 0.16.0), Reveal in Finder (or File Explorer), Revision History, plugin commands such as Present, and Delete. These items are greyed out when no note tab is open.
  • View: the sidebars, Toggle Source/Preview Since 0.20.0 (greyed out when no note editor shows), Line Numbers, Zoom In and Out, Stop Presenting.
  • Go: All Notes, Bookmarks, Trash, Mind Map, Back, Forward.
  • Help: Keyboard Shortcuts, User Guide, Send Feedback.

The keys shown in the menu follow your ## Shortcuts table: change a shortcut there and the menu shows the new key. A few keys never appear in the menu, though they still work:

  • Shortcuts without ⌘ or Ctrl, such as F2 for Rename.
  • ModD, Mod[ and Mod], which the editor also uses to select the next match and to indent or outdent. Leaving them off the menu keeps them working in the editor.

These menu keys are fixed and aren’t in the ## Shortcuts table: Mod, Settings, ModShiftN New Vault, ModShiftO Open Vault, ModF Find and Replace. Stop Presenting has no menu key: press Esc, since Mod. opens the menu at the cursor. Since 0.20.0 Line Numbers has no key, so ModShiftL copies the note as a wikilink.

Keyboard shortcuts on the web

The browser keeps some keys for itself (close tab, new window, switch tabs, zoom, bookmarks, developer tools, reload), so those shortcuts move on the web. Every other shortcut is the same as on desktop. Mod is ⌘ on a Mac and Ctrl elsewhere; Alt is ⌥ on a Mac.

Action Desktop Web
New note at the same level ModN ModAltEnter
Close the active tab ModW ModAltW
Go to all notes Mod1 ModAltShiftH (was ModAlt1) Since 0.18.0
Go to tasks Mod2 ModAltShiftT (was ModAlt2) Since 0.18.0
Go to people Mod3 ModAltShiftP (was ModAlt3) Since 0.18.0
Show notifications Mod9 ModAlt9 Since 0.14.0
Open the account menu Mod0 ModAlt0 Since 0.14.0
Go to bookmarks ModAltK Since 0.14.0 ModAltK
Go to trash ModAltX Since 0.14.0 ModAltX
Bookmark the active note ModD ModAltS
Duplicate the active note ModShiftD ModAltShiftD
Copy the note’s name ModShiftC ModAltShiftC
Copy the note as a wikilink ModShiftL ModAltShiftL
Copy the note’s ID ModAltI ModAltShiftI
Delete the active note ModShiftBackspace ModAltBackspace
Increase editor zoom Mod= ModAlt=
Decrease editor zoom Mod- ModAlt-
Previous tab Mod[ ModAlt[
Next tab Mod] ModAlt]
Settings Mod, Mod;
Open Vault ModShiftO ModAltO
Switch between Source and Preview ModShiftP ModAltP (Firefox keeps ModShiftP) Since 0.20.0
Move focus past the last region F6 goes back to the editor F6 goes on to the browser’s address bar Since 0.20.0
Export the active note ModShiftE (desktop only)
Reveal in Finder ModShiftR (desktop only)

Mod; assumes a US-style keyboard layout. On a layout where “;” needs Shift or another modifier, it can’t be pressed: choose Settings in the account menu (the account button at the bottom of the left rail) instead.

On a Mac, shortcuts with ⌥ go by the key you press, not the character ⌥ types with it, so ⌥⌘S works although ⌥S types “ß”. Mahfouz shows a shortcut’s symbols in Apple’s order: ⌃, ⌥, ⇧, then ⌘ (⌥⌘S, not ⌘⌥S). Since 0.14.0

On Windows and Linux, some keyboard layouts (German, Polish and others) treat Ctrl+Alt as AltGr, so in the browser a Ctrl+Alt+digit key may type a character instead of running its action. If one does, give the action another key in Settings → Shortcuts. Since 0.14.0

In Settings → Shortcuts, each binding shows one keycap per key, such as ⌘⇧K. Click it and press the new keys to record another one; each row has its own reset button to bring back the default. Since 0.19.0

Shortcuts you change in Settings → Shortcuts are saved in the vault (.config/settings.md) and apply on both. A default you haven’t changed stays each platform’s own default.