Skip to content

Instantly share code, notes, and snippets.

@vvicaretti
Last active August 15, 2017 10:56
Show Gist options
  • Save vvicaretti/cb4b2e27dadaf458eb3bc4ac215cf5fd to your computer and use it in GitHub Desktop.
Save vvicaretti/cb4b2e27dadaf458eb3bc4ac215cf5fd to your computer and use it in GitHub Desktop.
pass.zsh
# -*- sh -*-
#
# Original plugin: https://gist.github.com/f440/9992963
# Pass now support git versioning, I patched the plugin in order to skip the
# .git directory which was listed before
#
# [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" | sed -e 's/\.\/\(.*\).gpg$/\1/')}")
actions=("zaw-callback-pass-append-to-buffer")
act_descriptions=("pass" "append to edit buffer")
}
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