Skip to content

Allow editing of collections with $EDITOR, or a way to configure the same聽#262

Closed

Description

@apreifsteck

Did you search for existing issues already?
Yes 馃憤

Is your feature request related to a problem? Please describe.
When I take an Action to edit a collection, VSCode is opened to edit the file. While VSCode is installed on my machine and is my default application for editing most documents, I don't actually use it. I edit most any file in a terminal editor like Helix.

Describe the solution you'd like
Have the Edit Collection action open a buffer to edit the collection using the configured $EDITOR, or a way to configure this to occur

I also found this reddit thread about using Automator to open up a terminal and launch Helix for a file, but that's not really what I'm looking for either.

Describe alternatives you've considered
I could always just open up another terminal pane, so this is really more of a qol thing.

Additional context
broot has some configuration options to this effect.
broot is the best example of what I'm looking for, because when you close the $EDITOR buffer it takes you back to the broot tui. Git would be the second best example; when you're rebasing or editing a commit message or something like that.

As an aside, thank you very much for building this tool, it is fantastic!

Activity

  1. LucasPickering commented on Jun 12, 2024

    @LucasPickering
    Owner

    Thank you for the very detailed feature request :) It makes my job much easier. This is totally possible and it looks like gitui supports it (added in this PR). I see two possible implementations for this:

    • Always use the editor defined in $VISUAL/$EDITOR. This is simple and still allows users to use VSCode or another GUI editor by setting that env var
    • Add a configuration flag like visual_editor: true. When enabled it will use the default editor for .yml files, but when disabled it will check $VISUAL/$EDITOR
      • Default value could go either way, I would learn toward false though because it's simpler

    Both are equally feasible from a technical standpoint so it's entirely a usability question. My intuition is that Slumber users are generally going to be at least moderately comfortable in the terminal; it's unlikely someone is uncomfortable using a terminal editor but wants a terminal HTTP client. Additionally, we would simply be mirroring the behavior of git, and I would also guess that the vast majority of Slumber users are comfortable with the git CLI. I'm going to get started on implementation, and I'll think about this question a bit more.

    Edit: Your example of broot is helpful, since that aligns with the second option I laid out. I think the major difference here is we know the file being opened is YAML and therefore can be opened by a text editor, whereas in broot it could be anything so it needs to defer to the system to find an appropriate app.

  2. added
    featureNew behavior to enable things that were previously not possible
    on Jun 12, 2024
  3. apreifsteck commented on Jun 12, 2024

    @apreifsteck
    Author

    Thanks for taking a look!

    I think your intuition is spot on. I don't have too much of a preference myself, but if you're having trouble picking a route to go with, I can give my two cents (for what it's worth)

    • Using $EDITOR by default could lead to a more streamlined experience, since users won't have to wait for an app to load (maybe not a big deal if it's already open? Like I said, I never have mine open), and it could be less of a context switch (same window and all that), but it would be a change from the current default.
    • Are your users cool with breaking backwards compatibility? I saw you have a Discord, maybe that's a place to talk more if you need guidance, or...
    • What would you prefer? Seems to me that one of the big perks of being the project owner is that you can shape the project in whatever way you like best 馃槃

    Regardless of what you end up deciding, it'll 100% work. Thanks again for getting started on this so quickly!

    Edit: I tried to join the Discord after mentioning it, but when I clicked on the link it said the invite was invalid (may have expired) 馃槄

  4. LucasPickering commented on Jun 13, 2024

    @LucasPickering
    Owner

    @apreifsteck Thanks for pointing out the Discord link. I swear I set it to never expire but apparently not... I just made a new link if you want to try joining again.

  5. added a commit that references this issue on Jun 13, 2024
    1fea290
  6. LucasPickering commented on Jun 13, 2024

    @LucasPickering
    Owner

    @apreifsteck Just released a beta version with this change in it, do you mind testing it out? I just want to make sure there's no bugs around handing the terminal off to vim or coming back. You can install with:

    cargo install slumber --version 1.5.0-beta.1
    
  7. apreifsteck commented on Jun 14, 2024

    @apreifsteck
    Author

    Thank you so much! It works great 馃憤

  8. added a commit that references this issue on Jun 19, 2024
  9. added a commit that references this issue on May 11, 2026
  10. added a commit that references this issue on May 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureNew behavior to enable things that were previously not possible

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions