From: Eshel Yaron Date: Fri, 24 May 2024 09:33:16 +0000 (+0200) Subject: Update Emacs configuration X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;p=dotfiles.git Update Emacs configuration --- diff --git a/.emacs.d/init.el b/.emacs.d/init.el index cde77c6..b9d7bac 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -145,16 +145,11 @@ :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 (openai :repo "https://git.sr.ht/~eshel/openai.el")) (elpaca paredit) (elpaca rainbow-delimiters) (elpaca rainbow-mode) -(elpaca rg) (elpaca sqlformat) (elpaca (mode-face :repo "https://git.sr.ht/~eshel/mode-face")) -(elpaca terraform-mode) -(elpaca whitespace-cleanup-mode) -(elpaca rfc-mode) (elpaca (auctex :files ("*.el" "*.info*") :pre-build (("./autogen.sh") @@ -447,6 +442,7 @@ DEADLINE: %(format-time-string \"<%Y-%m-%d %H:%M>\" (org-read-date t t)) ;; 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 @@ -857,6 +853,7 @@ Interactively, POINT is point and KILL is the prefix argument." (keymap-global-set "C-c G" #'gnus) (keymap-global-set "C-c M" #'mastodon) (keymap-global-set "C-c t" #'esy/tmp-dired) +(keymap-global-set "C-c y" #'esy/search-mailing-list) (keymap-global-set "C-c F" #'esy/find-init-file) (keymap-global-set "C-c 1" #'delete-other-windows) (keymap-global-set "C-c 2" #'split-window-below) @@ -881,9 +878,8 @@ Interactively, POINT is point and KILL is the prefix argument." (keymap-set ctl-x-map "C-b" #'ibuffer) (keymap-set ctl-x-map "k" #'esy/kill-buffers) +(find-function-setup-keys) -(keymap-set search-map "r" #'rg) -(keymap-set search-map "l" #'rg-literal) (keymap-set search-map "b" #'some-button) (keymap-set window-prefix-map "p" #'windmove-swap-states-up) @@ -927,7 +923,6 @@ Interactively, POINT is point and KILL is the prefix argument." (add-to-list 'project-switch-commands '(rg-project "rg")) (add-to-list 'project-switch-commands '(magit-project-status "Magit")) (add-to-list 'project-switch-commands '(project-shell "Shell")) - (define-key project-prefix-map "R" #'rg-project) (define-key project-prefix-map "w" #'project-copy-relative-file-name-as-kill) (define-key project-prefix-map "m" #'magit-project-status) @@ -1069,12 +1064,6 @@ as the initial input for completion, and return that directory." (lambda () (setq-local cursor-in-non-selected-windows nil))) -;; (dolist (key-binding '(("C-p" . minibuffer-previous-completion) -;; ("C-n" . minibuffer-next-completion))) -;; (keymap-set minibuffer-local-completion-map -;; (car key-binding) -;; (cdr key-binding))) - ;;; Configure highlighting of the current line via `lin' (with-eval-after-load 'lin @@ -1091,7 +1080,6 @@ as the initial input for completion, and return that directory." display-battery-mode global-auto-revert-mode global-diff-hl-mode - global-whitespace-cleanup-mode lin-global-mode minibuffer-depth-indicate-mode pixel-scroll-precision-mode @@ -1099,11 +1087,10 @@ as the initial input for completion, and return that directory." repeat-mode save-place-mode savehist-mode - show-paren-mode transient-mark-mode winner-mode completions-auto-update-mode - mode-face-global-mode + ;; mode-face-global-mode global-completion-preview-mode ;; tab-bar-mode )) @@ -1177,8 +1164,8 @@ as the initial input for completion, and return that directory." ;;; Configure recursive grepping via `rg' -(with-eval-after-load 'rg - (add-to-list 'rg-custom-type-aliases '("Prolog" . "*.pl *.plt *.pro *.prolog"))) +(with-eval-after-load 'grep + (add-to-list 'grep-files-aliases '("pl" . "*.pl *.plt *.pro *.prolog"))) ;;; Configure custom faces in `terraform-mode' @@ -1281,7 +1268,8 @@ as the initial input for completion, and return that directory." (dolist (mm '((whitespace-cleanup-mode . whitespace-cleanup-mode) (outline . outline-minor-mode) - (abbrev . abbrev-mode))) + (abbrev . abbrev-mode) + (iimage . iimage-mode))) (with-eval-after-load (car mm) (setf (alist-get (cdr mm) minor-mode-alist) '("")))) @@ -1344,9 +1332,8 @@ as the initial input for completion, and return that directory." (interactive (minibuffer-with-setup-hook #'minibuffer-completion-help (unless recentf-mode (recentf-mode 1)) - (let ((completions-sort nil)) - (list (completing-read (format-prompt "Open recent file" nil) - recentf-list nil t (minibuffer-contents)))))) + (list (completing-read (format-prompt "Open recent file" nil) + recentf-list nil t (minibuffer-contents))))) (let ((buf (find-file-noselect file))) (delete-minibuffer-contents) (insert (buffer-name buf)) @@ -1438,5 +1425,12 @@ as the initial input for completion, and return that directory." (add-hook 'magit-pre-refresh-hook 'diff-hl-magit-pre-refresh) (add-hook 'magit-post-refresh-hook 'diff-hl-magit-post-refresh))) +(with-eval-after-load 'xref + (add-hook 'xref-after-update-hook #'outline-minor-mode)) + +(defun esy/search-mailing-list (q) + (interactive "sSearch: ") + (eww (url-encode-url (format "yhetil.org/emacs?q=%s" q)))) + (provide 'init) ;;; init.el ends here diff --git a/.emacs.d/theme/esy-theme.el b/.emacs.d/theme/esy-theme.el index 4584dab..99f190e 100644 --- a/.emacs.d/theme/esy-theme.el +++ b/.emacs.d/theme/esy-theme.el @@ -58,7 +58,8 @@ (-3 "%p") "/%I ")) '(elfeed-search-face-alist '((unread default))) - '(mode-face-faces '(default fringe mode-line-inactive))) + '(mode-face-faces '(default fringe mode-line-inactive)) + '(mode-face-global-mode t)) (provide-theme 'esy) ;;; esy-theme.el ends here