Deft mode; pollen mode; misc. changes

This commit is contained in:
Jeremy Dormitzer 2019-06-03 10:48:42 -04:00
parent 9bf2fa3a06
commit 0c26353090

View File

@ -163,6 +163,10 @@ Requires:
(eval-when-compile (require 'subr-x))
#+END_SRC
** Editing Elisp
#+BEGIN_SRC emacs-lisp
(general-def 'motion emacs-lisp-mode "C-c C-c" #'eval-defun)
#+END_SRC
** Load path
For machine or user specific libraries:
#+BEGIN_SRC emacs-lisp
@ -742,8 +746,7 @@ Always show inline images:
(setq org-agenda-custom-commands
'(("T" "Today's list"
((agenda)
(todo "TODO" ((org-agenda-files `(,(agenda-files "today.org")))))
(todo "WAITING" ((org-agenda-files `(,(agenda-files "today.org")))))))))
(tags "today")))))
#+END_SRC
** Keybindings
@ -1353,8 +1356,7 @@ Magit is objectively the best Git interface.
#+BEGIN_SRC emacs-lisp
(jdormit/define-prefix "g" "git")
(leader-def-key "gs" #'magit-status)
(leader-def-key "gb" #'magit-blame-popup)
(leader-def-key "gf" #'magit-file-popup)
(leader-def-key "gb" #'magit-blame)
#+END_SRC
Use ido-mode for completion within Magit:
@ -2588,7 +2590,7 @@ The Emacs Multi-Media System. For libtag to work, libtag must be installed on th
* SQL
Emacs has excellent built-in SQL support.
#+BEGIN_SRC emacs-lisp
(leader-def-key "sg" #'sql-postgres)
(leader-def-key "sP" #'sql-postgres)
#+END_SRC
* GraphQL
#+BEGIN_SRC emacs-lisp
@ -2844,11 +2846,11 @@ The aws-mfa command:
(cl-flet ((op-get-item (op-fn "get" "item" item)))
(json-read-from-string (op-get-item))))
(defun op-get-item-password (item-json)
(defun op-get-item-field (item-json field-designation)
(let* ((fields (assoc-recursive item-json 'details 'fields))
(pw-field (car (seq-filter
(lambda (field)
(string= "password" (cdr (assoc 'designation field))))
(string= field-designation (cdr (assoc 'designation field))))
fields))))
(when pw-field (cdr (assoc 'value pw-field)))))
@ -2856,11 +2858,12 @@ The aws-mfa command:
(interactive
(list
(ido-completing-read+ "1Password item: " (op-list-items))))
(if-let ((password (op-get-item-password (op-get-item item))))
(if-let ((password (op-get-item-field (op-get-item item) "password")))
(with-temp-buffer
(insert password)
(copy-region-as-kill (point-min) (point-max))
(message "Copied password for \"%s\" to kill ring." item))
;; TODO if no password found, prompt for alternate field in record to return
(error "No password found in 1Password for \"%s\"." item)))
(leader-def-key "ao" #'op-copy-password)
@ -2889,3 +2892,24 @@ Emacs frontend for networkmanager.
(leader-def-key "an" #'enwc)
:commands (enwc))
#+END_SRC
* Deft
A fuzzy-finder for notes.
#+BEGIN_SRC emacs-lisp
(use-package deft
:init
(setq deft-extensions '("org" "txt" "md" "markdown" "text"))
:config
(setq deft-directory (concat (file-name-as-directory (get-dropbox-directory))
"deft")
deft-use-filter-string-for-filename t
deft-file-naming-rules '((noslash . "-")
(nospace . "-")
(case-fn . downcase)))
(add-to-list 'evil-emacs-state-modes 'deft-mode)
(leader-def-key "D" #'deft)
(add-to-list 'org-agenda-files deft-directory))
#+END_SRC
* Pollen
#+BEGIN_SRC emacs-lisp
(use-package pollen-mode)
#+END_SRC