corfu
devdocs
diff-hl
+ eat
elfeed
embark-consult
emms
completion-styles '(orderless partial-completion basic)
completion-show-help nil
;; completions-header-format nil
- completion-auto-help 'visual
+ ;; completion-auto-help 'visible
completions-max-height 16
completion-auto-wrap t
corfu-cycle t
(backward-word)
(kill-region (point) end))))
+ (defun esy/ttyper ()
+ (interactive)
+ (eat "ttyper" t))
+
(defun esy/pulse-line (&optional _)
"Pulse current line."
(interactive)
(keymap-global-set "C-c C" #'esy-publish-create-post)
(keymap-global-set "C-c O" #'openai-chat)
(keymap-global-set "C-c E" #'elfeed)
+ (keymap-global-set "C-c T" #'esy/ttyper)
(keymap-global-set "C-c G" #'gnus)
(keymap-global-set "C-c M" #'mastodon)
(keymap-global-set "C-c F" #'esy/find-init-file)
(esy/init-step sql
"Configure SQL connections."
(with-eval-after-load 'sql
- (setq sql-connection-alist (let* ((a (auth-source-search :port 5432
- :max 7
- :require '(:user :port :secret :host)))
- (d (nth 0 a))
- (p (nth 1 a))
- (c (nth 2 a))
- (e (nth 3 a))
- (f (nth 4 a))
- (i (nth 5 a))
- (g (nth 6 a)))
- `((dev
- (sql-product 'postgres)
- (sql-user ,(plist-get d :user))
- (sql-port 5432)
- (sql-password ,(funcall (plist-get d :secret)))
- (sql-server ,(plist-get d :host))
- (sql-database "alerts"))
- (prod
- (sql-product 'postgres)
- (sql-user ,(plist-get p :user))
- (sql-port 5432)
- (sql-password ,(funcall (plist-get p :secret)))
- (sql-server ,(plist-get p :host))
- (sql-database "alerts"))
- (cgs
- (sql-product 'postgres)
- (sql-user ,(plist-get c :user))
- (sql-port 5432)
- (sql-password ,(funcall (plist-get c :secret)))
- (sql-server ,(plist-get c :host))
- (sql-database "container_graph"))
- (ten
- (sql-product 'postgres)
- (sql-user ,(plist-get e :user))
- (sql-port 5432)
- (sql-password ,(funcall (plist-get e :secret)))
- (sql-server ,(cadr (split-string (plist-get e :host) (rx "^"))))
- (sql-database ,(car (split-string (plist-get e :host) (rx "^")))))
- (ac
- (sql-product 'postgres)
- (sql-user ,(plist-get f :user))
- (sql-port 5432)
- (sql-password ,(funcall (plist-get f :secret)))
- (sql-server ,(cadr (split-string (plist-get f :host) (rx "^"))))
- (sql-database ,(car (split-string (plist-get f :host) (rx "^")))))
- (int
- (sql-product 'postgres)
- (sql-user ,(plist-get i :user))
- (sql-port 5432)
- (sql-password ,(funcall (plist-get i :secret)))
- (sql-server ,(cadr (split-string (plist-get i :host) (rx "^"))))
- (sql-database ,(car (split-string (plist-get i :host) (rx "^")))))
- (fin
- (sql-product 'postgres)
- (sql-user ,(plist-get g :user))
- (sql-port 5432)
- (sql-password ,(funcall (plist-get g :secret)))
- (sql-server ,(cadr (split-string (plist-get g :host) (rx "^"))))
- (sql-database ,(car (split-string (plist-get g :host) (rx "^"))))))))
+ (setq sql-connection-alist (mapcar (lambda (source)
+ (pcase (split-string (plist-get source :host)
+ (rx "^"))
+ (`(,con ,db ,host)
+ (list (intern con)
+ (list 'sql-product ''postgres)
+ (list 'sql-user (plist-get source :user))
+ (list 'sql-port (string-to-number (plist-get source :port)))
+ (list 'sql-password (funcall (plist-get source :secret)))
+ (list 'sql-server host)
+ (list 'sql-database db)))))
+ (auth-source-search :port 5432 :max 10)))
(add-hook 'sql-interactive-mode-hook #'toggle-truncate-lines)
+ (add-hook 'sql-interactive-mode-hook #'abbrev-mode)
(define-key sql-mode-map (kbd "C-c C-f") #'sqlformat)
(define-advice sql-comint-postgres (:around (fun &rest args) use-sql-password)
(let ((process-environment
(goto-char (point-min))
(read (current-buffer))))))
+(esy/init-step eat
+ "Configure Eat."
+ (with-eval-after-load 'eat
+
+ (defun esy/eat-exit-hook (process)
+ (let ((buffer (process-buffer process)))
+ (set-process-buffer process nil)
+ (when (buffer-live-p buffer)
+ (kill-buffer buffer))))
+
+ (add-hook 'eat-exit-hook #'esy/eat-exit-hook)))
+
(dolist (step (sort esy/init-step-times (lambda (l r) (time-less-p (cdr r) (cdr l)))))
(message "%f %s"
(float-time (cdr step))