From 9df66e96c4fa98c9b74566712116f4373b5d5c64 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Mon, 20 Feb 2023 16:19:03 -0600 Subject: apsodfiuadsfoiudsfpaoidsufpaosidufposdifuapsodifuapsodifu --- init.el | 198 ++++++++++++++++++++++++++++++++++++++++++++++------------------ 1 file changed, 144 insertions(+), 54 deletions(-) (limited to 'init.el') diff --git a/init.el b/init.el index 264378c..c8fb4e7 100644 --- a/init.el +++ b/init.el @@ -21,21 +21,39 @@ (use-package emacs ; Misc. config :config - (setopt tab-bar-show 1 - recenter-positions '(top middle bottom) + (setopt recenter-positions '(top middle bottom) initial-scratch-message (format "%s\n\n" (mapconcat (lambda (s) (format ";; %s" s)) (process-lines "fortune" "-s") "\n"))) (keymap-global-unset "C-\\") + (keymap-global-unset "") (add-hook 'kill-buffer-query-functions (defun scratch@immortal () (if (equal (buffer-name) "*scratch*") (progn (bury-buffer) nil) t))) (setf (alist-get "\\*Compile-Log\\*" display-buffer-alist nil nil #'equal) - '(display-buffer-no-window))) + '(display-buffer-no-window)) + (add-hook 'after-init-hook + (defun global-mode-string@setup () + (defvar jabber-activity-mode-string) + (defvar org-mode-line-string) + (defvar display-time-mode) + (defvar display-time-string) + (setf global-mode-string + '((t jabber-activity-mode-string) + org-mode-line-string + (display-time-mode display-time-string))))) + (keymap-global-set "C-c t" + (define-keymap + :prefix 'toggle-map + "e" #'toggle-debug-on-error + "q" #'toggle-debug-on-quit + "c" #'column-number-mode + "l" #'line-number-mode + "L" #'display-line-numbers-mode))) (use-package faces :config @@ -123,7 +141,7 @@ (use-package ispell :config - (setopt ispell-program-name (choose-executable "ispell" "aspell")) + (setopt ispell-program-name (choose-executable "aspell" "ispell")) (add-hook 'before-save-hook #'+ispell-move-buffer-words-to-dir-locals-hook) (put 'ispell-buffer-session-localwords 'safe-local-variable @@ -227,6 +245,34 @@ ("w" . Info-copy-current-node-name-0) ("c" . Info-copy-current-node-name))) +(use-package make-mode + :defer t + :config + (add-hook 'makefile-mode-hook + (defun make-mode@setup () + (remove-hook 'write-file-functions + #'makefile-warn-suspicious-lines t) + (remove-hook 'write-file-functions + #'makefile-warn-continuations t)))) + +(use-package eglot + :preface + (defun +eglot-eldoc () + ;; https://www.masteringemacs.org/article/seamlessly-merge-multiple-documentation-sources-eldoc + (setq eldoc-documentation-strategy #'eldoc-documentation-compose-eagerly)) + :hook + ((bash-ts-mode . eglot)) + :config + (add-hook 'eglot-managed-mode . +eglot-eldoc)) + +(use-package eldoc + :config + (setopt eldoc-documentation-strategy #'eldoc-documentation-compose-eagerly) + (setf (alist-get "^\\*eldoc for" display-buffer-alist nil nil #'equal) + '(display-buffer-at-bottom + (window-height . 4))) + (eldoc-add-command-completions "paredit-")) + ;;; Applications @@ -298,8 +344,8 @@ With prefix ARG, toggle the value of (not (eobp))) (titlecase-region (progn (org-beginning-of-line) (point)) (progn (org-end-of-line) (point))))))) - :bind (:map scule-map - ("M-t" . titlecase-dwim))) + :config + (keymap-set scule-map "M-t" #'titlecase-dwim)) (use-package scule :load-path "~/src/emacs/scule/" @@ -367,11 +413,16 @@ With prefix ARG, toggle the value of ("." . jabber-muc-presence-dim)) jabber-activity-make-strings #'jabber-activity-make-strings-shorten jabber-rare-time-format " - - - - - - %H:%M %F" + jabber-muc-header-line-format + '(" " (:eval (replace-regexp-in-string "%" "%%" + (jabber-jid-displayname + jabber-group))) + " / " jabber-muc-topic) ;; buffer name formats - ;; jabber-chat-buffer-format "%n " - ;; jabber-browse-buffer-format "%n " - ;; jabber-groupchat-buffer-format "%n " - ;; jabber-muc-private-buffer-format "%n " + jabber-chat-buffer-format "*xmpp* %n" + jabber-browse-buffer-format "*xmpp-browse* %n" + jabber-groupchat-buffer-format "*xmpp-muc* %n" + jabber-muc-private-buffer-format "*xmpp-muc-private* %n" ;; "prompt" (speaker) formats jabber-groupchat-prompt-format (format "%%>%dn | " jabber-prefix-width) jabber-chat-local-prompt-format (format "%%>%dn | " jabber-prefix-width) @@ -404,7 +455,8 @@ With prefix ARG, toggle the value of (defun jabber-chat@leave-when-kill () (add-hook 'kill-buffer-hook (defun @jabber-leave@kill () - (apply #'jabber-muc-leave (jabber-muc-argument-list))) + (ignore-errors + (apply #'jabber-muc-leave (jabber-muc-argument-list)))) nil :local))) (when (fboundp 'jabber-chat-update-focus) (add-hook 'window-configuration-change-hook #'jabber-chat-update-focus)) @@ -423,13 +475,17 @@ With prefix ARG, toggle the value of (buffer-list)))))) (add-to-list 'consult-buffer-sources 'jabber-chat-buffer-source :append) (consult-customize - consult-buffer :preview-key (kbd "M-.")))) + consult-buffer :preview-key "M-."))) (use-package keepassxc-shim :load-path "~/src/emacs/keepassxc-shim/" :config (keepassxc-shim-activate)) +(use-package hippie-completing-read + :load-path "~/src/emacs/hippie-completing-read/" + :bind (("M-/" . hippie-completing-read))) + ;;; External packages @@ -620,9 +676,7 @@ The prefix argument is as in `visual-fill-column-widen' but negated." prefix))))) ;; Add strings to this list to inhibit adding a space ;; after them. - '(",@")))))) - (with-eval-after-load 'eldoc - (eldoc-add-command #'paredit-backward-delete #'paredit-close-round))) + '(",@"))))))) (use-package hungry-delete :ensure t @@ -666,9 +720,16 @@ The prefix argument is as in `visual-fill-column-widen' but negated." :preface (setopt inferior-lisp-program (choose-executable "sbcl")) :when inferior-lisp-program - :bind (:map sly-mode-map - ("C-c C-z" . sly-mrepl)) + :init + (defun +sly-start-or-mrepl () + (interactive) + (if (ignore-errors (sly-connection)) + (sly-mrepl (lambda (buf) + (display-buffer-pop-up-window buf nil))) + (call-interactively #'sly))) :config + (autoload 'sly-mrepl "sly-mrepl" nil t) + (keymap-set sly-mode-map "C-c C-z" #'+sly-start-or-mrepl) (setopt sly-net-coding-system 'utf-8-unix) (sly-symbol-completion-mode -1)) @@ -728,6 +789,9 @@ The prefix argument is as in `visual-fill-column-widen' but negated." :ensure t :bind ("C-x g" . magit)) +(use-package git-modes + :ensure t) + (use-package eradio :ensure t :preface @@ -800,6 +864,13 @@ With PREFIX, prompt to change the current dictionary." :bind (:map dired-mode-map ("." . dired-hide-dotfiles-mode))) +(use-package dired-git-info + :ensure t + :bind (:map dired-mode-map + (")" . dired-git-info-mode)) + :config + (setopt dgi-auto-hide-details-p nil)) + (use-package embrace :ensure t :preface @@ -860,45 +931,64 @@ With PREFIX, prompt to change the current dictionary." (use-package rec-mode :ensure t) -(use-package gauche-mode - :load-path "~/src/emacs/gauche-mode/" - :mode "\\.scm\\'" - :config - (setopt gauche-mode-info-language 'en - scheme-program-name "gosh -i" - scheme-compile-exp-command "%s") - (add-to-list 'scheme-source-modes 'gauche-mode) - (setf (alist-get "\\*scheme\\*" display-buffer-alist nil nil #'equal) - '((display-buffer-reuse-window - display-buffer-pop-up-window) - (inhibit-same-window . t))) - (add-hook 'gauche-mode-hook #'enable-gauche-paredit-mode) - (add-hook 'inferior-scheme-mode-hook #'enable-gauche-paredit-mode) - ;; Extras - (define-key gauche-mode-map (kbd "C-c C-k") - (defun +gauche-mode-send-buffer () - (interactive) - (save-mark-and-excursion - (let ((start (point-min)) - (end (point-max))) - (goto-char start) - (while (or (looking-at "#!") ; Shebang - (looking-at ":;") ; "shell trampoline" - ) - (forward-line 1) - (beginning-of-line) - (setq start (point))) - (scheme-send-region-and-go start end)))))) +;; (use-package gauche-mode +;; :load-path "~/src/emacs/gauche-mode/" +;; :mode "\\.scm\\'" +;; :config +;; (setopt gauche-mode-info-language 'en +;; scheme-program-name "gosh -i" +;; scheme-compile-exp-command "%s") +;; (add-to-list 'scheme-source-modes 'gauche-mode) +;; (setf (alist-get "\\*scheme\\*" display-buffer-alist nil nil #'equal) +;; '((display-buffer-reuse-window +;; display-buffer-pop-up-window) +;; (inhibit-same-window . t))) +;; (add-hook 'gauche-mode-hook #'enable-gauche-paredit-mode) +;; (add-hook 'inferior-scheme-mode-hook #'enable-gauche-paredit-mode) +;; ;; Extras +;; (define-key gauche-mode-map (kbd "C-c C-k") +;; (defun +gauche-mode-send-buffer () +;; (interactive) +;; (save-mark-and-excursion +;; (let ((start (point-min)) +;; (end (point-max))) +;; (goto-char start) +;; (while (or (looking-at "#!") ; Shebang +;; (looking-at ":;") ; "shell trampoline" +;; ) +;; (forward-line 1) +;; (beginning-of-line) +;; (setq start (point))) +;; (scheme-send-region-and-go start end)))))) + +(use-package geiser-guile ; Let's try using guile instead + :ensure t + :config + (keymap-unset scheme-mode-map "M-o" t)) (use-package treesit-auto ;; XXX: I don't really get the utility of this package, but I spent a ton of ;; time figuring out how to properly build it ... so here it is. + :ensure t :when (treesit-available-p) - :vc (:url "https://github.com/renzmann/treesit-auto") - :config - (setopt treesit-extra-load-path - ;; https://github.com/casouri/tree-sitter-module/ - `(,(expand-file-name "~/misc/tree-sitter-module/dist/"))) - (treesit-auto-apply-remap) - (define-advice treesit-install-language-grammar (:after (&rest _) apply-remap) - (treesit-auto-apply-remap))) + :config + ;; (setopt treesit-extra-load-path + ;; ;; https://github.com/casouri/tree-sitter-module/ + ;; `(,(expand-file-name "~/misc/tree-sitter-module/dist/"))) + (setopt treesit-auto-install nil) ; javascript keeps failing + (global-treesit-auto-mode)) + +(use-package elpher + :ensure t) + +(use-package detached + :when (executable-find "dtach") + :ensure t + :init (detached-init) + :bind (([remap async-shell-command] . detached-shell-command) + ([remap compile] . detached-compile) + ([remap recompile] . detached-compile-recompile)) + :config + (setf detached-terminal-data-command system-type) + (with-eval-after-load 'consult + (global-set-key [remap detached-open-session] #'detached-consult-session))) -- cgit 1.4.1-21-gabe81