]> git.eshelyaron.com Git - dotfiles.git/commitdiff
Update Emacs configuration
authorEshel Yaron <me@eshelyaron.com>
Fri, 17 Nov 2023 18:10:04 +0000 (19:10 +0100)
committerEshel Yaron <me@eshelyaron.com>
Fri, 17 Nov 2023 18:10:04 +0000 (19:10 +0100)
.emacs.d/init.el

index 9170a8521cf6b9ddf6479c4c967992363f6e50cc..3fee3e0591e701733cdc3dee144cd2d7c81ad0e0 100644 (file)
                       "-f" "org-texinfo-export-to-texinfo")
                      ("mv" "README.texi"  "pdf-tools.texi"))))
 (elpaca ob-prolog)
-;; (elpaca (completion-preview :repo "git://git.eshelyaron.com/completion-preview.git"))
+(elpaca cape)
 
 (elpaca-wait)
 
@@ -296,7 +296,8 @@ DEADLINE: %(format-time-string \"<%Y-%m-%d %H:%M>\" (org-read-date t t))
 :CreatedAt: %u
 :CapturedAt: %a
 :CapturedAs: Homework
-:END:"
+:END:
+%?"
                           :prepend t
                           :empty-lines 1))
  ;; point Org to file agenda file
@@ -491,6 +492,9 @@ DEADLINE: %(format-time-string \"<%Y-%m-%d %H:%M>\" (org-read-date t t))
 (add-to-list 'savehist-additional-variables
              'esy-o365-token-refresh-last-time)
 
+(with-eval-after-load 'gnus-sum
+  (keymap-unset gnus-summary-mode-map "M-#" t))
+
 ;;; Define custom commands
 
 (defvar-keymap transpose-lines-repeat-map
@@ -583,11 +587,6 @@ DEADLINE: %(format-time-string \"<%Y-%m-%d %H:%M>\" (org-read-date t t))
   (interactive)
   (dired "~/tmp"))
 
-(defun esy/ttyper ()
-  (interactive)
-  (let ((default-directory "~"))
-    (eat "ttyper" t)))
-
 (with-eval-after-load 'shell
   (keymap-set shell-mode-map "SPC" #'comint-magic-space))
 
@@ -619,7 +618,8 @@ DEADLINE: %(format-time-string \"<%Y-%m-%d %H:%M>\" (org-read-date t t))
   (add-to-list 'mode-face-modes 'lisp-interaction-mode))
 
 (with-eval-after-load 'comint
-  (keymap-set comint-mode-map "C-c C-q" #'esy/log-buffer))
+  (keymap-set comint-mode-map "C-c C-q" #'esy/log-buffer)
+  (add-hook 'comint-mode-hook #'completion-preview-mode))
 
 (defun esy/recent-log-summary ()
   "Display a summary of my website's most recent access log."
@@ -876,6 +876,9 @@ Interactively, POINT is point and KILL is the prefix argument."
 
 (add-hook 'text-mode-hook #'flyspell-mode)
 (add-hook 'text-mode-hook #'completion-preview-mode)
+(add-hook 'text-mode-hook
+          (lambda ()
+            (add-hook 'completion-at-point-functions #'cape-dict 10 t)))
 
 ;;; Bind some keys
 
@@ -1384,8 +1387,19 @@ as the initial input for completion, and return that directory."
 
 (dolist (mm '((go-ts-mode         . go-ts-mode-hook)
               (typescript-ts-mode . typescript-ts-mode-hook)
-              (python             . python-base-mode-hook)))
+              (python             . python-base-mode-hook)
+              (cc-mode            . c-mode-hook)))
   (with-eval-after-load (car mm) (add-hook (cdr mm) #'eglot-ensure)))
 
+(with-eval-after-load 'completion-preview
+  (push 'org-self-insert-command completion-preview-commands)
+  (push 'paredit-backward-delete completion-preview-commands)
+  (setq completion-preview-minimum-symbol-length 2)
+  (keymap-set completion-preview-active-mode-map "M-n" #'completion-preview-next-candidate)
+  (keymap-set completion-preview-active-mode-map "M-p" #'completion-preview-prev-candidate)
+  (keymap-set completion-preview-active-mode-map "M-i" #'completion-preview-insert))
+
+(load-file "/Users/eshelyaron/checkouts/agda/src/data/emacs-mode/agda2.el")
+
 (provide 'init)
 ;;; init.el ends here