vim-rails
vim-rails copied to clipboard
Command of editing/creating credentials?
trafficstars
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?
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
:Railsbehave the same as:Git commitin Fugitive: use jobs and a clever value of$EDITORto support editing temp files. I think this is a good idea with uses beyondcredentials: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 usingBufReadCmd, and upon writing, re-encrypt usingBufWriteCmd. A command like:Ecredentialscould 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.