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

Feature request: action to copy username (and possibly other, arbitrary, fields) #6

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Hugo-Heagren
Copy link

@Hugo-Heagren Hugo-Heagren commented Jul 16, 2021

I used to use pass.el, but I've recently switched to ivy-pass. The only feature I miss is the ability to copy the username field from a pass entry. It doesn't seem too difficult to implement.

Thinking about it, and looking at the code, it would be easy and possibly useful to implement copying arbitrary fields from an entry too. I'm thinking that an action like copy-arbitrary-field would just invoke a new ivy completion over the fields of the entry, excluding the password, which could then be copied as usual.

Add action `username' on the key `u', to copy the contents of the
entry's "username" field (if it has one) to the kill ring. If there is
no such field, nothing is copied.

Fixes ecraven#6.
Hugo-Heagren added a commit to Hugo-Heagren/ivy-pass that referenced this pull request Jul 16, 2021
Add action `choose field' on the key `c', to copy the contents of an
chosen one of the entry's fields to the kill ring.

See also the second point in ecraven#6.
ivy-pass.el Outdated
@@ -88,6 +91,10 @@ Default PASSWORD-LENGTH is ‘password-store-password-length’."
"Add username for KEY to kill ring."
(password-store-copy-field key "username"))

(defun ivy-pass--choose-field-action (key)
"Choose a field from KEY's entry and copy its value to kill ring."
(password-store-copy-field (password-store-read-field key)))
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The first arg. is missing:

(password-store-copy-field key (password-store-read-field key)))

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The first arg. is missing:

Thanks. Fixed.

Add action `choose field' on the key `c', to copy the contents of an
chosen one of the entry's fields to the kill ring.

See also the second point in ecraven#6.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants