update emacs

Signed-off-by: Xe <me@christine.website>
This commit is contained in:
Cadey Ratio 2023-01-12 15:57:35 -05:00
parent e75468ac3f
commit 9710c104de
2 changed files with 108 additions and 82 deletions

View File

@ -4,7 +4,8 @@ with lib;
let cfg = config.within.emacs; let cfg = config.within.emacs;
in { in {
options.within.emacs.enable = mkEnableOption "emacs without spacemacs support"; options.within.emacs.enable =
mkEnableOption "emacs without spacemacs support";
imports = [ ./emacs-init.nix ]; imports = [ ./emacs-init.nix ];
config = mkIf cfg.enable { config = mkIf cfg.enable {
@ -69,7 +70,7 @@ in {
str) str)
(setq str (replace-match "" t t str))) (setq str (replace-match "" t t str)))
str) str)
(setq gofmt-command "goimports")
(defun eshell/e (arg) (defun eshell/e (arg)
"opens a given file in emacs from eshell" "opens a given file in emacs from eshell"
(find-file arg)) (find-file arg))
@ -86,15 +87,15 @@ in {
(other-window 1) (other-window 1)
(find-file arg)) (find-file arg))
(set-frame-parameter (selected-frame) 'alpha '(85 . 85))
(add-to-list 'default-frame-alist '(alpha . (85 . 85)))
(xterm-mouse-mode) (xterm-mouse-mode)
''; '';
usePackageVerbose = true; usePackageVerbose = true;
usePackage = { usePackage = {
# core packages
better-defaults.enable = true;
company = { company = {
enable = true; enable = true;
diminish = [ "company-mode" ]; diminish = [ "company-mode" ];
@ -103,8 +104,6 @@ in {
''; '';
}; };
dockerfile-mode = { enable = true; };
counsel = { counsel = {
enable = true; enable = true;
@ -129,8 +128,6 @@ in {
''; '';
}; };
cython-mode = { enable = true; };
direnv = { direnv = {
enable = true; enable = true;
config = '' config = ''
@ -138,8 +135,6 @@ in {
''; '';
}; };
better-defaults.enable = true;
evil = { evil = {
enable = true; enable = true;
init = '' init = ''
@ -175,8 +170,6 @@ in {
''; '';
}; };
go-mode.enable = true;
lsp-mode = { lsp-mode = {
enable = true; enable = true;
command = [ "lsp" ]; command = [ "lsp" ];
@ -202,16 +195,6 @@ in {
command = [ "lsp-ivy-workspace-symbol" ]; 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 = { general = {
enable = true; enable = true;
after = [ "evil" "which-key" ]; 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 = { projectile = {
enable = true; enable = true;
after = [ "ivy" ]; after = [ "ivy" ];
@ -335,8 +298,6 @@ in {
''; '';
}; };
protobuf-mode = { enable = true; };
swiper = { swiper = {
enable = true; 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 = { dhall-mode = {
enable = true; enable = true;
mode = [ ''"\\.dhall\\'"'' ]; mode = [ ''"\\.dhall\\'"'' ];
@ -393,41 +454,6 @@ in {
enable = true; enable = true;
mode = [ ''"\\.zig\\'"'' ]; 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)
'';
};
}; };
}; };
}; };

View File

@ -63,14 +63,14 @@ values."
org-journal-dir "~/org/daily/" org-journal-dir "~/org/daily/"
org-journal-enable-agenda-integration t org-journal-enable-agenda-integration t
org-journal-file-format "%Y%m%d.org" 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-prefix "* "
org-journal-time-format "TODO " org-journal-time-format "TODO "
org-enable-epub-support t org-enable-epub-support t
org-enable-github-support t org-enable-github-support t
org-enable-org-contacts-support t org-enable-org-contacts-support t
org-contacts-files '("~/org/contacts.org") 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) "* %(org-contacts-template-name)
:PROPERTIES: :PROPERTIES:
:EMAIL: %(org-contacts-template-email) :EMAIL: %(org-contacts-template-email)