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

Command of editing/creating credentials? #553

Open
bekicot opened this issue Apr 15, 2020 · 1 comment
Open

Command of editing/creating credentials? #553

bekicot opened this issue Apr 15, 2020 · 1 comment

Comments

@bekicot
Copy link

bekicot commented Apr 15, 2020

I tried

:Rails credentials:edit

but the editor does some weird stuff, instead of open the buffer for credentials edits.

Maybe commands like:

:Ecredentials

What do you think?

@tpope
Copy link
Owner

tpope commented Apr 19, 2020

The way rails credentials:edit works is it decrypts credentials.yml.enc to a temp file, opens that temp file in your editor, and re-encrypts upon exiting the editor. Two rails.vim solutions spring to mind:

  • Make :Rails behave the same as :Git commit in Fugitive: use jobs and a clever value of $EDITOR to support editing temp files. I think this is a good idea with uses beyond credentials:edit, but Fugitive's new functionality is a work in progress and I'm not ready to extract it yet.
  • Upon editing credentials.ymc.enc, load in the unencrypted contents using BufReadCmd, and upon writing, re-encrypt using BufWriteCmd. A command like :Ecredentials could be paired with this, but I tend not to have one off commands for configuration files, as there are just too many of them.

I'll do the former eventually. If you're looking to take action, feel free to investigate the latter. afterimage.vim might provide inspiration.

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

No branches or pull requests

2 participants