]> git.eshelyaron.com Git - dotfiles.git/commitdiff
Split Completions section
authorEshel Yaron <eshel@dazz.io>
Tue, 14 Jun 2022 18:52:31 +0000 (21:52 +0300)
committerEshel Yaron <eshel@dazz.io>
Tue, 14 Jun 2022 18:52:31 +0000 (21:52 +0300)
.emacs.d/esy.org

index 64aeac692ecdee905cd9c79cd3699edbd40674d3..be922b5a6a333d065adf97d5244fff19793e6c2b 100644 (file)
@@ -128,6 +128,9 @@ For further information about Elisp headers, see [[info:elisp#Library
 #+end_src
 
 * Dutch to English translation with =define-word= and [[https://www.vertalen.nu/][vertalen.nu]]
+:PROPERTIES:
+:CUSTOM_ID: vertalen
+:END:
 
 #+begin_src emacs-lisp
   (defun vertalen--parse-vertalen ()
@@ -200,12 +203,12 @@ For further information about Elisp headers, see [[info:elisp#Library
 
   (setq package-selected-packages
         '(academic-phrases avy ace-window alert
-          all-the-icons all-the-icons-completion anzu
-          auctex-latexmk bbdb benchmark-init browse-at-remote
-          browse-kill-ring corfu command-log-mode dabbrev define-word
-          diff-hl diminish disable-mouse dockerfile-mode elfeed
-          embark-consult erlang exec-path-from-shell
-          flymake-swi-prolog ggtags git-blamed
+          all-the-icons all-the-icons-completion all-the-icons-dired
+          all-the-icons-gnus anzu auctex-latexmk bbdb benchmark-init
+          browse-at-remote browse-kill-ring corfu command-log-mode
+          dabbrev define-word diff-hl diminish disable-mouse
+          dockerfile-mode elfeed embark-consult erlang
+          exec-path-from-shell flymake-swi-prolog ggtags git-blamed
           git-timemachine gitconfig-mode gitignore-mode
           gnu-elpa-keyring-update gnuplot gnuplot-mode go-mode
           graphviz-dot-mode highlight-escape-sequences htmlize
@@ -726,25 +729,29 @@ refiling directly into deeper headings as well.
     (require 'gnus)
     (require 'gnus-icalendar)
     (setq
-          gnus-article-treat-types '("text/plain"
-                                     "text/x-verbatim"
-                                     "text/x-patch"
-                                     "text/html"
-                                     "text/calendar")
-          gnus-posting-styles `((".*dazz.*"
-                                 (address ,esy/user-mail-address-dazz))
-                                (".*mail.swi-prolog.com.*"
-                                 (address ,esy/user-mail-address-swipl))
-                                (".*"
-                                 (address ,esy/user-mail-address-gmail)))
-          gnus-icalendar-org-capture-file esy/inbox-path
-          gnus-icalendar-org-capture-headline '("Calendar")
-          calendar-date-style 'iso)
+     gnus-article-treat-types '("text/plain"
+                                "text/x-verbatim"
+                                "text/x-patch"
+                                "text/html"
+                                "text/calendar")
+     gnus-posting-styles `((".*dazz.*"
+                            (address ,esy/user-mail-address-dazz))
+                           (".*mail.swi-prolog.com.*"
+                            (address ,esy/user-mail-address-swipl))
+                           (".*"
+                            (address ,esy/user-mail-address-gmail)))
+     gnus-icalendar-org-capture-file esy/inbox-path
+     gnus-icalendar-org-capture-headline '("Calendar")
+     calendar-date-style 'iso)
     (gnus-icalendar-setup)
     (gnus-icalendar-org-setup)
     (add-hook 'gnus-group-mode-hook #'gnus-topic-mode))
 
   (add-hook 'gnus-mode-hook #'esy/customize-gnus-mode)
+
+  (with-eval-after-load 'gnus
+    (require 'all-the-icons-gnus)
+    (all-the-icons-gnus-setup))
 #+end_src
 
 * Global keybindings                                                    :kbd:
@@ -879,6 +886,15 @@ refiling directly into deeper headings as well.
 :CUSTOM_ID: applications
 :END:
 
+** Dired
+:PROPERTIES:
+:CUSTOM_ID: dired
+:END:
+
+#+begin_src emacs-lisp
+  (add-hook 'dired-mode-hook #'all-the-icons-dired-mode)
+#+end_src
+
 ** Elfeed
 :PROPERTIES:
 :CUSTOM_ID: elfeed
@@ -988,6 +1004,9 @@ does in the shell.
 #+end_src
 
 ** Slack
+:PROPERTIES:
+:CUSTOM_ID: slack
+:END:
 #+begin_src emacs-lisp
   (defun esy/slack-start ()
     (interactive)
@@ -1046,9 +1065,15 @@ does in the shell.
 :CUSTOM_ID: completions
 :END:
 
+*** Completion at point
+:PROPERTIES:
+:CUSTOM_ID: completion-at-point
+:END:
+
 #+begin_src emacs-lisp
   (defun esy/dabbrev-capf ()
     "Workaround for issue with `dabbrev-capf'."
+    (require 'dabbrev)
     (dabbrev--reset-global-variables)
     (setq dabbrev-case-fold-search nil)
     (dabbrev-capf))
@@ -1062,16 +1087,30 @@ does in the shell.
                (file  (buffer-substring-no-properties start end)))
           `(,start ,end completion--file-name-table . (:exclusive no))))))
 
-  (defun esy/setup-completions ()
-    "Setup completions related-package."
+  (defun esy/setup-completion-at-point ()
+    "Setup `completion-at-point'."
     (require 'corfu)
-    (require 'dabbrev)
+    (setq corfu-cycle t)
+    (global-corfu-mode)
+    (add-to-list 'completion-at-point-functions #'esy/dabbrev-capf)
+    (add-to-list 'completion-at-point-functions #'esy/file-capf))
+
+  (add-hook 'after-init-hook #'esy/setup-completion-at-point)
+#+end_src
+
+*** Minibuffer-based completions
+:PROPERTIES:
+:CUSTOM_ID: minibuffer-completion
+:END:
+
+#+begin_src emacs-lisp
+  (defun esy/setup-minibuffer ()
+    "setup minibuffer and completions."
     (require 'marginalia)
     (require 'orderless)
     (require 'all-the-icons)
     (require 'all-the-icons-completion)
-    (setq corfu-cycle t
-          read-extended-command-predicate #'command-completion-default-include-p
+    (setq read-extended-command-predicate #'command-completion-default-include-p
           completions-format 'one-column
           completion-auto-select nil
           completion-styles '(basic orderless)
@@ -1087,18 +1126,15 @@ does in the shell.
     (define-key minibuffer-local-completion-map
                 [remap next-line]
                 #'minibuffer-next-completion)
-    (global-corfu-mode)
-    (marginalia-mode)
-    (add-to-list 'completion-at-point-functions #'esy/dabbrev-capf)
-    (add-to-list 'completion-at-point-functions #'esy/file-capf)
     (add-hook 'marginalia-mode-hook
               #'all-the-icons-completion-marginalia-setup)
+    (marginalia-mode)
     (add-to-list 'display-buffer-alist
                  '("*Completions*"
                    (display-buffer-reuse-window display-buffer-at-bottom)
                    (window-parameters . ((mode-line-format . none))))))
 
-  (add-hook 'after-init-hook #'esy/setup-completions)
+  (add-hook 'after-init-hook #'esy/setup-minibuffer)
 #+end_src
 
 * Mode-line customizations