From: Eshel Yaron Date: Sat, 19 Oct 2024 12:31:18 +0000 (+0200) Subject: Update Emacs config X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=981146ff497d1d90c97a0d0c24ccd24cd7d184b9;p=dotfiles.git Update Emacs config --- diff --git a/.emacs.d/init.el b/.emacs.d/init.el index b35ab77..59128f7 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -127,14 +127,11 @@ :pre-build (("pandoc" "-o" "elfeed.texi" "README.md")))) (elpaca emms) (elpaca htmlize) -(elpaca (oauth2 - :repo "git://git.sv.gnu.org/emacs/elpa" - :local-repo "oauth2" - :branch "externals/oauth2")) -(elpaca (lin - :pre-build (("emacs" "--batch" "-l" "ox-texinfo" "README.org" - "--eval" "(setq org-babel-confirm-evaluate-answer-no t)" - "-f" "org-texinfo-export-to-texinfo")))) +;; (elpaca (oauth2 +;; :repo "git://git.sv.gnu.org/emacs/elpa" +;; :local-repo "oauth2" +;; :branch "externals/oauth2")) +(elpaca transient) (elpaca magit) (elpaca (markdown-mode :pre-build (("pandoc" "-o" "markdown-mode.texi" "README.md")))) @@ -160,6 +157,7 @@ ("mv" "README.texi" "pdf-tools.texi")))) (elpaca ob-prolog) (elpaca (kubed :repo "~/checkouts/kubed")) +;; (elpaca kubed) (elpaca-wait) @@ -340,7 +338,6 @@ DEADLINE: %(format-time-string \"<%Y-%m-%d %H:%M>\" (org-read-date t t)) ol-gnus ol-info ol-irc - ol-mhe ol-eww ob-sql org-tempo) @@ -435,15 +432,16 @@ DEADLINE: %(format-time-string \"<%Y-%m-%d %H:%M>\" (org-read-date t t)) completions-max-height 16 completion-auto-wrap t read-minibuffer-restore-windows nil + ;; include CWD in shell command prompts + shell-command-prompt-show-cwd t shell-kill-buffer-on-exit t + shell-dirtrack-verbose nil compilation-scroll-output t display-time-default-load-average nil ;; allow disabling confirming before compilation via local variables foo bar baz safe-local-variable-values '((compilation-read-command . nil)) xref-search-program 'ripgrep grep-use-headings t - ;; include CWD in shell command prompts - shell-command-prompt-show-cwd t sqlformat-command 'pgformatter sql-input-ring-file-name (expand-file-name ".sqli-history" user-emacs-directory) ;; use relative line numbers @@ -518,7 +516,8 @@ DEADLINE: %(format-time-string \"<%Y-%m-%d %H:%M>\" (org-read-date t t)) 'esy-o365-token-refresh-last-time) (with-eval-after-load 'gnus-sum - (keymap-unset gnus-summary-mode-map "M-#" t)) + (keymap-unset gnus-summary-mode-map "M-#" t) + (keymap-unset gnus-summary-mode-map "M-&" t)) ;;; Define custom commands @@ -552,16 +551,16 @@ DEADLINE: %(format-time-string \"<%Y-%m-%d %H:%M>\" (org-read-date t t)) (quit-window nil window))) 'send 'kill))) -(defun esy/kill-dwim () - "When region is active, kill region, otherwise kill last word." - (interactive) - (if (region-active-p) - (let ((beg (region-beginning)) - (end (region-end))) - (kill-region beg end)) - (let ((end (point))) - (backward-word) - (kill-region (point) end)))) +;; (defun esy/kill-dwim () +;; "When region is active, kill region, otherwise kill last word." +;; (interactive) +;; (if (region-active-p) +;; (let ((beg (region-beginning)) +;; (end (region-end))) +;; (kill-region beg end)) +;; (let ((end (point))) +;; (backward-word) +;; (kill-region (point) end)))) (defun duplicate-line-stay (arg) (interactive "p") @@ -780,6 +779,7 @@ Interactively, POINT is point and KILL is the prefix argument." display-fill-column-indicator-mode display-line-numbers-mode flymake-mode + electric-indent-local-mode ;; esy/prog-set-up-capf )) (add-hook 'prog-mode-hook mode)) @@ -816,7 +816,7 @@ Interactively, POINT is point and KILL is the prefix argument." (keymap-global-set "C-c 1" #'delete-other-windows) (keymap-global-set "C-c 2" #'split-window-below) (keymap-global-set "C-c 3" #'split-window-right) -(keymap-global-set " " #'esy/kill-dwim) +;; (keymap-global-set " " #'esy/kill-dwim) (keymap-global-set " " #'zap-up-to-char) (keymap-global-set "s-n" #'duplicate-line) (keymap-global-set "s-p" #'duplicate-line-stay) @@ -876,7 +876,6 @@ Interactively, POINT is point and KILL is the prefix argument." ;;; disable some commands (put 'suspend-frame 'disabled t) - ;;; Configure project management commands (with-eval-after-load 'project @@ -985,7 +984,6 @@ as the initial input for completion, and return that directory." (with-eval-after-load 'dired (put 'dired-find-alternate-file 'disabled nil)) - ;;; Configure remote access via `tramp' (with-eval-after-load 'tramp @@ -1005,7 +1003,6 @@ as the initial input for completion, and return that directory." (add-to-list 'zoneinfo-style-world-list '("Asia/Tel_Aviv" "Tel Aviv"))) ;;; Configure spelling errors correction via `flyspell' - (with-eval-after-load 'flyspell (keymap-unset flyspell-mode-map "C-," t) (keymap-unset flyspell-mode-map "C-." t) @@ -1014,44 +1011,36 @@ as the initial input for completion, and return that directory." ;;; Configure minibuffer completions -;; (add-to-list 'display-buffer-alist -;; '("\\*Completions\\*" -;; (display-buffer-reuse-window display-buffer-at-bottom) -;; (window-parameters -;; ;; (mode-line-format . none) -;; (split-window . ignore)))) - (add-hook 'completion-list-mode-hook (lambda () (setq-local cursor-in-non-selected-windows nil))) ;;; Configure highlighting of the current line via `lin' -(with-eval-after-load 'lin - (add-to-list 'lin-mode-hooks 'gnus-summary-mode-hook) - (add-to-list 'lin-mode-hooks 'gnus-group-mode-hook) - (add-to-list 'lin-mode-hooks 'gnus-server-mode-hook)) +(with-eval-after-load 'hl-line + (dolist (mode '(gnus-summary-mode gnus-group-mode gnus-server-mode)) + (add-to-list 'global-hl-line-modes mode))) ;;; Enable some global minor modes - -(mapc #'funcall '(column-number-mode - context-menu-mode - display-battery-mode - display-time-mode - global-auto-revert-mode - global-completion-preview-mode - global-diff-hl-mode - global-minibuffer-auto-completion-mode - kubed-menu-bar-mode - lin-global-mode - minibuffer-depth-indicate-mode - pixel-scroll-precision-mode - recentf-mode - repeat-mode - save-place-mode - savehist-mode - transient-mark-mode - winner-mode)) +(dolist (mode '(column-number-mode + context-menu-mode + display-battery-mode + display-time-mode + global-auto-revert-mode + global-completion-preview-mode + global-diff-hl-mode + global-hl-line-mode + global-minibuffer-auto-completion-mode + kubed-menu-bar-mode + minibuffer-depth-indicate-mode + pixel-scroll-precision-mode + recentf-mode + repeat-mode + save-place-mode + savehist-mode + transient-mark-mode + winner-mode)) + (funcall mode)) ;;; Set up EMMS @@ -1267,7 +1256,8 @@ as the initial input for completion, and return that directory." (with-eval-after-load 'elisp-mode (setq elisp-flymake-byte-compile-load-path (cons "./" load-path)) (keymap-set emacs-lisp-mode-map "C-c C-t" #'trace-function) - (keymap-set emacs-lisp-mode-map "C-c C-s" #'set-variable)) + (keymap-set emacs-lisp-mode-map "C-c C-s" #'set-variable) + (add-hook 'emacs-lisp-mode-hook #'cursor-sensor-mode)) (dolist (mm '((go-ts-mode . go-ts-mode-hook) (typescript-ts-mode . typescript-ts-mode-hook) @@ -1283,7 +1273,10 @@ as the initial input for completion, and return that directory." (keymap-set completion-preview-active-mode-map "M-p" #'completion-preview-prev-candidate) (keymap-set completion-preview-active-mode-map "M-f" #'completion-preview-insert-word)) -(load-file "/Users/eshelyaron/checkouts/agda/src/data/emacs-mode/agda2.el") +(add-hook 'eval-expression-minibuffer-setup-hook #'completion-preview-mode) +(add-hook 'eval-expression-minibuffer-setup-hook #'electric-pair-mode) + +(load-file "/usr/local/opt/agda/libexec/ghc-9.10.1-inplace/Agd-2.6.4.3-7d670049/share/emacs-mode/agda2.el") (defun read-buffer-to-switch-recentf (file) (interactive diff --git a/.emacs.d/lisp/esy-comm.el b/.emacs.d/lisp/esy-comm.el index 1b0cd1b..1176549 100644 --- a/.emacs.d/lisp/esy-comm.el +++ b/.emacs.d/lisp/esy-comm.el @@ -94,7 +94,7 @@ nntp-connection-timeout 15 ;; Mastodon - mastodon-instance-url "https://emacs.ch" + mastodon-instance-url "https://social.eshelyaron.com" mastodon-active-user "eshel" ;; BBDB diff --git a/.emacs.d/theme/esy-theme.el b/.emacs.d/theme/esy-theme.el index 219658e..252a7d5 100644 --- a/.emacs.d/theme/esy-theme.el +++ b/.emacs.d/theme/esy-theme.el @@ -20,13 +20,15 @@ '(mode-line-active ((t :overline "black" :background "lavender"))) '(mode-line-inactive ((t :underline "black"))) '(fringe ((t))) - '(line-number-current-line ((t :background "yellow"))) + '(line-number-current-line ((t :background "yellow" :inherit default))) '(fill-column-indicator ((t :foreground "orange" :weight light))) '(vertical-border ((t :foreground "grey"))) '(minibuffer-prompt ((t :weight bold :slant italic :foreground "red"))) '(italic ((t :slant italic))) '(cursor ((t :background "salmon"))) '(font-lock-doc-face ((t :inherit font-lock-string-face :slant italic))) + ;; '(font-lock-variable-name-face ((t :foreground "#8b0a50"))) + ;; '(font-lock-variable-use-face ((t :foreground "sienna"))) '(elisp-shorthand-font-lock-face ((t :inherit font-lock-keyword-face :slant italic))) '(elfeed-search-title-face ((t :inherit shadow))) ;; '(error ((t :foreground "Red1"))) @@ -46,7 +48,9 @@ " " (8 ("" mode-line-percent-position "/%I")))) '(mode-line-format '(" %+ " - (:eval (when-let (project (project-current)) + (:eval (when-let (project + (and (not (file-remote-p default-directory)) + (project-current))) (list (propertize (concat (project-name project) "/ ") 'face 'italic))))