]> git.eshelyaron.com Git - dotfiles.git/commitdiff
Update init.el
authorEshel Yaron <me@eshelyaron.com>
Mon, 20 Mar 2023 15:02:11 +0000 (17:02 +0200)
committerEshel Yaron <me@eshelyaron.com>
Mon, 20 Mar 2023 15:02:11 +0000 (17:02 +0200)
.emacs.d/init.el

index d55693fcda42698d2f2611455150d7f240ccf839..8d16205dd91b88d1e039a6a0109653c2153a0f85 100644 (file)
  ;; configure Org capture templates
  org-capture-templates '(("t" "Todo [inbox]" entry
                           (file+headline "~/org/inbox.org" "Tasks")
-                          "** TODO %^{Task}    %^g
+                          "** TODO [#B] %^{Task}    %^g
 :PROPERTIES:
 :CreatedAt: %u
 :CapturedAt: %a
                           :immediate-finish t)
                          ("w" "Work [inbox]" entry
                           (file+headline "~/org/inbox.org" "Tasks")
-                          "** TODO %^{Task}    :work:
+                          "** TODO [#B] %^{Task}    :work:
 :PROPERTIES:
 :CreatedAt: %u
 :CapturedAt: %a
  elfeed-feeds '(
                 "https://ajroach42.com/feed.xml"
                 "https://alexschroeder.ch/wiki/feed/full/"
-                "https://amodernist.com/all.atom"
+                ("https://irreal.org/blog/?feed=rss2" emacs)
+                ("https://amodernist.com/all.atom" emacs)
                 "https://archive.casouri.cc/note/atom.xml"
                 "https://arcology.garden/updates.xml"
                 "https://atthis.link/rss.xml"
                 "https://gwern.substack.com/feed"
+                "https://typeclasses.substack.com/feed"
+                ("https://emacsninja.com/feed.atom" emacs)
+                ("https://www.devever.net/~hl/index.feed" tech)
+                ("https://unixsheikh.com/feed.rss" linux)
+                ("https://daniel.haxx.se/blog/feed/" tech)
                 "https://baty.net/feed"
                 "https://betterappsec.com/feed"
                 "https://bitspook.in/blog/feed.xml"
                 "https://jcm.libsyn.com/rss/"
                 "https://kitchen-sink.kwakk.info/feed"
                 "https://lars.ingebrigtsen.no/feed"
-                "https://lwn.net/headlines/rss"
-                "https://maggieappleton.com/rss.xml"
+                ("https://lwn.net/headlines/rss" linux)
+                ("https://maggieappleton.com/rss.xml" design)
                 "https://matklad.github.io/feed.xml"
-                "https://matt-rickard.com/rss"
+                ("https://matt-rickard.com/rss" tech)
                 "https://njoseph.me/shaarli/feed/atom?"
                 "https://node2.feed43.com/7487052648530856.xml"
                 "https://nullprogram.com/feed/"
                 "https://olddeuteronomy.github.io/index.xml"
                 "https://parasurv.neocities.org/rss.xml"
                 "https://phaazon.net/blog/feed"
-                "https://planet.emacslife.com/atom.xml"
+                ("https://planet.emacslife.com/atom.xml" emacs aggregator)
                 "https://ploum.net/atom_en.xml"
                 "https://pouria.dev/rss.xml"
                 "https://project-mage.org/rss.xml"
-                "https://reddit.com/r/prolog/.rss"
-                "https://sachachua.com/blog/feed/"
+                ("https://protesilaos.com/master.xml" emacs philosophy)
+                ("https://reddit.com/r/prolog/.rss" prolog)
+                ("https://sachachua.com/blog/feed/" emacs)
                 "https://stephanango.com/feed.xml"
                 "https://stppodcast.libsyn.com/rss"
                 "https://takeonrules.com/index.atom"
                 "https://xeiaso.net/blog.rss"
                 "https://xkcd.com/rss.xml"
                 )
+ ;; don't use bold face for unread Elfeed entries
+ elfeed-search-face-alist '((unread (default)))
  global-auto-revert-non-file-buffers t
  auto-revert-verbose nil
  query-about-changed-file t
   (interactive (list user-init-file))
   (find-file init))
 
+(defun esy/eww-target ()
+  (require 'eww)
+  (if (use-region-p)
+      (let ((target (buffer-substring-no-properties (use-region-beginning)
+                                                    (use-region-end))))
+        (add-to-history 'eww-prompt-history target)
+        target)
+    (completing-read "Browse or search: "
+                     eww-prompt-history nil nil nil
+                     'eww-prompt-history
+                     (eww-suggested-uris))))
+
 (defun esy/eww (target)
   "Browse or search for TARGET."
-  (interactive (list (if (use-region-p)
-                         (let ((target (buffer-substring-no-properties (use-region-beginning)
-                                                                       (use-region-end))))
-                           (add-to-history 'eww-prompt-history target)
-                           target)
-                       (completing-read "Browse or search: "
-                                        eww-prompt-history nil nil nil
-                                        'eww-prompt-history
-                                        (eww-suggested-uris)))))
+  (interactive (list (esy/eww-target)))
   (eww target))
 
 (with-eval-after-load 'shell
 
 ;;;; unbind some keys
 (dolist (key '("s-a" "s-d" "s-e" "s-f" "s-g" "s-h" "s-j" "s-k" "s-l"
-               "s-m" "s-o" "s-q" "s-s" "s-t" "s-u" "s-w" "s-x" "s-y"
-               "s-z"))
+               "s-m" "s-o" "s-p" "s-q" "s-s" "s-t" "s-u" "s-w" "s-x"
+               "s-y" "s-z"))
   (keymap-global-unset key))
 
 ;;;; enable some commands
 ;;;; SQL servers
 (with-eval-after-load 'sql
   (setq sql-connection-alist (let* ((a (auth-source-search :port 5432
-                                                           :max  5
+                                                           :max  6
                                                            :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)))
+                                    (f (nth 4 a))
+                                    (i (nth 5 a)))
                                `((dev
                                   (sql-product 'postgres)
                                   (sql-user ,(plist-get d :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 "^"))))))))
+                                  (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 "^"))))))))
   (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