From 926596c1150dcfed13c98b77bc74663b8adb9369 Mon Sep 17 00:00:00 2001 From: Eshel Yaron Date: Fri, 17 Nov 2023 19:10:04 +0100 Subject: [PATCH] Update Emacs configuration --- .emacs.d/init.el | 32 +++++++++++++++++++++++--------- 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/.emacs.d/init.el b/.emacs.d/init.el index 9170a85..3fee3e0 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -189,7 +189,7 @@ "-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 -- 2.39.2