diff options
author | Marc Coquand <marc@mccd.space> | 2024-10-18 09:15:22 +0200 |
---|---|---|
committer | Marc Coquand <marc@mccd.space> | 2024-10-18 09:15:22 +0200 |
commit | bfb548ac44ca5416fda01c01c144d9229808ddbf (patch) | |
tree | 65f4ce3e882a1b00084fce54c5a8189a4a9e7cc7 | |
parent | 3b1cde98977eadabc1ad8854aa87856284f03d40 (diff) | |
download | bsd-bfb548ac44ca5416fda01c01c144d9229808ddbf.tar.gz bsd-bfb548ac44ca5416fda01c01c144d9229808ddbf.tar.bz2 bsd-bfb548ac44ca5416fda01c01c144d9229808ddbf.zip |
.
-rw-r--r-- | emacs | 103 |
1 files changed, 55 insertions, 48 deletions
@@ -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-<SPC>") (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,45 +184,37 @@ (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) ("f" . forward-sexp) ("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 "<TAB>")) (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)) |