-
-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow editing of collections with $EDITOR
, or a way to configure the same
#262
Comments
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:
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. |
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)
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. |
Instead of using the default system editor for `.yml` files when launching the Edit Collection action, we now defer to the `$VISUAL`/`$EDITOR` env vars. This means we will probably open a text-based editor like vim, where previously it was likely a GUI editor like VSCode. This could potentially be annoying but I think in most cases will be more convenient for users. If we get complaints we can make it configurable. Closes #262
@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:
|
Thank you so much! It works great 👍 |
[1.5.0] - 2024-06-17 Added - Add `!env` chain source, for loading environment variables - This is intended to replace the existing `{{env.VARIABLE}}` syntax, which is now deprecated and will be removed in the future Changed - "Edit Collection" action now uses the editor set in `$VISUAL`/`$EDITOR` instead of whatever editor you have set as default for `.yaml`/`.yml` files [#262](LucasPickering/slumber#262) - In most cases this means you'll now get `vim` instead of VSCode or another GUI editor - Closing the editor will return you to Slumber, meaning you can stay in the terminal the entire time Fixed - Environment variables in `{{env.VARIABLE}}` templates are now loaded as strings according to the OS encoding, as opposed to always being decoded as UTF-8
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 occurI 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!
The text was updated successfully, but these errors were encountered: