This is in preparation for general.el integration coming in 2.1.1. It is very likely that map! will change (and even more, be split into several macros). Not much, but change none-the-less. Specifically, the state keywords (e.g. :nvi, :n, :i) will be removed in favor of a :state property that takes a list, e.g. (normal visual insert). In any case, both map! and general are also relatively expensive compared to define-key and evil-define-key* (and the new define-key! macro), so use that when we can. This also means changes to either API won't affect Doom's modules in the long term.
44 lines
1.3 KiB
EmacsLisp
44 lines
1.3 KiB
EmacsLisp
;;; tools/password-store/config.el -*- lexical-binding: t; -*-
|
|
|
|
(defvar +pass-user-fields '("login" "user" "username" "email")
|
|
"A list of fields for `+pass/ivy' to search for the username.")
|
|
|
|
(defvar +pass-url-fields '("url" "site" "location")
|
|
"A list of fields for `+pass/ivy' to search for the username.")
|
|
|
|
|
|
;;
|
|
;; Plugins
|
|
;;
|
|
|
|
;; `password-store'
|
|
(setq password-store-password-length 12)
|
|
|
|
;; Fix hard-coded password-store location; respect PASSWORD_STORE_DIR envvar
|
|
(defun +password-store*read-entry (entry)
|
|
"Return a string with the file content of ENTRY."
|
|
(with-temp-buffer
|
|
(insert-file-contents
|
|
(expand-file-name (format "%s.gpg" entry) (password-store-dir)))
|
|
(buffer-substring-no-properties (point-min) (point-max))))
|
|
(advice-add #'auth-source-pass--read-entry :override #'+password-store*read-entry)
|
|
|
|
|
|
;; `pass'
|
|
(after! pass
|
|
(set! :env "PASSWORD_STORE_DIR")
|
|
(set! :evil-state 'pass-mode 'emacs)
|
|
(set! :popup "^\\*Password-Store"
|
|
'((side . left) (size . 0.25))
|
|
'((quit)))
|
|
(define-key! pass-mode-map
|
|
"j" #'pass-next-entry
|
|
"k" #'pass-prev-entry
|
|
"d" #'pass-kill
|
|
"\C-j" #'pass-next-directory
|
|
"\C-k" #'pass-next-directory))
|
|
|
|
|
|
;; Is built into Emacs 26+
|
|
(when (and EMACS26+ (featurep! +auth))
|
|
(auth-source-pass-enable))
|