]> git.donarmstrong.com Git - lib.git/blobdiff - emacs_el/configuration/don-configuration.org
defer loading polymode
[lib.git] / emacs_el / configuration / don-configuration.org
index e771943e9ac9fa6f4b411d301da76b4cae2ff4d9..cae5e62759d57588d867699f7b835749ead53c49 100644 (file)
@@ -525,22 +525,35 @@ value, scrolling continues until there is no more output.
 ** Corfu
 #+BEGIN_SRC emacs-lisp
 (use-package corfu
-  :ensure t
-  :demand t
   ;; Optional customizations
   :custom
   (corfu-cycle t)                ;; Enable cycling for `corfu-next/previous'
   (corfu-auto t)                 ;; Enable auto completion
   (corfu-separator ?\s)          ;; Orderless field separator
-  (corfu-quit-at-boundary nil)   ;; Never quit at completion boundary
-  (corfu-quit-no-match nil)      ;; Never quit, even if there is no match
+  (corfu-quit-at-boundary t)
+  (corfu-quit-no-match 'separator)
   (corfu-preview-current nil)    ;; Disable current candidate preview
   (corfu-preselect 'prompt)      ;; Preselect the prompt
   (corfu-on-exact-match nil)     ;; Configure handling of exact matches
   (corfu-scroll-margin 5)        ;; Use scroll margin
 
+  :bind (
+         :map corfu-map
+              ("M-m" , corfu-move-to-minibuffer)
+              )
+  :init
+  (global-corfu-mode)
+  (setq completion-cycle-threshold 3)
+  (setq tab-always-indent 'complete)
   :config
-  (global-corfu-mode))
+  (defun corfu-move-to-minibuffer ()
+    (interactive)
+    (when completion-in-region--data
+      (let ((completion-extra-properties corfu--extra)
+            completion-cycle-threshold completion-cycling)
+        (apply #'consult-completion-in-region completion-in-region--data))))
+  (add-to-list 'corfu-continue-commands #'corfu-move-to-minibuffer)
+  )
 #+END_SRC
 ** Dabbrv
 #+BEGIN_SRC emacs-lisp
@@ -576,15 +589,18 @@ value, scrolling continues until there is no more output.
   )
 (use-package magit-annex
   :defer t
+  :after magit
   )
 (use-package magit-vcsh
   :defer t
+  :after magit
   )
 #+END_SRC
 
 *** Forge (github/gitlab)
 #+BEGIN_SRC emacs-lisp
 (use-package forge
+  :defer t
   :after magit
   )
 #+END_SRC
@@ -592,15 +608,15 @@ value, scrolling continues until there is no more output.
 ** Perl
 #+BEGIN_SRC emacs-lisp
 (use-package cperl-mode
+  :mode ("\\.pl'" . cperl-mode)
+  ("\\.perl5\\'" . cperl-mode)
+  ("\\.perl\\'" . cperl-mode)
+  ("\\.miniperl\\'" . cperl-mode)
+  ("\\.\\([Pp][Llm]\\|al\\)\\'" . cperl-mode)
+    ;; use c-mode for perl .xs files
+  ("\\.xs\\'" . c-mode)
   :config
-  (progn
-    ;; Use c-mode for perl .xs files
-    (add-to-list 'auto-mode-alist '("\\.xs\\'" . c-mode))
-    (add-to-list 'auto-mode-alist '("\\.\\([pP][Llm]\\|al\\)\\'" . cperl-mode))
-    (add-to-list 'interpreter-mode-alist '("perl" . cperl-mode))
-    (add-to-list 'interpreter-mode-alist '("perl5" . cperl-mode))
-    (add-to-list 'interpreter-mode-alist '("miniperl" . cperl-mode))
-    (setq cperl-hairy t
+       (setq cperl-hairy t
           cperl-indent-level 4
           cperl-auto-newline nil
           cperl-auto-newline-after-colon nil
@@ -615,13 +631,12 @@ value, scrolling continues until there is no more output.
           cperl-tab-always-indent t)
     (setq cperl-lazy-help-time nil)
     ;;(add-hook 'cperl-mode-hook (lambda () (cperl-set-style "PerlStyle")))
-))
+)
 #+END_SRC
 
 ** Markdown mode
 #+BEGIN_SRC emacs-lisp
 (use-package markdown-mode
-  :ensure t
   :defer t
   :mode (("\\.md\\'" . markdown-mode)
          ("\\.mdwn\\'" . markdown-mode)
@@ -641,9 +656,11 @@ value, scrolling continues until there is no more output.
 #+BEGIN_SRC emacs-lisp
 ; load sql-indent when sql is loaded
 (use-package sql-indent
+  :after sql
   :hook sql-mode
   )
 (use-package sql
+  :commands (sql-mode)
   :mode (("\\.sql\\'" . sql-mode))
   )
 #+END_SRC
@@ -749,8 +766,7 @@ Attempts to automatically identify the right indentation for a file
 ** Orderless: advanced completion style
 #+begin_src emacs-lisp
 (use-package orderless
-  :demand t
-  :config
+  :init
   ;; Configure a custom style dispatcher (see the Consult wiki)
   ;; (setq orderless-style-dispatchers '(+orderless-dispatch)
   ;;       orderless-component-separator #'orderless-escapable-split-on-space)
@@ -793,6 +809,12 @@ Attempts to automatically identify the right indentation for a file
   :hook
   (embark-collect-mode . consult-preview-at-point-mode))
 #+end_src
+** which-key (show possible completions of a key combination)
+#+BEGIN_SRC emacs-lisp
+(use-package which-key
+  :demand t
+  )
+#+END_SRC
 ** Consult
 #+begin_src emacs-lisp
 (use-package consult
@@ -1033,7 +1055,7 @@ _d_: subtree
 #+END_SRC
 ** LaTeX
 #+BEGIN_SRC emacs-lisp
-(use-package tex-site
+(use-package tex
   :straight auctex
   :mode ("\\.tex\\'" . LaTeX-mode)
   :mode ("\\.bib\\'" . bibtex-mode)
@@ -1187,6 +1209,7 @@ From http://julien.danjou.info/projects/emacs-packages#rainbow-mode, this colori
 
 #+BEGIN_SRC emacs-lisp
 (use-package rainbow-mode
+  :delight ðŸŒˆ
   ;; add ess to the x major mode
   :config (add-to-list 'rainbow-x-colors-major-mode-list 'ESS[S])
   (add-to-list 'rainbow-x-colors-major-mode-list 'ESS[R])
@@ -1217,6 +1240,7 @@ From http://julien.danjou.info/projects/emacs-packages#rainbow-mode, this colori
   :mode ("\\.Rmd" . poly-markdown+r-mode)
   )
 (use-package polymode
+  :defer t
   )
 
 #+END_SRC