Skip to content

Add configurable external editor with keyboard shortcut#13

Open
myrison wants to merge 1 commit intofrankdilo:mainfrom
myrison:feature/configurable-external-editor
Open

Add configurable external editor with keyboard shortcut#13
myrison wants to merge 1 commit intofrankdilo:mainfrom
myrison:feature/configurable-external-editor

Conversation

@myrison
Copy link

@myrison myrison commented Feb 6, 2026

Summary

  • Adds an "Open in External Editor" menu item that opens the current markdown file in a user-configured editor application
  • Default shortcut is Cmd+E, configurable to any modifier+key combination in Settings
  • No editor is configured by default — on first use, the user is prompted to select one
  • Includes a custom shortcut recorder that captures modifier+key combinations with validation against reserved system shortcuts
  • Ships with unit tests for the settings store

Details

  • ExternalEditorSettings: Persists editor app URL, display name, and shortcut to UserDefaults
  • SettingsView: Editor picker (scoped to /Applications) with icon preview, plus an interactive shortcut recorder
  • ShortcutRecorderView: Captures keyboard events, validates against reserved system shortcuts (Cmd+Q, Cmd+W, etc.), and filters to ASCII-printable keys
  • Dynamic menu: Menu item title and shortcut update reactively when settings change

Works with any application that accepts file URLs — tested with Sublime Text, VS Code, and BBEdit.

Screenshots

image

How to test

  • Open Settings > External Editor, select an editor app
  • Verify the menu item updates to show "Open in {EditorName}"
  • Record a custom keyboard shortcut, verify it appears in the menu
  • Open a markdown file and trigger the shortcut — editor should open the file
  • Clear the editor selection, verify fallback to a file chooser prompt
  • Run swift test — unit tests pass for ExternalEditorSettings

Follow-up

I'm planning a couple of smaller follow-up PRs as independent improvements that complement this workflow:

  • Auto-reload with notification: Replace the "File changed" click-to-reload banner with automatic reload and a dismissable notice
  • Bring to front on file change: Optional setting to raise the viewer window when an external edit is detected

Each will be submitted separately against main so they can be evaluated independently.

🤖 Generated with Claude Code

Add an "Open in External Editor" menu item with a default Cmd+E
shortcut. The editor application and shortcut are fully configurable
in Settings. No editor is pre-configured — on first use the user is
prompted to select one. Includes a custom shortcut recorder with
validation against reserved system shortcuts and unit tests for the
settings store.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant