Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow copying a specific field through M-o #8

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
allow copying a specific field through M-o
freesteph committed Sep 9, 2021
commit a58a3469db4ee71bca386150aaa849067fd62068
1 change: 1 addition & 0 deletions README.org
Original file line number Diff line number Diff line change
@@ -13,3 +13,4 @@ The default action is to copy the password to the kill ring.
- add an entry (=a=)
- rename an entry (=r=)
- generate a new entry (=g=)
- copy a specific field within the entry (=f=)
8 changes: 8 additions & 0 deletions ivy-pass.el
Original file line number Diff line number Diff line change
@@ -40,6 +40,9 @@
("d"
ivy-pass--delete-action
"delete")
("f"
ivy-pass--field-action
"copy field")
("a"
ivy-pass--add-action
"add")
@@ -50,6 +53,11 @@
ivy-pass--generate-action
"generate")))

(defun ivy-pass--field-action (key)
"Copy a specific field from the KEY entry."
(let ((field (password-store-read-field key)))
(password-store-copy-field key field)))

(defun ivy-pass--add-action (key)
"Ask for a new key based on KEY, then edit it."
(let ((new-key (read-string "New key: " key)))