From bfb548ac44ca5416fda01c01c144d9229808ddbf Mon Sep 17 00:00:00 2001 From: Marc Coquand Date: Fri, 18 Oct 2024 09:15:22 +0200 Subject: . --- emacs | 103 +++++++++++++++++++++++++++++++++++------------------------------- 1 file changed, 55 insertions(+), 48 deletions(-) diff --git a/emacs b/emacs index ecefdca..bcb1126 100644 --- a/emacs +++ b/emacs @@ -33,10 +33,10 @@ expand-region) package-archives '(("elpa" . "https://elpa.gnu.org") - ("gnu" . "http://elpa.gnu.org/packages/") - ("melpa" . "https://melpa.org/packages/") - ("non-gnu" . "https://elpa.nongnu.org/nongnu/") - ("melpa-stable" . "https://stable.melpa.org/packages/"))) + ("gnu" . "http://elpa.gnu.org/packages/") + ("melpa" . "https://melpa.org/packages/") + ("non-gnu" . "https://elpa.nongnu.org/nongnu/") + ("melpa-stable" . "https://stable.melpa.org/packages/"))) ;; UI @@ -48,6 +48,7 @@ (package-initialize) + (unless package-archive-contents (package-refresh-contents)) @@ -58,14 +59,20 @@ (use-package tab-bar :init -; (defun me/close-tab-and-buffer -; (lambda () -; (interactive) -; (kill-buffer))) + ; (defun me/close-tab-and-buffer + ; (lambda () + ; (interactive) + ; (kill-buffer))) (tab-bar-mode)) +(use-package project + :defer t + :init + (add-to-list 'project-switch-commands '(project-shell "Shell"))) + (use-package exwm :init + (set-window-margins (selected-window) 1 1) (setq exwm-workspace-number 1 exwm-input-global-keys `(([?\s-r] . exwm-reset) ;; s-r: Reset (to line-mode). @@ -87,8 +94,8 @@ (shell-command "scrot -s -F '/home/mccd/screenshots/%Y-%m-%d_$wx$h.png'"))) (exwm-input-set-key (kbd "s-") (lambda (cmd) ;; s-&: Launch application. - (interactive (list (read-shell-command "$ "))) - (start-process-shell-command cmd nil cmd))) + (interactive (list (read-shell-command "$ "))) + (start-process-shell-command cmd nil cmd))) (exwm-enable) (exwm-xim-mode) (push ?\C-\\ exwm-input-prefix-keys) @@ -177,32 +184,25 @@ (use-package repeat :demand t :bind - (("C-." . repeat) - (:repeat-map - repeat-repeat-map - ("." . repeat)) - (:repeat-map + ((:repeat-map repeat-normal-movement-map ("n" . next-line) ("b" . backward-char) ("f" . forward-char) ("e" . move-end-of-line) - ("M-f" . forward-word) - ("M-b" . backward-word) + ("F" . forward-word) + ("B" . backward-word) ("v" . scroll-up-command) - ("M-v" . scroll-down-command) + ("V" . scroll-down-command) ("o" . 'avy-goto-char-timer) - ("a" . move-beginning-of-line) + ("g" . goto-line) + ("a" . move-beginning-of-line) + ("k" . kill-line) + ("d" . delete-char) + ("D" . kill-word) + ("." . er/expand-region) + ("-" . er/contract-region) ("p" . previous-line)) - (:repeat-map - repeat-kill-line-map - ("k" . kill-line)) - (:repeat-map - repeat-delete-word-map - ("d" . kill-word)) - (:repeat-map - repeat-delete-char-map - ("d" . delete-char)) (:repeat-map repeat-movement-map ("e" . end-of-defun) @@ -210,12 +210,11 @@ ("n" . forward-list) ("p" . backward-list) ("d" . down-list) - ("o" . avy-goto-char-timer) ("u" . up-list) ("b" . backward-sexp) ("a" . beginning-of-defun))) :config -(setq repeat-on-final-keystroke t + (setq repeat-on-final-keystroke t set-mark-command-repeat-pop t repeat-exit-key (kbd "")) (repeat-mode 1)) @@ -343,9 +342,9 @@ ("[" . flymake-goto-prev-error)) :hook ((flymake-mode . - (lambda () - (define-key flymake-mode-map (kbd "C-c ]") 'flymake-goto-next-error) - (define-key flymake-mode-map (kbd "C-c [") 'flymake-goto-prev-error))))) + (lambda () + (define-key flymake-mode-map (kbd "C-c ]") 'flymake-goto-next-error) + (define-key flymake-mode-map (kbd "C-c [") 'flymake-goto-prev-error))))) (use-package expand-region :ensure t @@ -411,11 +410,11 @@ (add-to-list 'auto-mode-alist '("~/personal-db/log" . diary-mode)) :hook ((diary-mode . variable-pitch-mode) -; (diary-mode . org-link-minor-mode) -; (diary-fancy-display-mode . org-link-minor-mode) + ; (diary-mode . org-link-minor-mode) + ; (diary-fancy-display-mode . org-link-minor-mode) (diary-fancy-display-mode . variable-pitch-mode) (diary-mode . (lambda () - (add-hook 'after-save-hook 'sync-org nil t))) + (add-hook 'after-save-hook 'sync-org nil t))) (diary-mode . flyspell-mode)) :config (global-set-key (kbd "C-c d") 'calendar) @@ -427,10 +426,11 @@ (use-package nix-mode :ensure t + :defer t :hook ((nix-mode . (lambda () - (add-hook 'before-save-hook #'nix-format-buffer nil t)))) - (nix-mode . nix-prettify-mode)) + (add-hook 'before-save-hook #'nix-format-buffer nil t))) + (nix-mode . nix-prettify-mode))) (use-package eglot :config @@ -444,10 +444,13 @@ (use-package go-mode :ensure t + :defer t :hook ((go-mode . (lambda () (add-hook - 'before-save-hook 'eglot-format-buffer nil t))))) + 'before-save-hook 'eglot-format-buffer nil t))) + (go-mode . (lambda () + (setq-local compile-command "go build ."))))) (use-package rec-mode :ensure nil @@ -473,9 +476,11 @@ "\C-cef" (lambda () (interactive) - (erc :server - "irc.libera.chat" :port "6667" :nick "mccd" - :password (shell-command-to-string "pass show libera.chat"))))) + (erc + :server "irc.libera.chat" + :port "6667" + :nick "mccd" + :password (shell-command-to-string "pass show libera.chat"))))) (use-package ob-rec :ensure nil) @@ -581,12 +586,14 @@ ((string-match "marc@mccd.space" from) "home")))) (setq message-sendmail-extra-arguments (list '"-a" account)))))) -(use-package message - :defer t - :hook - ((message-send-mail . marc/set-msmtp-account) - (message-mode-hook flyspell-mode))) +;(use-package message +; :defer t +; :hook +; ((message-send-mail . marc/set-msmtp-account) +; (message-mode-hook flyspell-mode))) +(add-hook 'message-send-mail-hook #'marc/set-msmtp-account) +(add-hook 'message-mode-hook #'flyspell-mode) (use-package flyspell :defer t) @@ -800,7 +807,7 @@ '((:name "Last 7 days" :query "date:7d..now" :hide-unread t :key 119) (:name "Messages with images" :query "mime:image/*" :key 112))) '(org-agenda-files - '("~/personal-db/notes/calendar-beorg.org" "/home/mccd/personal-db/notes/ethics-and-software.org" "/home/mccd/personal-db/notes/reminders.org" "/home/mccd/builds/sustainably/piva.org" "/home/mccd/personal-db/notes/programming.org" "/home/mccd/personal-db/notes/unix.org" "/home/mccd/personal-db/notes/sustainable-software.org" "/home/mccd/personal-db/notes/agency-and-tech.org" "/home/mccd/personal-db/notes/emacs-teaches.org" "/home/mccd/personal-db/notes/emacs.org" "/home/mccd/personal-db/notes/inbox.org" "/home/mccd/personal-db/notes/todo.org")) + '("~/personal-db/notes/cal-ios.org" "/home/mccd/personal-db/notes/ethics-and-software.org" "/home/mccd/personal-db/notes/reminders.org" "/home/mccd/builds/sustainably/piva.org" "/home/mccd/personal-db/notes/programming.org" "/home/mccd/personal-db/notes/unix.org" "/home/mccd/personal-db/notes/sustainable-software.org" "/home/mccd/personal-db/notes/agency-and-tech.org" "/home/mccd/personal-db/notes/emacs-teaches.org" "/home/mccd/personal-db/notes/emacs.org" "/home/mccd/personal-db/notes/inbox.org" "/home/mccd/personal-db/notes/todo.org")) '(org-fold-core-style 'overlays) '(package-selected-packages '(exwm-mff eat pinentry exwm emms company orglink web-mode flycheck nix-mode nix-ts-mode avy pdf-tools elfeed-protocol lem yasnippet-snippets elfeed yasnippet smartparens markdown-mode mastodon tldr almost-mono-themes rec-mode magit go-mode expand-region devdocs)) -- cgit v1.2.3