Skip to content

Conversation

@ComradeVanti
Copy link

@ComradeVanti ComradeVanti commented Oct 13, 2025

This PR implements functionality to open the current repository in an external editor. Below are the main changes:

  1. Added setting for configuring external editor path
  2. Add quick action for opening repo with editor
  3. Add global menu action for opening repo with editor
  4. Add CTRL+SHIFT+A shortcut for opening the repo

Screencast_20251013_151754

Things that could still be added:

  • Validate that the entered path is actually a code editor
  • Better error handling if no valid editor was specified. Currently, when I enter some random string like not an editor into the editor, it will still be saved and only fails once it tries to actually run that command. We then get an ugly error notification with some low-level error details. Would be nice to hide those
  • Per-project overrides for the editor setting

A few notes:

  • This is my first time contributing to this repo, so I was not sure what the best place to put things was. Please let me know if there are any corrections
  • I broke the changes into a few small commits, which can be squashed if that is preferred

This PR partially resolves #230

This change adds a quick-action for opening the current repo in editor. Right now, it is hardcoded to open it in VSCodium, since that is what I have installed, but the next change should make it configurable.
This change adds a setting/preference for the external editor to open all projects with. This change does not yet add per-project editor settings. The setting is also not used anywhere yet.
We now use the editor configured through the app settings to open the repo
We now display an error notification when no editor was set.
The check for whether the editor setting is set was done at the usage site in RepositoryOpenViewModel until now. But this logic could be relevant in other places as well. This change moves it into a new property on the AppSettingsRepository
Previously we used the Kotlin navtive API for starting the process for opening the repo in an external editor. But I just discovered the IShellManager service and assume that it is better to use this. So this change refactores to use that service.
There is now a keybind for opening the repo in an external editor. For now it is set to CTRL+SHIFT+A to match GitHub Desktop
Until now the logic for opening the current repository using an external editor was hosted in the RepositoryOpenViewModel. I noticed that the logic for opening the repo in terminal was hosted in its own use-case object, so this change also introduces such an object for the open-in-editor action
This change adds a global menu button for opening the repo in the configured external editor.
@Escain
Copy link

Escain commented Nov 5, 2025

Hi,
IMHO, this needs a bit more to be perfect:

  1. Instead of adding an editor and override per repository, it would be better to use the OS default editor for a given file type.
    For example, I have a simple text-editor configured for .cpp and .hpp, but I use other programs for images, or markdown documentation.

  2. This feature is IMHO intended for quick access to a single file, not to open the full project. That is, select a file of interest in a list and edit that file. Having a top-menu "Edit" that opens the full repository is in most of the case not even viable (several project, no evidence of what folder to look, what file to open, etc.)

With that, those 3 points of improvements (validate editor path, better handling of error and per-project override become useless).

In the hope it helps.

@ComradeVanti
Copy link
Author

ComradeVanti commented Nov 6, 2025

@Escain seems like you are talking about a separate feature. 'Open file' and 'Open project' are two different things. I understand you would like to see the 'Open file' feature added, but this has nothing to do with this PR, which is about 'Open project'. Maybe open a separate issue for your suggestion?

Having a top-menu "Edit" that opens the full repository is in most of the case not even viable (several project, no evidence of what folder to look, what file to open, etc.)

I don't know what you mean. GitHub Desktop has this feature and I use it regularly. I do it via shortcut instead of UI button, but still. If I have a project which is restricted to one folder and I would work on this project by opening that folder in say VS Code, then this is a common action to take at the start of a work session.

@Escain
Copy link

Escain commented Nov 6, 2025

I see, so it just opens the folder with the given editor/explorer. Understood.

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.

Open in editor button

2 participants