Skip to content

Instantly share code, notes, and snippets.

@imiric
Forked from vvicaretti/pass.zsh
Last active November 30, 2019 13:43
Show Gist options
  • Save imiric/db42a73c37015913c11884df1c32271d to your computer and use it in GitHub Desktop.
Save imiric/db42a73c37015913c11884df1c32271d to your computer and use it in GitHub Desktop.
pass.zsh
# -*- sh -*-
#
# Original plugin: https://gist.github.com/vvicaretti/cb4b2e27dadaf458eb3bc4ac215cf5fd
# Changes:
# - Made lookup case-insensitive
#
# [Pass](https://www.passwordstore.org/)
# the standard unix password manager
# [zaw](https://github.com/zsh-users/zaw)
# zsh anything.el-like widget
function zaw-src-pass() {
candidates=("${(ps:\n:)$(builtin cd ~/.password-store >/dev/null ; find . -not -wholename "./.git*" -type f ! -name .gpg-id -not -path ".git" | sort | sed -e 's/\.\/\(.*\).gpg$/\1/')}")
actions=("zaw-callback-pass-append-to-buffer")
act_descriptions=("pass" "append to edit buffer")
zstyle ':filter-select' case-insensitive yes
}
zaw-register-src -n pass zaw-src-pass
function zaw-callback-pass-append-to-buffer() {
BUFFER="pass show -c $1"
zle accept-line
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment