You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Allow editing of collections with $EDITOR, or a way to configure the same聽#262
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!
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.
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) 馃槄
@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.
@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:
Activity
LucasPickering commentedon Jun 12, 2024
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:
$VISUAL/$EDITOR. This is simple and still allows users to use VSCode or another GUI editor by setting that env varvisual_editor: true. When enabled it will use the default editor for.ymlfiles, but when disabled it will check$VISUAL/$EDITORfalsethough because it's simplerBoth 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.
apreifsteck commentedon Jun 12, 2024
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)
$EDITORby 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.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) 馃槄
LucasPickering commentedon Jun 13, 2024
@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.
Use terminal editor for Edit Collection action
LucasPickering commentedon Jun 13, 2024
@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:
apreifsteck commentedon Jun 14, 2024
Thank you so much! It works great 馃憤
net/slumber: update to 1.5.0
net/slumber: update to 1.5.0
net/slumber: update to 1.5.0