Editing GPG encrypted files symmetrically in NeoVIM
Copy plugin/gpg.lua file to your ~/.config/nvim/lua/plugins/ directory
-- ~/.config/nvim/lua/plugins/gpg.lua
{
"benoror/gpg.nvim",
ft = { "gpg", "asc", "pgp" },
}
-- ~/.config/nvim/init.lua
vim.pack.add({
{ "https://github.com/benoror/gpg.nvim" },
})
vim.filetype.add({
extension = {
gpg = "gpg",
asc = "asc",
},
})
return {
"benoror/gpg.nvim",
ft = { "gpg", "asc", "pgp" },
}
Vía @Frestein Frestein/dotfiles/dot_config/nvim/lua/plugins/extras/utils/gpg.lua
gpgpinentry-macAll *.gpg files will be symmetrically decrypted/encrypted transparently using gpg tools
This plugin can update the GPG agent startup TTY (equivalent to
gpg-connect-agent updatestartuptty /bye) to keep pinentry-curses attached
to the current terminal. To enable it:
vim.g.gpg_update_tty = true
If you still see input issues with pinentry-curses, you can enable an
optional "priming" step that runs gpg --list-packets on the file before
decrypting so the passphrase is cached by the agent:
vim.g.gpg_prime_agent = true
Local smoke tests (headless Neovim, temp keyring):
make test-bash
make test-zsh
make test-nu
Plugin manager compatibility checks:
make test-lazy
make test-packer
Notes:
GNUPGHOME and a throwaway key, so your user keyring is not touched.XDG_* paths and NVIM_APPNAME to a temp directory to avoid writing artifacts into your normal Neovim runtime.tests/init_lazy.lua and tests/init_packer.lua will clone their managers if missing (network required).https://github.com/jamessan/vim-gnupg