From 443519b0903e891101beb9b80819611c8c021a0c Mon Sep 17 00:00:00 2001 From: eriedaberrie Date: Wed, 8 Mar 2023 22:34:06 -0800 Subject: [PATCH] Add forge, hl-todo --- init.el | 100 ++++++++++++++++++++++++++++++++++++++------------------ 1 file changed, 68 insertions(+), 32 deletions(-) diff --git a/init.el b/init.el index 97d80d3..1389a12 100644 --- a/init.el +++ b/init.el @@ -1,11 +1,17 @@ ;;; EMACS init file -*- lexical-binding:t -*- +(defconst my-is-nixos (file-exists-p "/nix") + "Whether or not Emacs is running on NixOS.") + +(when my-is-nixos + (setq auth-sources '("/run/agenix/authinfo"))) + (with-eval-after-load 'package (add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/")) (package-initialize)) -(setq use-package-always-ensure (not (file-exists-p "/nix")) +(setq use-package-always-ensure (not my-is-nixos) use-package-always-defer t use-package-expand-minimally t) (require 'use-package) @@ -256,13 +262,14 @@ (use-package aggressive-indent :custom (aggressive-indent-sit-for-time 0.1) - :hook (emacs-lisp-mode - ielm-mode - lisp-mode - lisp-interaction-mode - scheme-mode - clojure-mode - nix-mode) + :hook + emacs-lisp-mode + ielm-mode + lisp-mode + lisp-interaction-mode + scheme-mode + clojure-mode + nix-mode :config (with-eval-after-load 'meow (add-to-list 'aggressive-indent-protected-commands #'my-meow-undo) @@ -280,20 +287,23 @@ (which-key-mode)) (use-package lsp-mode - :hook ((c-ts-mode . lsp-deferred) - (c++-ts-mode . lsp-deferred) - (html-mode . lsp-deferred) - (lsp-mode . lsp-enable-which-key-integration)) + :hook + (c-ts-mode . lsp-deferred) + (c++-ts-mode . lsp-deferred) + (html-mode . lsp-deferred) + (lsp-mode . lsp-enable-which-key-integration) :custom (read-process-output-max (* 1024 1024)) ; 1 MB (lsp-keymap-prefix "M-o")) (use-package lsp-java - :hook (java-ts-mode . lsp-deferred)) + :hook + (java-ts-mode . lsp-deferred)) (use-package lsp-ui) (use-package lsp-treemacs - :hook (lsp-mode . lsp-treemacs-sync-mode)) + :hook + (lsp-mode . lsp-treemacs-sync-mode)) (use-package dap-mode :bind (:map lsp-command-map ("d" . dap-hydra)) @@ -327,19 +337,22 @@ (use-package yasnippet-snippets) (use-package consult - :bind (("M-s r" . consult-ripgrep) - ("M-s d" . consult-find) - ("C-x M-:" . consult-complex-command) - ("C-x b" . consult-buffer) - ("C-x r b" . consult-bookmark))) + :bind + ("M-s r" . consult-ripgrep) + ("M-s d" . consult-find) + ("C-x M-:" . consult-complex-command) + ("C-x b" . consult-buffer) + ("C-x r b" . consult-bookmark)) (use-package consult-yasnippet - :bind (("C-c s" . consult-yasnippet) - ("C-c S" . consult-yasnippet-visit-snippet-file))) + :bind + ("C-c s" . consult-yasnippet) + ("C-c S" . consult-yasnippet-visit-snippet-file)) (use-package embark - :bind (("C-." . embark-act) - ("C-;" . embark-dwim))) + :bind + ("C-." . embark-act) + ("C-;" . embark-dwim)) (use-package embark-consult) @@ -388,7 +401,7 @@ :demand t) (use-package all-the-icons-completion - :after (marginalia all-the-icons) + :after marginalia all-the-icons :hook (marginalia-mode . all-the-icons-completion-marginalia-setup) :init (all-the-icons-completion-mode)) @@ -434,9 +447,10 @@ (buffer-face-mode)) (use-package org - :hook ((org-mode . org-indent-mode) - (org-mode . auto-fill-mode) - (org-mode . my-set-text-modes-font)) + :hook + (org-mode . org-indent-mode) + (org-mode . auto-fill-mode) + (org-mode . my-set-text-modes-font) :custom-face (org-block ((t (:family "JetbrainsMono Nerd Font" :height 105)))) (org-code ((t (:family "JetbrainsMono Nerd Font" :height 105)))) @@ -551,6 +565,10 @@ (use-package magit :hook (git-commit-setup . my-magit-commit-text-setup)) +(use-package forge + :after magit + :demand t) + (use-package tramp :custom (remote-file-name-inhibit-cache nil) @@ -561,14 +579,16 @@ tramp-file-name-regexp))) (use-package vterm - :bind (("C-c t" . vterm) - ("C-c T" . vterm-other-window)) + :bind + ("C-c t" . vterm) + ("C-c T" . vterm-other-window) :hook (vterm-mode . my-inhibit-hl-line-mode) :config (with-eval-after-load 'meow (defvar meow-vterm-normal-mode-map (let ((map (make-sparse-keymap))) - (define-key map (kbd "RET") #'vterm-send-return) map)) + (define-key map (kbd "RET") #'vterm-send-return) + map)) (setq vterm-keymap-exceptions '("C-c")) (define-key vterm-mode-map (kbd "C-c ESC") #'vterm-send-escape) (dolist (c '((yank . vterm-yank) @@ -598,9 +618,13 @@ (use-package xkcd) +(use-package hl-todo + :hook prog-mode) + (use-package ligature - :hook (prog-mode - (ligature-mode . prettify-symbols-mode)) + :hook + prog-mode + (ligature-mode . prettify-symbols-mode) :custom (prettify-symbols-unprettify-at-point t) :config @@ -631,6 +655,8 @@ (defun my-load-theme-with-solaire () (load-theme 'catppuccin t) (catppuccin-reload) + (face-spec-set 'font-lock-variable-name-face `((t (:foreground + ,(catppuccin-get-color 'flamingo))))) (solaire-global-mode) (when (daemonp) (remove-hook 'server-after-make-frame-hook #'my-load-theme-with-solaire))) @@ -648,6 +674,16 @@ (add-hook 'server-after-make-frame-hook #'my-load-theme-with-solaire) (my-load-theme-with-solaire))) +(use-package with-editor + :bind + ([remap async-shell-command] . with-editor-async-shell-command) + ([remap shell-command] . with-editor-shell-command) + :hook + (shell-mode . with-editor-export-editor) + (eshell-mode . with-editor-export-editor) + (term-exec . with-editor-export-editor) + (vterm-mode . with-editor-export-editor)) + (use-package emacs-everywhere :ensure nil :commands emacs-everywhere