diff options
author | Case Duckworth | 2023-02-20 16:19:03 -0600 |
---|---|---|
committer | Case Duckworth | 2023-02-20 16:19:03 -0600 |
commit | 9df66e96c4fa98c9b74566712116f4373b5d5c64 (patch) | |
tree | 69bfc614eb26accafa74e7f40d81a0c9155962f4 /init.el | |
parent | Ignore tree-sitter/ (diff) | |
download | emacs-9df66e96c4fa98c9b74566712116f4373b5d5c64.tar.gz emacs-9df66e96c4fa98c9b74566712116f4373b5d5c64.zip |
apsodfiuadsfoiudsfpaoidsufpaosidufposdifuapsodifuapsodifu
Diffstat (limited to 'init.el')
-rw-r--r-- | init.el | 198 |
1 files changed, 144 insertions, 54 deletions
diff --git a/init.el b/init.el index 264378c..c8fb4e7 100644 --- a/init.el +++ b/init.el | |||
@@ -21,21 +21,39 @@ | |||
21 | 21 | ||
22 | (use-package emacs ; Misc. config | 22 | (use-package emacs ; Misc. config |
23 | :config | 23 | :config |
24 | (setopt tab-bar-show 1 | 24 | (setopt recenter-positions '(top middle bottom) |
25 | recenter-positions '(top middle bottom) | ||
26 | initial-scratch-message | 25 | initial-scratch-message |
27 | (format "%s\n\n" | 26 | (format "%s\n\n" |
28 | (mapconcat (lambda (s) (format ";; %s" s)) | 27 | (mapconcat (lambda (s) (format ";; %s" s)) |
29 | (process-lines "fortune" "-s") | 28 | (process-lines "fortune" "-s") |
30 | "\n"))) | 29 | "\n"))) |
31 | (keymap-global-unset "C-\\") | 30 | (keymap-global-unset "C-\\") |
31 | (keymap-global-unset "<f2>") | ||
32 | (add-hook 'kill-buffer-query-functions | 32 | (add-hook 'kill-buffer-query-functions |
33 | (defun scratch@immortal () | 33 | (defun scratch@immortal () |
34 | (if (equal (buffer-name) "*scratch*") | 34 | (if (equal (buffer-name) "*scratch*") |
35 | (progn (bury-buffer) nil) | 35 | (progn (bury-buffer) nil) |
36 | t))) | 36 | t))) |
37 | (setf (alist-get "\\*Compile-Log\\*" display-buffer-alist nil nil #'equal) | 37 | (setf (alist-get "\\*Compile-Log\\*" display-buffer-alist nil nil #'equal) |
38 | '(display-buffer-no-window))) | 38 | '(display-buffer-no-window)) |
39 | (add-hook 'after-init-hook | ||
40 | (defun global-mode-string@setup () | ||
41 | (defvar jabber-activity-mode-string) | ||
42 | (defvar org-mode-line-string) | ||
43 | (defvar display-time-mode) | ||
44 | (defvar display-time-string) | ||
45 | (setf global-mode-string | ||
46 | '((t jabber-activity-mode-string) | ||
47 | org-mode-line-string | ||
48 | (display-time-mode display-time-string))))) | ||
49 | (keymap-global-set "C-c t" | ||
50 | (define-keymap | ||
51 | :prefix 'toggle-map | ||
52 | "e" #'toggle-debug-on-error | ||
53 | "q" #'toggle-debug-on-quit | ||
54 | "c" #'column-number-mode | ||
55 | "l" #'line-number-mode | ||
56 | "L" #'display-line-numbers-mode))) | ||
39 | 57 | ||
40 | (use-package faces | 58 | (use-package faces |
41 | :config | 59 | :config |
@@ -123,7 +141,7 @@ | |||
123 | 141 | ||
124 | (use-package ispell | 142 | (use-package ispell |
125 | :config | 143 | :config |
126 | (setopt ispell-program-name (choose-executable "ispell" "aspell")) | 144 | (setopt ispell-program-name (choose-executable "aspell" "ispell")) |
127 | (add-hook 'before-save-hook | 145 | (add-hook 'before-save-hook |
128 | #'+ispell-move-buffer-words-to-dir-locals-hook) | 146 | #'+ispell-move-buffer-words-to-dir-locals-hook) |
129 | (put 'ispell-buffer-session-localwords 'safe-local-variable | 147 | (put 'ispell-buffer-session-localwords 'safe-local-variable |
@@ -227,6 +245,34 @@ | |||
227 | ("w" . Info-copy-current-node-name-0) | 245 | ("w" . Info-copy-current-node-name-0) |
228 | ("c" . Info-copy-current-node-name))) | 246 | ("c" . Info-copy-current-node-name))) |
229 | 247 | ||
248 | (use-package make-mode | ||
249 | :defer t | ||
250 | :config | ||
251 | (add-hook 'makefile-mode-hook | ||
252 | (defun make-mode@setup () | ||
253 | (remove-hook 'write-file-functions | ||
254 | #'makefile-warn-suspicious-lines t) | ||
255 | (remove-hook 'write-file-functions | ||
256 | #'makefile-warn-continuations t)))) | ||
257 | |||
258 | (use-package eglot | ||
259 | :preface | ||
260 | (defun +eglot-eldoc () | ||
261 | ;; https://www.masteringemacs.org/article/seamlessly-merge-multiple-documentation-sources-eldoc | ||
262 | (setq eldoc-documentation-strategy #'eldoc-documentation-compose-eagerly)) | ||
263 | :hook | ||
264 | ((bash-ts-mode . eglot)) | ||
265 | :config | ||
266 | (add-hook 'eglot-managed-mode . +eglot-eldoc)) | ||
267 | |||
268 | (use-package eldoc | ||
269 | :config | ||
270 | (setopt eldoc-documentation-strategy #'eldoc-documentation-compose-eagerly) | ||
271 | (setf (alist-get "^\\*eldoc for" display-buffer-alist nil nil #'equal) | ||
272 | '(display-buffer-at-bottom | ||
273 | (window-height . 4))) | ||
274 | (eldoc-add-command-completions "paredit-")) | ||
275 | |||
230 | 276 | ||
231 | ;;; Applications | 277 | ;;; Applications |
232 | 278 | ||
@@ -298,8 +344,8 @@ With prefix ARG, toggle the value of | |||
298 | (not (eobp))) | 344 | (not (eobp))) |
299 | (titlecase-region (progn (org-beginning-of-line) (point)) | 345 | (titlecase-region (progn (org-beginning-of-line) (point)) |
300 | (progn (org-end-of-line) (point))))))) | 346 | (progn (org-end-of-line) (point))))))) |
301 | :bind (:map scule-map | 347 | :config |
302 | ("M-t" . titlecase-dwim))) | 348 | (keymap-set scule-map "M-t" #'titlecase-dwim)) |
303 | 349 | ||
304 | (use-package scule | 350 | (use-package scule |
305 | :load-path "~/src/emacs/scule/" | 351 | :load-path "~/src/emacs/scule/" |
@@ -367,11 +413,16 @@ With prefix ARG, toggle the value of | |||
367 | ("." . jabber-muc-presence-dim)) | 413 | ("." . jabber-muc-presence-dim)) |
368 | jabber-activity-make-strings #'jabber-activity-make-strings-shorten | 414 | jabber-activity-make-strings #'jabber-activity-make-strings-shorten |
369 | jabber-rare-time-format " - - - - - - %H:%M %F" | 415 | jabber-rare-time-format " - - - - - - %H:%M %F" |
416 | jabber-muc-header-line-format | ||
417 | '(" " (:eval (replace-regexp-in-string "%" "%%" | ||
418 | (jabber-jid-displayname | ||
419 | jabber-group))) | ||
420 | " / " jabber-muc-topic) | ||
370 | ;; buffer name formats | 421 | ;; buffer name formats |
371 | ;; jabber-chat-buffer-format "%n <xmpp>" | 422 | jabber-chat-buffer-format "*xmpp* %n" |
372 | ;; jabber-browse-buffer-format "%n <xmpp-browse>" | 423 | jabber-browse-buffer-format "*xmpp-browse* %n" |
373 | ;; jabber-groupchat-buffer-format "%n <xmpp-muc>" | 424 | jabber-groupchat-buffer-format "*xmpp-muc* %n" |
374 | ;; jabber-muc-private-buffer-format "%n <xmpp-muc-private>" | 425 | jabber-muc-private-buffer-format "*xmpp-muc-private* %n" |
375 | ;; "prompt" (speaker) formats | 426 | ;; "prompt" (speaker) formats |
376 | jabber-groupchat-prompt-format (format "%%>%dn | " jabber-prefix-width) | 427 | jabber-groupchat-prompt-format (format "%%>%dn | " jabber-prefix-width) |
377 | jabber-chat-local-prompt-format (format "%%>%dn | " jabber-prefix-width) | 428 | jabber-chat-local-prompt-format (format "%%>%dn | " jabber-prefix-width) |
@@ -404,7 +455,8 @@ With prefix ARG, toggle the value of | |||
404 | (defun jabber-chat@leave-when-kill () | 455 | (defun jabber-chat@leave-when-kill () |
405 | (add-hook 'kill-buffer-hook | 456 | (add-hook 'kill-buffer-hook |
406 | (defun @jabber-leave@kill () | 457 | (defun @jabber-leave@kill () |
407 | (apply #'jabber-muc-leave (jabber-muc-argument-list))) | 458 | (ignore-errors |
459 | (apply #'jabber-muc-leave (jabber-muc-argument-list)))) | ||
408 | nil :local))) | 460 | nil :local))) |
409 | (when (fboundp 'jabber-chat-update-focus) | 461 | (when (fboundp 'jabber-chat-update-focus) |
410 | (add-hook 'window-configuration-change-hook #'jabber-chat-update-focus)) | 462 | (add-hook 'window-configuration-change-hook #'jabber-chat-update-focus)) |
@@ -423,13 +475,17 @@ With prefix ARG, toggle the value of | |||
423 | (buffer-list)))))) | 475 | (buffer-list)))))) |
424 | (add-to-list 'consult-buffer-sources 'jabber-chat-buffer-source :append) | 476 | (add-to-list 'consult-buffer-sources 'jabber-chat-buffer-source :append) |
425 | (consult-customize | 477 | (consult-customize |
426 | consult-buffer :preview-key (kbd "M-.")))) | 478 | consult-buffer :preview-key "M-."))) |
427 | 479 | ||
428 | (use-package keepassxc-shim | 480 | (use-package keepassxc-shim |
429 | :load-path "~/src/emacs/keepassxc-shim/" | 481 | :load-path "~/src/emacs/keepassxc-shim/" |
430 | :config | 482 | :config |
431 | (keepassxc-shim-activate)) | 483 | (keepassxc-shim-activate)) |
432 | 484 | ||
485 | (use-package hippie-completing-read | ||
486 | :load-path "~/src/emacs/hippie-completing-read/" | ||
487 | :bind (("M-/" . hippie-completing-read))) | ||
488 | |||
433 | 489 | ||
434 | ;;; External packages | 490 | ;;; External packages |
435 | 491 | ||
@@ -620,9 +676,7 @@ The prefix argument is as in `visual-fill-column-widen' but negated." | |||
620 | prefix))))) | 676 | prefix))))) |
621 | ;; Add strings to this list to inhibit adding a space | 677 | ;; Add strings to this list to inhibit adding a space |
622 | ;; after them. | 678 | ;; after them. |
623 | '(",@")))))) | 679 | '(",@"))))))) |
624 | (with-eval-after-load 'eldoc | ||
625 | (eldoc-add-command #'paredit-backward-delete #'paredit-close-round))) | ||
626 | 680 | ||
627 | (use-package hungry-delete | 681 | (use-package hungry-delete |
628 | :ensure t | 682 | :ensure t |
@@ -666,9 +720,16 @@ The prefix argument is as in `visual-fill-column-widen' but negated." | |||
666 | :preface | 720 | :preface |
667 | (setopt inferior-lisp-program (choose-executable "sbcl")) | 721 | (setopt inferior-lisp-program (choose-executable "sbcl")) |
668 | :when inferior-lisp-program | 722 | :when inferior-lisp-program |
669 | :bind (:map sly-mode-map | 723 | :init |
670 | ("C-c C-z" . sly-mrepl)) | 724 | (defun +sly-start-or-mrepl () |
725 | (interactive) | ||
726 | (if (ignore-errors (sly-connection)) | ||
727 | (sly-mrepl (lambda (buf) | ||
728 | (display-buffer-pop-up-window buf nil))) | ||
729 | (call-interactively #'sly))) | ||
671 | :config | 730 | :config |
731 | (autoload 'sly-mrepl "sly-mrepl" nil t) | ||
732 | (keymap-set sly-mode-map "C-c C-z" #'+sly-start-or-mrepl) | ||
672 | (setopt sly-net-coding-system 'utf-8-unix) | 733 | (setopt sly-net-coding-system 'utf-8-unix) |
673 | (sly-symbol-completion-mode -1)) | 734 | (sly-symbol-completion-mode -1)) |
674 | 735 | ||
@@ -728,6 +789,9 @@ The prefix argument is as in `visual-fill-column-widen' but negated." | |||
728 | :ensure t | 789 | :ensure t |
729 | :bind ("C-x g" . magit)) | 790 | :bind ("C-x g" . magit)) |
730 | 791 | ||
792 | (use-package git-modes | ||
793 | :ensure t) | ||
794 | |||
731 | (use-package eradio | 795 | (use-package eradio |
732 | :ensure t | 796 | :ensure t |
733 | :preface | 797 | :preface |
@@ -800,6 +864,13 @@ With PREFIX, prompt to change the current dictionary." | |||
800 | :bind (:map dired-mode-map | 864 | :bind (:map dired-mode-map |
801 | ("." . dired-hide-dotfiles-mode))) | 865 | ("." . dired-hide-dotfiles-mode))) |
802 | 866 | ||
867 | (use-package dired-git-info | ||
868 | :ensure t | ||
869 | :bind (:map dired-mode-map | ||
870 | (")" . dired-git-info-mode)) | ||
871 | :config | ||
872 | (setopt dgi-auto-hide-details-p nil)) | ||
873 | |||
803 | (use-package embrace | 874 | (use-package embrace |
804 | :ensure t | 875 | :ensure t |
805 | :preface | 876 | :preface |
@@ -860,45 +931,64 @@ With PREFIX, prompt to change the current dictionary." | |||
860 | (use-package rec-mode | 931 | (use-package rec-mode |
861 | :ensure t) | 932 | :ensure t) |
862 | 933 | ||
863 | (use-package gauche-mode | 934 | ;; (use-package gauche-mode |
864 | :load-path "~/src/emacs/gauche-mode/" | 935 | ;; :load-path "~/src/emacs/gauche-mode/" |
865 | :mode "\\.scm\\'" | 936 | ;; :mode "\\.scm\\'" |
866 | :config | 937 | ;; :config |
867 | (setopt gauche-mode-info-language 'en | 938 | ;; (setopt gauche-mode-info-language 'en |
868 | scheme-program-name "gosh -i" | 939 | ;; scheme-program-name "gosh -i" |
869 | scheme-compile-exp-command "%s") | 940 | ;; scheme-compile-exp-command "%s") |
870 | (add-to-list 'scheme-source-modes 'gauche-mode) | 941 | ;; (add-to-list 'scheme-source-modes 'gauche-mode) |
871 | (setf (alist-get "\\*scheme\\*" display-buffer-alist nil nil #'equal) | 942 | ;; (setf (alist-get "\\*scheme\\*" display-buffer-alist nil nil #'equal) |
872 | '((display-buffer-reuse-window | 943 | ;; '((display-buffer-reuse-window |
873 | display-buffer-pop-up-window) | 944 | ;; display-buffer-pop-up-window) |
874 | (inhibit-same-window . t))) | 945 | ;; (inhibit-same-window . t))) |
875 | (add-hook 'gauche-mode-hook #'enable-gauche-paredit-mode) | 946 | ;; (add-hook 'gauche-mode-hook #'enable-gauche-paredit-mode) |
876 | (add-hook 'inferior-scheme-mode-hook #'enable-gauche-paredit-mode) | 947 | ;; (add-hook 'inferior-scheme-mode-hook #'enable-gauche-paredit-mode) |
877 | ;; Extras | 948 | ;; ;; Extras |
878 | (define-key gauche-mode-map (kbd "C-c C-k") | 949 | ;; (define-key gauche-mode-map (kbd "C-c C-k") |
879 | (defun +gauche-mode-send-buffer () | 950 | ;; (defun +gauche-mode-send-buffer () |
880 | (interactive) | 951 | ;; (interactive) |
881 | (save-mark-and-excursion | 952 | ;; (save-mark-and-excursion |
882 | (let ((start (point-min)) | 953 | ;; (let ((start (point-min)) |
883 | (end (point-max))) | 954 | ;; (end (point-max))) |
884 | (goto-char start) | 955 | ;; (goto-char start) |
885 | (while (or (looking-at "#!") ; Shebang | 956 | ;; (while (or (looking-at "#!") ; Shebang |
886 | (looking-at ":;") ; "shell trampoline" | 957 | ;; (looking-at ":;") ; "shell trampoline" |
887 | ) | 958 | ;; ) |
888 | (forward-line 1) | 959 | ;; (forward-line 1) |
889 | (beginning-of-line) | 960 | ;; (beginning-of-line) |
890 | (setq start (point))) | 961 | ;; (setq start (point))) |
891 | (scheme-send-region-and-go start end)))))) | 962 | ;; (scheme-send-region-and-go start end)))))) |
963 | |||
964 | (use-package geiser-guile ; Let's try using guile instead | ||
965 | :ensure t | ||
966 | :config | ||
967 | (keymap-unset scheme-mode-map "M-o" t)) | ||
892 | 968 | ||
893 | (use-package treesit-auto | 969 | (use-package treesit-auto |
894 | ;; XXX: I don't really get the utility of this package, but I spent a ton of | 970 | ;; XXX: I don't really get the utility of this package, but I spent a ton of |
895 | ;; time figuring out how to properly build it ... so here it is. | 971 | ;; time figuring out how to properly build it ... so here it is. |
972 | :ensure t | ||
896 | :when (treesit-available-p) | 973 | :when (treesit-available-p) |
897 | :vc (:url "https://github.com/renzmann/treesit-auto") | 974 | :config |
898 | :config | 975 | ;; (setopt treesit-extra-load-path |
899 | (setopt treesit-extra-load-path | 976 | ;; ;; https://github.com/casouri/tree-sitter-module/ |
900 | ;; https://github.com/casouri/tree-sitter-module/ | 977 | ;; `(,(expand-file-name "~/misc/tree-sitter-module/dist/"))) |
901 | `(,(expand-file-name "~/misc/tree-sitter-module/dist/"))) | 978 | (setopt treesit-auto-install nil) ; javascript keeps failing |
902 | (treesit-auto-apply-remap) | 979 | (global-treesit-auto-mode)) |
903 | (define-advice treesit-install-language-grammar (:after (&rest _) apply-remap) | 980 | |
904 | (treesit-auto-apply-remap))) | 981 | (use-package elpher |
982 | :ensure t) | ||
983 | |||
984 | (use-package detached | ||
985 | :when (executable-find "dtach") | ||
986 | :ensure t | ||
987 | :init (detached-init) | ||
988 | :bind (([remap async-shell-command] . detached-shell-command) | ||
989 | ([remap compile] . detached-compile) | ||
990 | ([remap recompile] . detached-compile-recompile)) | ||
991 | :config | ||
992 | (setf detached-terminal-data-command system-type) | ||
993 | (with-eval-after-load 'consult | ||
994 | (global-set-key [remap detached-open-session] #'detached-consult-session))) | ||