Edit Rails Credentials with Neovim
These instructions will allow you to edit your Rails credentials file using Neovim.
Run the following command from your Rails application:
VISUAL=nvim bin/rails credentials:edit
Neovim runs in the foreground, so it does not need a separate wait option. Rails will wait until Neovim exits before continuing.
When you are done making your changes, press Escape to return to Normal mode, then enter :wq to save the file and quit Neovim.
Rails will then read the temporary decrypted file and write the updated contents back to the encrypted credentials file.
To edit credentials for a specific environment, add the environment option:
VISUAL=nvim bin/rails credentials:edit --environment production