]> git.donarmstrong.com Git - lib.git/blobdiff - emacs_el/configuration/don-configuration.org
we use straight; don't ensure markdown mode
[lib.git] / emacs_el / configuration / don-configuration.org
index 62a5fcfc77e21a5d316a926838a34d8c311ec6b6..b0375de9da912895a89cd89a1e943f4a2890b43e 100644 (file)
@@ -201,8 +201,9 @@ To look up options for symbols for delight, check out https://en.wikipedia.org/w
 ** Flyspell πŸ 
 #+BEGIN_SRC emacs-lisp
 (use-package flyspell
-  :delight flyspell-mode πŸ
+  :delight flyspell-mode πŸ
   :config
+  (setq flyspell-mode-line-string " πŸ")
   (add-hook 'text-mode-hook 'turn-on-flyspell)
   (add-hook 'c-mode-common-hook 'flyspell-prog-mode)
   (add-hook 'cperl-mode-hook 'flyspell-prog-mode)
@@ -210,7 +211,6 @@ To look up options for symbols for delight, check out https://en.wikipedia.org/w
   :init
   (setq ispell-program-name "ispell")
   )
-
 #+END_SRC
 
 ** Flycheck
@@ -483,23 +483,33 @@ value, scrolling continues until there is no more output.
   ; (setq-local completion-at-point-functions (list (cape-capf-buster #'lsp-completion-at-point)))
 
   :hook (python-mode . lsp-deferred)
+        (cperl-mode . lsp-deferred)
   (lsp-completion-mode . my/lsp-mode-setup-completion)
   :custom
   (lsp-completion-provider :none) ;; we use Corfu!
+  :config
+   (add-to-list 'lsp-file-watch-ignored-directories "[/\\\\]venv\\'")
 )
-;; Provides visual help in the buffer 
-;; For example definitions on hover. 
-;; The `imenu` lets me browse definitions quickly.
+#+END_SRC
+** LSP mode
+#+BEGIN_SRC emacs-lisp
+;; provides visual help in the buffer 
+;; for example definitions on hover. 
+;; the `imenu` lets me browse definitions quickly.
 (use-package lsp-ui
   :defer t
+  :after lsp-mode
   :config
-  (setq lsp-ui-sideline-enable nil
+  (setq lsp-ui-sideline-enable t
            lsp-ui-doc-delay 2)
   :hook (lsp-mode . lsp-ui-mode)
   :bind (:map lsp-ui-mode-map
-             ("C-c i" . lsp-ui-imenu)))
-;; Language server for Python 
-;; Read the docs for the different variables set in the config.
+             ("c-c i" . lsp-ui-imenu)))
+#+END_SRC
+*** LSP Pyright -- Python language server
+#+BEGIN_SRC emacs-lisp
+;; language server for python 
+;; read the docs for the different variables set in the config.
 (use-package lsp-pyright
   :defer t
   :config
@@ -515,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
@@ -566,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
@@ -582,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
@@ -611,7 +637,6 @@ value, scrolling continues until there is no more output.
 ** Markdown mode
 #+BEGIN_SRC emacs-lisp
 (use-package markdown-mode
-  :ensure t
   :defer t
   :mode (("\\.md\\'" . markdown-mode)
          ("\\.mdwn\\'" . markdown-mode)
@@ -1360,18 +1385,20 @@ From http://julien.danjou.info/projects/emacs-packages#rainbow-mode, this colori
 (use-package python-mode
   :delight Py πŸ
   :hook
-  (python-mode . pyenv-mode)
+  (python-mode . pyvenv-mode)
   (python-mode . flycheck-mode)
   (python-mode . blacken-mode)
   (python-mode . yas-minor-mode)
   (python-mode . anaconda-mode)
   )
-(use-package pyenv-mode
+(use-package pyvenv
+  :delight
   :after python-mode
   )
 (use-package blacken
-  :delight βš‘
+  :delight
   :after python-mode
+  :commands (blacken-buffer)
   :config
   (setq-default blacken-fast-unsafe t)
 )
@@ -1379,7 +1406,8 @@ From http://julien.danjou.info/projects/emacs-packages#rainbow-mode, this colori
 *** Black
 #+begin_src emacs-lisp :tangle yes
 (use-package python-black
-  :demand t
+  :delight
+  :commands (python-black-buffer python-black-statement)
   :after python)
 #+end_src
 *** Sphinx Documentation
@@ -1389,11 +1417,11 @@ From http://julien.danjou.info/projects/emacs-packages#rainbow-mode, this colori
   :bind (:map python-mode-map
               ("C-c C-n" . numpydoc-generate)))
 (use-package sphinx-doc
+  :delight πŸˆ
   :config
-  (sphinx-doc-mode t)
   (setq sphinx-doc-include-types t)
   :after python
-  :hook (python-mode . sphinx-doc)
+  :hook (python-mode . sphinx-doc-mode)
   )
 (use-package python-docstring
   :delight 
@@ -1401,6 +1429,13 @@ From http://julien.danjou.info/projects/emacs-packages#rainbow-mode, this colori
   :hook (python-mode . python-docstring-mode)
   )
 #+end_src
+*** Anaconda Mode (Documentation lookup and completion)
+#+BEGIN_SRC emacs-lisp
+(use-package anaconda-mode
+  :delight
+  :after python
+)
+#+END_SRC
 ** Go language
 #+BEGIN_SRC emacs-lisp
 (use-package go-mode
@@ -1432,6 +1467,22 @@ From http://julien.danjou.info/projects/emacs-packages#rainbow-mode, this colori
   
   )
 #+END_SRC
+** Apache
+#+BEGIN_SRC emacs-lisp
+(use-package apache-mode
+  :delight πŸͺΆ
+  :mode "apache\\.conf\\'"
+  )
+#+END_SRC
+** ELDoc
+#+BEGIN_SRC emacs-lisp
+(use-package eldoc
+  :delight
+  :commands eldoc-mode
+  :straight nil
+  )
+#+END_SRC
+
 * Email
 ** Mutt
 *** Message-mode
@@ -1445,7 +1496,9 @@ From http://julien.danjou.info/projects/emacs-packages#rainbow-mode, this colori
   :hook 'my/message-mode-settings
   :hook 'turn-on-flyspell
   :bind (:map message-mode-map
-      ("C-c C-a" . my/post-attach-file))
+      ("C-c C-a" . my/post-attach-file)
+      ("C-x p" . my/message-kill-buffer)
+      )
   :config
   (defun my/message-mode-settings ()
     (font-lock-add-keywords nil
@@ -1454,7 +1507,10 @@ From http://julien.danjou.info/projects/emacs-packages#rainbow-mode, this colori
               ("^[ \t]*>[ \t]*>.*$"
                (0 'message-double-quoted-text-face))))
     )
-
+  (defun my/message-kill-buffer ()
+    (interactive)
+    (kill-buffer nil)
+    )
   (defun my/post-attach-file ()
     "Prompt for an attachment."
     (interactive)
@@ -1519,7 +1575,7 @@ From http://julien.danjou.info/projects/emacs-packages#rainbow-mode, this colori
 (use-package org
   :delight (org-mode "ΓΈ")
   :mode ("\\.\\(org\\|org_archive\\|txt\\)\\'" . org-mode)
-  :bind (("C-c l . org-store-link)
+  :bind (("C-c l l" . org-store-link)
          ("C-c a"  . org-agenda)
          ("C-c b"  . org-iswitchb))
 #+END_SRC
@@ -2470,45 +2526,45 @@ same directory as the org-buffer and insert a link to this file."
 #+END_SRC
 ** appt integration
 #+BEGIN_SRC emacs-lisp
-  (use-package appt
-    :ensure f
-    :config
-    ;; Show notification 10 minutes before event
-    (setq appt-message-warning-time 10)
-    ;; Disable multiple reminders
-    (setq appt-display-interval appt-message-warning-time)
-    (setq appt-display-mode-line nil)
-
-    ;; add automatic reminders for appointments
-    (defun my/org-agenda-to-appt ()
-      (interactive)
-      (setq appt-time-msg-list nil)
-      (org-agenda-to-appt))
-    ;; add reminders when starting emacs
+(use-package appt
+  :straight nil
+  :config
+  ;; Show notification 10 minutes before event
+  (setq appt-message-warning-time 10)
+  ;; Disable multiple reminders
+  (setq appt-display-interval appt-message-warning-time)
+  (setq appt-display-mode-line nil)
+
+  ;; add automatic reminders for appointments
+  (defun my/org-agenda-to-appt ()
+    (interactive)
+    (setq appt-time-msg-list nil)
+    (org-agenda-to-appt))
+  ;; add reminders when starting emacs
+  (my/org-agenda-to-appt)
+  ;; when rebuilding the agenda
+  (defadvice  org-agenda-redo (after org-agenda-redo-add-appts)
+    "Pressing `r' on the agenda will also add appointments."
     (my/org-agenda-to-appt)
-    ;; when rebuilding the agenda
-    (defadvice  org-agenda-redo (after org-agenda-redo-add-appts)
-      "Pressing `r' on the agenda will also add appointments."
-      (my/org-agenda-to-appt)
-      )
-    ;; when saving all org buffers
-    (defadvice org-save-all-org-buffers (after org-save-all-org-buffers-add-appts)
-      "Re-add appts after saving all org buffers"
-      (my/org-agenda-to-appt))
-    ;; Display appointments as a window manager notification
-    (setq appt-disp-window-function 'my/appt-display)
-    (setq appt-delete-window-function (lambda () t))
-
-    (setq my/appt-notification-app (concat (getenv "HOME") "/bin/appt_notification"))
-
-    (defun my/appt-display (min-to-app new-time msg)
-      (if (atom min-to-app)
-      (start-process "my/appt-notification-app" nil my/appt-notification-app min-to-app msg)
-    (dolist (i (number-sequence 0 (1- (length min-to-app))))
-      (start-process "my/appt-notification-app" nil my/appt-notification-app
-                    (nth i min-to-app) (nth i msg))))
-      )
     )
+  ;; when saving all org buffers
+  (defadvice org-save-all-org-buffers (after org-save-all-org-buffers-add-appts)
+    "Re-add appts after saving all org buffers"
+    (my/org-agenda-to-appt))
+  ;; Display appointments as a window manager notification
+  (setq appt-disp-window-function 'my/appt-display)
+  (setq appt-delete-window-function (lambda () t))
+
+  (setq my/appt-notification-app (concat (getenv "HOME") "/bin/appt_notification"))
+
+  (defun my/appt-display (min-to-app new-time msg)
+    (if (atom min-to-app)
+    (start-process "my/appt-notification-app" nil my/appt-notification-app min-to-app msg)
+  (dolist (i (number-sequence 0 (1- (length min-to-app))))
+    (start-process "my/appt-notification-app" nil my/appt-notification-app
+            (nth i min-to-app) (nth i msg))))
+    )
+  )
 
 
 #+END_SRC
@@ -2593,9 +2649,6 @@ same directory as the org-buffer and insert a link to this file."
     ))
 ; (setq mouse-drag-copy-region t)
 
-;; tramp configuration
-(setq tramp-use-ssh-controlmaster-options nil)
-
 (setq-default c-indent-level 4)
 (setq-default c-brace-imaginary-offset 0)
 (setq-default c-brace-offset -4)