]> git.eshelyaron.com Git - dotfiles.git/commitdiff
Update Emacs and Bash configurations
authorEshel Yaron <me@eshelyaron.com>
Fri, 9 Jun 2023 07:41:16 +0000 (10:41 +0300)
committerEshel Yaron <me@eshelyaron.com>
Fri, 9 Jun 2023 07:41:16 +0000 (10:41 +0300)
.bash_profile [new file with mode: 0644]
.bashrc [new file with mode: 0644]
.emacs.d/init.el
Brewfile [new file with mode: 0644]

diff --git a/.bash_profile b/.bash_profile
new file mode 100644 (file)
index 0000000..62dd079
--- /dev/null
@@ -0,0 +1,2 @@
+PATH="/Users/eshelyaron/.cargo/bin:/Users/eshelyaron/emacs/nextstep/Emacs.app/Contents/MacOS:$PATH"
+
diff --git a/.bashrc b/.bashrc
new file mode 100644 (file)
index 0000000..92a81f0
--- /dev/null
+++ b/.bashrc
@@ -0,0 +1,8 @@
+PATH="/Users/eshelyaron/.cargo/bin:/Users/eshelyaron/emacs/nextstep/Emacs.app/Contents/MacOS:$PATH"
+LDFLAGS="-L/usr/local/opt/libarchive/lib"
+CPPFLAGS="-I/usr/local/opt/libarchive/include -I/Users/eshelyaron/emacs/nextstep/Emacs.app/Contents/Resources/include"
+PKG_CONFIG_PATH="/usr/local/opt/libarchive/lib/pkgconfig"
+
+PS1='\w \$ '
+
+[ -n "$EAT_SHELL_INTEGRATION_DIR" ] && source "$EAT_SHELL_INTEGRATION_DIR/bash"
index 921670e261b594531b542c2d736b7a865bf838b0..ae7f08804e0915f3c0f58fe55c44f5787eca2ed3 100644 (file)
@@ -87,6 +87,7 @@
                                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)
@@ -723,66 +729,20 @@ as the initial input for completion, and return that directory."
 (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
@@ -1102,6 +1062,18 @@ as the initial input for completion, and return that directory."
        (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))
diff --git a/Brewfile b/Brewfile
new file mode 100644 (file)
index 0000000..dbf8ea5
--- /dev/null
+++ b/Brewfile
@@ -0,0 +1,40 @@
+tap "homebrew/bundle"
+tap "homebrew/cask-fonts"
+tap "homebrew/services"
+brew "autoconf"
+brew "automake"
+brew "awscli"
+brew "bash"
+brew "cmake"
+brew "dbus"
+brew "gcc"
+brew "git"
+brew "gnutls"
+brew "gnupg"
+brew "gtk+3"
+brew "imagemagick"
+brew "ispell"
+brew "jansson"
+brew "kubernetes-cli"
+brew "libarchive"
+brew "libgccjit"
+brew "libpq", link: true
+brew "libxpm"
+brew "libyaml"
+brew "mailutils"
+brew "mupdf"
+brew "ninja"
+brew "node@16"
+brew "pgformatter"
+brew "pinentry-mac"
+brew "pkg-config"
+brew "poppler"
+brew "postgresql@15"
+brew "ripgrep"
+brew "stow"
+brew "texinfo"
+brew "tree-sitter"
+cask "font-iosevka"
+cask "font-iosevka-aile"
+cask "font-iosevka-etoile"
+cask "iterm2"