nacro90 / omen.nvim

Password manager for Neovim

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

omen.nvim

Omen is a password manager like plugin for Neovim

pick.gif

Why?

I am using pass to manage my passwords. I have been using this plugin in my config for months and I really loved picking my passwords with telescope. So, I want to create a new plugin.

Features

  • Picks your password from your password store directory
  • Asks your passphrase but never saves it
  • Decrypts the file you picked and copy the first line to clipboard
  • Clears the contents of the register after a retention
  • Uses the safe passphrase cache of gpg to easily pick multiple passwords without a passphrase

Requirements

Omen needs some external components to work:

  • gpg - GnuPG

Installation

With packer:

use {
  "nacro90/omen.nvim",
  requires = {
    "nvim-lua/telescope.nvim",
    "nvim-lua/plenary.nvim",
  },
  config = function()
    require("omen").setup()
  end
},

Config

setup gets a options table that defaults to:

{
  picker = "telescope", --- Picker type
  title = "Omen", --- Title to be displayed on the picker
  store = vim.env.HOME .. "/.password-store/", --- Password store directory
  passphrase_prompt = "Passphrase: ", --- Prompt when asking the passphrase
  register = "+", --- Which register to fill after decoding a password
  retention = 45, --- How much seconds the life of the decoded passwords in the register
  ignored = { --- Ignored directories or files that are not to be listed in picker
    ".git",
    ".gitattributes",
    ".gpg-id",
    ".stversions",
    "Recycle Bin",
  },
  use_default_keymaps = true, --- Whether display info messages or not
}

Pickers

Omen uses a telescope picker implementation by default. You can change it to vim.ui.select to use it with your favourite picker.

require("omen").setup{
  picker = "select"
}

You can load plugin as a telescope extension using:

require("telescope").load_extension "omen"

Call it as following:

:Telescope omen pick

Keymaps

Omen sets default keymaps by default.

vim.keymap.set("n", "<leader>p", omen.pick)

You can disable that using:

require("omen").setup{
  use_default_keymaps = false,
}

You can access the pick function using:

require("omen").pick()

TODO

  • Copy a password file content to a register with a retention
  • Inserting new password to the store
  • Generating new password for the store
  • Callbacks and events
  • More test coverage

Testing

make test

or with justfile:

just test

About

Password manager for Neovim


Languages

Language:Lua 98.5%Language:Makefile 0.8%Language:Vim Script 0.7%