Tuesday, December 10, 2024
Neovim plugin for encrypting and decrypting text files inside neovim using
age
with ease.
Install Age using your favorite plugin manager. For example, with lazy.nvim:
-- ~/.config/nvim/lua/plugins/age.lua
{
'abhi-xyz/age.nvim',
cmd = { "Age" },
config = function()
local key = require('key')
require('age').setup({
encrypt_and_del = true, -- will remove the original file after encrypting.
public_key = "ageXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
private_key = key.private_key, -- defined in another lua file which is not included in git for safety
})
end
}
-- ~/.config/nvim/lua/key.lua
return {
private_key = "AGE-SECRET-KEY-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
}
Age provides the :Age
command with the following syntax:
:Age [action]
[action]
can be one of:encrypt
,decrypt
,genkey
:Age genkey
:Age encrypt
:Age decrypt
age is a simple, modern and secure file encryption tool.
It features small explicit keys, no config options, and UNIX-style composability.