diff --git a/init.org b/init.org index 5e1634f..55bd908 100644 --- a/init.org +++ b/init.org @@ -1,4 +1,4 @@ -#+TITLE: My Emacs Configuration +;#+TITLE: My Emacs Configuration #+PROPERTY: header-args :tangle yes #+PROPERTY: header-args:emacs-lisp :lexical yes :tangle yes :comments nil :padline yes @@ -330,6 +330,9 @@ Configures where backup files are stored: `(("." . ,(file-name-concat user-emacs-directory "backups")))) #+END_SRC +#+RESULTS: +: ((. . /home/pti/.config/emacs/backups)) + To avoid losing files when deleting in dired, move them to the trash: #+BEGIN_SRC emacs-lisp @@ -721,6 +724,85 @@ See the excellent documentation on [[https://github.com/minad/consult][Minad's c #+RESULTS: : [nil 26434 3705 536018 nil elpaca-process-queues nil nil 266000 nil] +*** TODO Add consult-omni + +Consult omni allows Alfred/Spotlight like universal searching among +many sources : filesystem, web, wikipedia, LLMs, ... + +This requires quite a bit of setup and experimentation + +for more details see [[https://github.com/armindarvish/consult-omni][the consult-omni github]] . There is a long in +depth [[https://www.youtube.com/watch?v=wNH2E7iT__c][youtube video]] demoing and going deep in the setup. + + +#+BEGIN_SRC emacs-lisp + (use-package consult-omni + :ensure (consult-omni :type git :host github :repo "armindarvish/consult-omni" :branch "main" :files (:defaults "sources/*.el")) + :after consult + :custom + ;; General settings that apply to all sources + (consult-omni-show-preview t) ;;; show previews + (consult-omni-preview-key "C-o") ;;; set the preview key to C-o + :config + ;; Load Sources Core code + (require 'consult-omni-sources) + ;; Load Embark Actions + (require 'consult-omni-embark) + + ;; Either load all source modules or a selected list + + ;;; Select a list of modules you want to aload, otherwise all sources all laoded + ; (setq consult-omni-sources-modules-to-load (list 'consult-omni-wkipedia 'consult-omni-notes)) + (consult-omni-sources-load-modules) + ;;; set multiple sources for consult-omni-multi command. Change these lists as needed for different interactive commands. Keep in mind that each source has to be a key in `consult-omni-sources-alist'. + (setq consult-omni-multi-sources '("calc" + ;; "File" + ;; "Buffer" + ;; "Bookmark" + "Apps" + ;; "gptel" + "Brave" + "Dictionary" + ;; "Google" + "Wikipedia" + "elfeed" + ;; "mu4e" + ;; "buffers text search" + "Notes Search" + "Org Agenda" + "GitHub" + ;; "YouTube" + "Invidious")) + +;; Per source customization + + ;;; Set API KEYs. It is recommended to use a function that returns the string for better security. + (setq consult-omni-google-customsearch-key "YOUR-GOOGLE-API-KEY-OR-FUNCTION") + (setq consult-omni-google-customsearch-cx "YOUR-GOOGLE-CX-NUMBER-OR-FUNCTION") + (setq consult-omni-brave-api-key "YOUR-BRAVE-API-KEY-OR-FUNCTION") + (setq consult-omni-stackexchange-api-key "YOUR-STACKEXCHANGE-API-KEY-OR-FUNCTION") + (setq consult-omni-pubmed-api-key "YOUR-PUBMED-API-KEY-OR-FUNCTION") + (setq consult-omni-openai-api-key "YOUR-OPENAI-API-KEY-OR-FUNCTION") + +;;; Pick you favorite autosuggest command. + (setq consult-omni-default-autosuggest-command #'consult-omni-dynamic-brave-autosuggest) ;;or any other autosuggest source you define + + ;;; Set your shorthand favorite interactive command + (setq consult-omni-default-interactive-command #'consult-omni-multi)) + +#+END_SRC + +#+RESULTS: +: [nil 26745 28425 788184 nil elpaca-process-queues nil nil 528000 nil] + + + + +**** TODO Create Brave Search API key + +to enable consult omni brave searches I need a brave API key. [[https://api-dashboard.search.brave.com/register][Here]] is +the account registration page.yuy i u uuu u u iu u u + ** Frequently used File/Project Operations #+BEGIN_SRC emacs-lisp @@ -1644,6 +1726,20 @@ Map the keymap consistently to the eglot mappings. #+RESULTS: : [nil 26557 44943 649 nil elpaca-process-queues nil nil 729000 nil] +*** Gitlab CI Yaml Support + +#+BEGIN_SRC emacs-lisp + (use-package gitlab-ci-mode + :ensure (:host gitlab :repo "ptillemans/gitlab-ci-mode" :branch "fixes_2024") + :mode "\\.gitlab-ci\\.yml\\'" + :custom + (gitlab-ci-url "https://gitlab.melexis.com") + (gitlab-ci-api-token (auth-source-pass-get 'secret "snamellit/gitlab/token"))) +#+END_SRC + +#+RESULTS: +: [nil 26292 38256 549743 nil elpaca-process-queues nil nil 11000 nil] + ** Debugger Support #+BEGIN_SRC emacs-lisp (report-time-since-load "Programming - Debugger Support") @@ -1767,24 +1863,6 @@ Map the keymap consistently to the eglot mappings. or leave it here but move it to config, whatever makes most sense at the moment. -** Gitlab Support - -#+BEGIN_SRC emacs-lisp -(report-time-since-load "Programming - Gitlab Support") -#+END_SRC - -#+BEGIN_SRC emacs-lisp - (use-package gitlab-ci-mode - :ensure (:host gitlab :repo "ptillemans/gitlab-ci-mode" :branch "fixes_2024") - :mode "\\.gitlab-ci\\.yml\\'" - :custom - (gitlab-ci-url "https://gitlab.melexis.com") - (gitlab-ci-api-token (auth-source-pass-get 'secret "snamellit/gitlab/token"))) -#+END_SRC - -#+RESULTS: -: [nil 26292 38256 549743 nil elpaca-process-queues nil nil 11000 nil] - ** BoilerPlate Generator The way I do advent of code requires me to create a main file and a @@ -2334,7 +2412,7 @@ We can add a list of queries **** Add support for an input file -#+BEGIN_SRC emacs-lisp +#+BEGIN_SRC emacs-lisp :tangle no (setq org-agenda-custom-commands '(("i" "Inbox" ((todo ".*" ((org-agenda-files '("~/Nextcloud/org/inbox.org")) @@ -2347,7 +2425,7 @@ We can add a list of queries **** Daily Agenda -#+BEGIN_SRC emacs-lisp +#+BEGIN_SRC emacs-lisp :tangle no (setq org-agenda-custom-commands '(("d" "Daily Agenda" ((agenda "" ((org-agenda-span 'day) @@ -2364,7 +2442,7 @@ We can add a list of queries **** Weekly Review -#+BEGIN_SRC emacs-lisp +#+BEGIN_SRC emacs-lisp (setq org-log-done 'time) ; log the time when a task is completed (setq org-agenda-start-with-log-mode t) ; show the log mode when starting the agenda @@ -2409,6 +2487,7 @@ We can add a list of queries "~/org/personal/")) (org-refile-targets '( (org-agenda-files . (:level . 1)) + ("~/org/customer/gtd.org" . (:level . 1)) ("~/org/personal/bijen.org" . (:level . 1)) ("~/org/personal/fitness.org" . (:level . 1)) )) @@ -2432,12 +2511,13 @@ We can add a list of queries (org-mode . org-indent-mode) ) :bind ( - (" o a" . org-agenda) - (" o s" . org-store-link) + ("C-c a" . org-agenda) + ("C-c l" . org-store-link) )) #+END_SRC #+RESULTS: +: org-store-link ** Denote #+BEGIN_SRC emacs-lisp @@ -2852,9 +2932,7 @@ generate code. ;; ;; Optional: Set a key binding for the transient menu :bind - (" a" . aidermacs-transient-menu) - ("C-c a" . aidermacs-transient-menu) - ) +q ) #+END_SRC #+RESULTS: @@ -2985,6 +3063,22 @@ This enables direnv globally. #+RESULTS: : [nil 26432 30485 62583 nil elpaca-process-queues nil nil 114000 nil] +** Add emacslisp-demos + +A package which enhances helpful by adding API demos to the the help + +#+BEGIN_SRC emacs-lisp + (use-package elisp-demos + :ensure t + :init + (advice-add 'helpful-update :after #'elisp-demos-advice-helpful-update)) + +#+END_SRC + +#+RESULTS: +: [nil 26745 27316 824254 nil elpaca-process-queues nil nil 497000 nil] + + ** Enable breadcrumbs Show breadcrumbs in the header line to keep context of the file being @@ -3253,16 +3347,18 @@ Configures Elfeed, an RSS feed reader for Emacs: *** TODO OPML To Elfeed #+BEGIN_SRC emacs-lisp - (use-package opml-to-elfeed-feeds - :ensure (:host "codeberg.org" :repo "kakafarm/emacs-opml-to-elfeed-feeds" - :main "opml-to-elfeed-feeds.el") - :custom (o2e-opml-list . (("https://craftering.systemcrafters.net/Craftering.opml" blog craftering opml-to-elfeed-feeds))) - :commands (o2e-opml-to-elfeed--update-o2e-efleed-feeds) - ) + (use-package opml-to-elfeed-feeds + :ensure (:host "codeberg.org" :repo "kakafarm/emacs-opml-to-elfeed-feeds" + :main "opml-to-elfeed-feeds.el") + :custom + (o2e-opml-list . (("https://craftering.systemcrafters.net/Craftering.opml" blog craftering opml-to-elfeed-feeds))) + :commands + (opml-to-elfeed-feeds-update-o2e-elfeed-feeds) + ) #+END_SRC #+RESULTS: -: [nil 26289 17361 350243 nil elpaca-process-queues nil nil 817000 nil] +: [nil 26750 42629 851189 nil elpaca-process-queues nil nil 224000 nil] This does all kind of weird things. Apparently elpaca or use-package magically namespaces all the functions and for some reason it fails