Skip to content

Instantly share code, notes, and snippets.

@f440
Created April 5, 2014 14:51
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save f440/9992963 to your computer and use it in GitHub Desktop.
Save f440/9992963 to your computer and use it in GitHub Desktop.
Incremental search for pass by zaw
# -*- sh -*-
# [Pass](http://www.zx2c4.com/projects/password-store/)
# 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 . -type f ! -name .gpg-id | 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