From 9710c104de89fcd165dca795ef358bd46e63fdc3 Mon Sep 17 00:00:00 2001 From: Xe Date: Thu, 12 Jan 2023 15:57:35 -0500 Subject: [PATCH] update emacs Signed-off-by: Xe --- common/home-manager/emacs/default.nix | 186 ++++++++++++++----------- common/users/cadey/spacemacs/spacemacs | 4 +- 2 files changed, 108 insertions(+), 82 deletions(-) diff --git a/common/home-manager/emacs/default.nix b/common/home-manager/emacs/default.nix index 6d6c4c9..4aef936 100644 --- a/common/home-manager/emacs/default.nix +++ b/common/home-manager/emacs/default.nix @@ -4,7 +4,8 @@ with lib; let cfg = config.within.emacs; in { - options.within.emacs.enable = mkEnableOption "emacs without spacemacs support"; + options.within.emacs.enable = + mkEnableOption "emacs without spacemacs support"; imports = [ ./emacs-init.nix ]; config = mkIf cfg.enable { @@ -69,7 +70,7 @@ in { str) (setq str (replace-match "" t t str))) str) - (setq gofmt-command "goimports") + (defun eshell/e (arg) "opens a given file in emacs from eshell" (find-file arg)) @@ -86,15 +87,15 @@ in { (other-window 1) (find-file arg)) - (set-frame-parameter (selected-frame) 'alpha '(85 . 85)) - (add-to-list 'default-frame-alist '(alpha . (85 . 85))) - (xterm-mouse-mode) ''; usePackageVerbose = true; usePackage = { + # core packages + better-defaults.enable = true; + company = { enable = true; diminish = [ "company-mode" ]; @@ -103,8 +104,6 @@ in { ''; }; - dockerfile-mode = { enable = true; }; - counsel = { enable = true; @@ -129,8 +128,6 @@ in { ''; }; - cython-mode = { enable = true; }; - direnv = { enable = true; config = '' @@ -138,8 +135,6 @@ in { ''; }; - better-defaults.enable = true; - evil = { enable = true; init = '' @@ -175,8 +170,6 @@ in { ''; }; - go-mode.enable = true; - lsp-mode = { enable = true; command = [ "lsp" ]; @@ -202,16 +195,6 @@ in { command = [ "lsp-ivy-workspace-symbol" ]; }; - nlinum-relative = { - enable = true; - after = [ "evil" ]; - config = '' - (nlinum-relative-setup-evil) - (add-hook 'prog-mode-hook 'nlinum-relative-mode) - (add-hook 'org-mode-hook 'nlinum-relative-mode) - ''; - }; - general = { enable = true; after = [ "evil" "which-key" ]; @@ -294,26 +277,6 @@ in { ]; }; - nix = { enable = true; }; - - nix-mode = { - enable = true; - mode = [ ''"\\.nix\\'"'' ]; - bindLocal = { nix-mode-map = { "C-i" = "nix-indent-line"; }; }; - }; - - nix-prettify-mode = { - enable = true; - config = '' - (nix-prettify-global-mode) - ''; - }; - - nix-drv-mode = { - enable = true; - mode = [ ''"\\.drv\\'"'' ]; - }; - projectile = { enable = true; after = [ "ivy" ]; @@ -335,8 +298,6 @@ in { ''; }; - protobuf-mode = { enable = true; }; - swiper = { enable = true; @@ -369,6 +330,106 @@ in { ''; }; + nov = { + enable = true; + mode = [ ''"\\.epub\\'"'' ]; + }; + + web-mode = { + enable = true; + mode = [ ''"\\.html\\'"'' ''"\\.tmpl\\'"'' ]; + }; + + # org-mode + org = { + enable = true; + config = '' + (setq org-agenda-files '("~/org/daily/" "~/org/")) + + (setq org-capture-templates '(("c" "Contacts" entry (file "~/org/contacts.org") + "* %(org-contacts-template-name)\n:PROPERTIES:\n:EMAIL: %(org-contacts-template-email)\n:END:"))) + ''; + }; + + org-journal = { + enable = true; + config = '' + (setq org-journal-dir "~/org/daily/") + (setq org-journal-date-prefix "#+startup: logdrawer\n#+options: d:t\n#+TITLE: ") + (setq org-journal-file-format "%Y%m%d.org") + (setq org-journal-time-prefix "* ") + (setq org-journal-time-format "TODO ") + (setq org-journal-enable-agenda-integration t) + ''; + }; + + org-roam = { + enable = true; + config = '' + (setq org-roam-directory "~/org/roam") + ''; + }; + + ob.enable = true; + org-download.enable = true; + org-mime.enable = true; + org-pomodoro.enable = true; + org-projectile.enable = true; + org-contacts.enable = true; + ox-epub.enable = true; + org-roam-ui.enable = true; + org-roam-protocol.enable = true; + + weechat.enable = true; + systemd.enable = true; + + gemini-mode.enable = true; + highlight-indent-guides.enable = true; + "0x0".enable = true; + request.enable = true; + + # programming languages + cython-mode.enable = true; + dockerfile-mode.enable = true; + nix.enable = true; + protobuf-mode.enable = true; + terraform-mode.enable = true; + tide.enable = true; + typescript-mode.enable = true; + + deno-fmt = { + enable = true; + config = '' + (add-hook 'typescript-mode-hook 'deno-fmt-mode) + (add-hook 'js2-mode-hook 'deno-fmt-mode) + ''; + }; + + go-mode = { + enable = true; + config = '' + (setq gofmt-command "goimports") + ''; + }; + + nix-mode = { + enable = true; + mode = [ ''"\\.nix\\'"'' ]; + bindLocal = { nix-mode-map = { "C-i" = "nix-indent-line"; }; }; + }; + + nix-prettify-mode = { + enable = true; + config = '' + (nix-prettify-global-mode) + ''; + }; + + nix-drv-mode = { + enable = true; + mode = [ ''"\\.drv\\'"'' ]; + }; + dhall-mode = { enable = true; mode = [ ''"\\.dhall\\'"'' ]; @@ -393,41 +454,6 @@ in { enable = true; mode = [ ''"\\.zig\\'"'' ]; }; - - nov = { - enable = true; - mode = [ ''"\\.epub\\'"'' ]; - }; - - web-mode = { - enable = true; - mode = [ ''"\\.html\\'"'' ''"\\.tmpl\\'"'' ]; - }; - - ob.enable = true; - org-download.enable = true; - org.enable = true; - org-mime.enable = true; - org-pomodoro.enable = true; - org-projectile.enable = true; - - weechat.enable = true; - systemd.enable = true; - terraform-mode.enable = true; - - gemini-mode.enable = true; - highlight-indent-guides.enable = true; - "0x0".enable = true; - - typescript-mode.enable = true; - tide.enable = true; - deno-fmt = { - enable = true; - config = '' - (add-hook 'typescript-mode-hook 'deno-fmt-mode) - (add-hook 'js2-mode-hook 'deno-fmt-mode) - ''; - }; }; }; }; diff --git a/common/users/cadey/spacemacs/spacemacs b/common/users/cadey/spacemacs/spacemacs index c0d01ae..5902d7d 100644 --- a/common/users/cadey/spacemacs/spacemacs +++ b/common/users/cadey/spacemacs/spacemacs @@ -63,14 +63,14 @@ values." org-journal-dir "~/org/daily/" org-journal-enable-agenda-integration t org-journal-file-format "%Y%m%d.org" - org-journal-date-prefix "#+startup: logdrawer\n#+options: d:t\n#+TITLE: \n\n* Media\n* Calendar\n* Recurring\n** TODO Prune /r/tailscale\n** TODO Exercise\n** TODO Meditation\n" + org-journal-date-prefix "#+startup: logdrawer\n#+options: d:t\n#+TITLE: " org-journal-time-prefix "* " org-journal-time-format "TODO " org-enable-epub-support t org-enable-github-support t org-enable-org-contacts-support t org-contacts-files '("~/org/contacts.org") - org-capture-templates '(("c" "Contacts" entry (file "~/Org/contacts.org") + org-capture-templates '(("c" "Contacts" entry (file "~/org/contacts.org") "* %(org-contacts-template-name) :PROPERTIES: :EMAIL: %(org-contacts-template-email)