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

Add ability to use a specified config/theme #1216

Closed
tmforshaw opened this issue Dec 1, 2021 · 8 comments · Fixed by #2666
Closed

Add ability to use a specified config/theme #1216

tmforshaw opened this issue Dec 1, 2021 · 8 comments · Fixed by #2666
Labels
A-helix-term Area: Helix term improvements C-enhancement Category: Improvements

Comments

@tmforshaw
Copy link

I'd like to be able to use helix as root user but still keep my config and theme.

In vim you can pass a config file using the -u flag

sudo vim -u /home/user/.vimrc /path/to/file.txt

Maybe helix could accept a -c flag so that any config file can be used.

sudo hx -c /home/user/.config/helix/config.toml /path/to/file.txt

Thanks for reading :)

@tmforshaw tmforshaw added the C-enhancement Category: Improvements label Dec 1, 2021
@kirawi kirawi added the A-helix-term Area: Helix term improvements label Dec 1, 2021
@sudormrfbin
Copy link
Member

For your specific usecase the recommended way would be to use sudoedit after setting $EDITOR to hx.

@tmforshaw
Copy link
Author

I saw that I could do that, but I don't have sudo installed on my system as I use doas.

If this is the solution then I will use it for now, but I still think this would be a nice feature in the future.

Thanks for your reply

@NNBnh
Copy link
Contributor

NNBnh commented Dec 1, 2021

Good new: doasedit exist!

@tmforshaw
Copy link
Author

Ah wow, that is good news!

Thanks a lot

@the-mikedavis
Copy link
Member

The new configuration in #2135 should help make this easier to implement: we can have a single switch for the config file and then the config file can point to other configuration files and directories.

@yuuyins
Copy link

yuuyins commented Jul 23, 2022

i don't use helix as my primary editor i can't set it to $EDITOR. so having the option --config path/to/config is pretty useful

@sudormrfbin
Copy link
Member

@yuuyins You could also set $SUDO_EDITOR instead of $EDITOR. This doesn't help if you want to use another editor and helix interchangeably with sudo though.

@yuuyins
Copy link

yuuyins commented Jul 24, 2022

@sudormrfbin that worked thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-helix-term Area: Helix term improvements C-enhancement Category: Improvements
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants