feat(emacs): pass

This commit is contained in:
Pavel Korytov 2021-07-27 12:48:11 +03:00
parent 6070c4bca9
commit a26e5fa8ef
4 changed files with 56 additions and 17 deletions

View file

@ -1,5 +1,6 @@
(specifications->manifest (specifications->manifest
'( '(
"password-store"
"p7zip" "p7zip"
"fzf" "fzf"
"neofetch" "neofetch"

View file

@ -139,6 +139,7 @@
'(eww '(eww
proced proced
emms emms
pass
calendar calendar
dired dired
debug debug
@ -715,6 +716,9 @@ then it takes a second \\[keyboard-quit] to abort the minibuffer."
(setq my/project-title-separators "[-_ ]") (setq my/project-title-separators "[-_ ]")
(setq my/project-names-override-alist
'((".password-store" . "pass")))
(defun my/shorten-project-name-elem (elem crop) (defun my/shorten-project-name-elem (elem crop)
(if (string-match "^\\[.*\\]$" elem) (if (string-match "^\\[.*\\]$" elem)
(concat "[" (concat "["
@ -730,12 +734,14 @@ then it takes a second \\[keyboard-quit] to abort the minibuffer."
(concat prefix rest)))) (concat prefix rest))))
(defun my/shorten-project-name (project-name) (defun my/shorten-project-name (project-name)
(let ((elems (s-slice-at my/project-title-separators project-name))) (or
(concat (cdr (assoc project-name my/project-names-override-alist))
(apply (let ((elems (s-slice-at my/project-title-separators project-name)))
#'concat (concat
(cl-mapcar (lambda (elem) (my/shorten-project-name-elem elem t)) (butlast elems))) (apply
(my/shorten-project-name-elem (car (last elems)) nil)))) #'concat
(cl-mapcar (lambda (elem) (my/shorten-project-name-elem elem t)) (butlast elems)))
(my/shorten-project-name-elem (car (last elems)) nil)))))
(defun my/tab-bar-name-function () (defun my/tab-bar-name-function ()
(let ((project-name (projectile-project-name))) (let ((project-name (projectile-project-name)))
@ -967,11 +973,6 @@ then it takes a second \\[keyboard-quit] to abort the minibuffer."
(completing-read "Dired: " bookmarks nil nil "^") (completing-read "Dired: " bookmarks nil nil "^")
bookmarks))))) bookmarks)))))
(use-package vlf
:straight t
:config
(require 'vlf-setup))
(use-package vterm (use-package vterm
;; :straight t ;; :straight t
:commands (vterm vterm-other-window) :commands (vterm vterm-other-window)
@ -2963,6 +2964,19 @@ then it takes a second \\[keyboard-quit] to abort the minibuffer."
(evil-collection-define-key 'normal 'Info-mode-map (evil-collection-define-key 'normal 'Info-mode-map
(kbd "RET") 'Info-follow-nearest-node) (kbd "RET") 'Info-follow-nearest-node)
(defun my/man-fix-width (&rest _)
(setq-local Man-width (- (window-width) 4)))
(advice-add #'Man-update-manpage :before #'my/man-fix-width)
(use-package pass
:straight t
:commands (pass)
:init
(my-leader-def "ak" #'pass)
:config
(setq pass-show-keybindings nil))
(use-package docker (use-package docker
:straight t :straight t
:commands (docker) :commands (docker)

View file

@ -789,6 +789,7 @@ key_bindings:
| neofetch | Fetch system info | | neofetch | Fetch system info |
| fzf | fuzzy finder | | fzf | fuzzy finder |
| p7zip | archiver | | p7zip | archiver |
| password-store | CLI password manager |
| Note | Description | | Note | Description |
|------+-----------------| |------+-----------------|

View file

@ -509,6 +509,7 @@ I don't enable the entire package, just the modes I need.
'(eww '(eww
proced proced
emms emms
pass
calendar calendar
dired dired
debug debug
@ -1398,6 +1399,9 @@ Prepend tab name with the shortened projectile project title
#+begin_src emacs-lisp #+begin_src emacs-lisp
(setq my/project-title-separators "[-_ ]") (setq my/project-title-separators "[-_ ]")
(setq my/project-names-override-alist
'((".password-store" . "pass")))
(defun my/shorten-project-name-elem (elem crop) (defun my/shorten-project-name-elem (elem crop)
(if (string-match "^\\[.*\\]$" elem) (if (string-match "^\\[.*\\]$" elem)
(concat "[" (concat "["
@ -1413,12 +1417,14 @@ Prepend tab name with the shortened projectile project title
(concat prefix rest)))) (concat prefix rest))))
(defun my/shorten-project-name (project-name) (defun my/shorten-project-name (project-name)
(let ((elems (s-slice-at my/project-title-separators project-name))) (or
(concat (cdr (assoc project-name my/project-names-override-alist))
(apply (let ((elems (s-slice-at my/project-title-separators project-name)))
#'concat (concat
(cl-mapcar (lambda (elem) (my/shorten-project-name-elem elem t)) (butlast elems))) (apply
(my/shorten-project-name-elem (car (last elems)) nil)))) #'concat
(cl-mapcar (lambda (elem) (my/shorten-project-name-elem elem t)) (butlast elems)))
(my/shorten-project-name-elem (car (last elems)) nil)))))
(defun my/tab-bar-name-function () (defun my/tab-bar-name-function ()
(let ((project-name (projectile-project-name))) (let ((project-name (projectile-project-name)))
@ -4465,6 +4471,23 @@ Of course, Emacs can also display man and info pages.
(evil-collection-define-key 'normal 'Info-mode-map (evil-collection-define-key 'normal 'Info-mode-map
(kbd "RET") 'Info-follow-nearest-node) (kbd "RET") 'Info-follow-nearest-node)
(defun my/man-fix-width (&rest _)
(setq-local Man-width (- (window-width) 4)))
(advice-add #'Man-update-manpage :before #'my/man-fix-width)
#+end_src
*** pass
I use [[https://www.passwordstore.org/][pass]] as my password manager. Expectedly, there is Emacs frontend for it.
#+begin_src emacs-lisp
(use-package pass
:straight t
:commands (pass)
:init
(my-leader-def "ak" #'pass)
:config
(setq pass-show-keybindings nil))
#+end_src #+end_src
*** Docker *** Docker
A package to manage docker containers from Emacs. A package to manage docker containers from Emacs.