Skip to content
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

Added flags for editing language configurations viewing the log file. #1797

Closed

Conversation

anthonyjclark
Copy link

I noticed #1771 and decided to add these two additional options. If this is unwanted, please feel free to ignore this PR. I thought this would be a good first try and I find myself using these two files a lot as I get started with helix.

Two points of which I am uncertain:

  1. How should we handle the case when, for example, someone passes both --edit-config and --edit-lang-config?
  2. Should we open the log file in read-only mode?

@archseer
Copy link
Member

I think this is a welcome change but I'd rather have all three of these as :commands or perhaps special arguments to :edit (:edit helix://config if we try parsing args as URIs first). It's much more flexible since you can use these commands at any time without reopening the editor (or open multiple: :edit helix://config 'helix://languages)

I deliberately tried to keep the CLI flags as minimal as possible.

It's OK to open the log file as editable in case you want to truncate it. Helix always logs in append-only mode

@anthonyjclark
Copy link
Author

I agree with limiting the number of flags. My personal preference would be to include all three options (config, language config, and log) or none of them.

@archseer and @jharrilim, would it be reasonable to replace the --edit-config flag with a :command and add a comment recommending an alias (e.g., alias hxc="hx $HOME/.config/helix/config.toml")?

@jharrilim
Copy link
Contributor

I'm certainly no authority on this project, but in my mind, a nice path forward towards removing --edit-config would be to make it so that not only is there a command inside the editor to edit the config, but also make it possible to reload the new config. This would let us preserve the current session's state and remove the desire/need to restart helix. Tbh, maybe this is just a matter of also adding a :refresh-config command to go along with it?

@anthonyjclark
Copy link
Author

This is being handled in #1803

@anthonyjclark anthonyjclark deleted the cli-edit-and-view-flags branch March 15, 2022 15:42
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.

3 participants