nix-config/users/tacocat/emacs/default.nix

99 lines
2.9 KiB
Nix
Raw Normal View History

2023-10-21 00:49:53 +00:00
{pkgs, ...}: {
programs.emacs = {
enable = true;
package = pkgs.emacs29-gtk3;
extraConfig = ''
2023-11-05 02:44:54 +00:00
(menu-bar-mode -1)
(tool-bar-mode -1)
(scroll-bar-mode -1)
(blink-cursor-mode 0)
2023-10-21 00:49:53 +00:00
2023-11-05 02:44:54 +00:00
;; scale headings in org-mode
(setq zenburn-scale-org-headlines t)
2023-10-21 00:49:53 +00:00
2023-11-05 02:44:54 +00:00
;; scale headings in outline-mode
(setq zenburn-scale-outline-headlines t)
(load-theme 'zenburn :no-confirm)
2023-10-21 00:49:53 +00:00
2023-11-05 02:44:54 +00:00
(add-to-list 'default-frame-alist
'(font . "Maple Mono-12"))
2023-10-21 00:49:53 +00:00
2023-11-05 02:44:54 +00:00
(global-set-key (kbd "C-c a") #'org-agenda)
(global-set-key (kbd "C-c f") #'recentf-open)
(global-hl-line-mode 1)
2023-10-21 00:49:53 +00:00
2023-11-05 02:44:54 +00:00
(global-visual-line-mode 1)
(setq evil-respect-visual-line-mode 1)
2023-10-21 00:49:53 +00:00
2023-11-05 02:44:54 +00:00
(require 'evil)
(evil-mode 1)
2023-10-21 00:49:53 +00:00
2023-11-05 02:44:54 +00:00
(require 'evil-org)
(add-hook 'org-mode-hook 'evil-org-mode)
(evil-org-set-key-theme '(textobjects insert navigation additional shift todo heading))
(require 'evil-org-agenda)
(evil-org-agenda-set-keys)
2023-10-21 00:49:53 +00:00
2023-11-05 02:44:54 +00:00
(setq org-startup-with-inline-images 1)
(setq org-startup-indented 1)
2023-10-21 00:49:53 +00:00
2023-11-05 02:44:54 +00:00
;;(global-display-line-numbers-mode 1)
;;(setq display-line-numbers-type 'visual)
2023-10-21 00:49:53 +00:00
2023-11-05 02:44:54 +00:00
(require 'org-download)
2023-10-21 00:49:53 +00:00
2023-11-05 02:44:54 +00:00
;; Drag-and-drop to `dired`
(add-hook 'dired-mode-hook 'org-download-enable)
2023-10-21 00:49:53 +00:00
2023-11-05 02:44:54 +00:00
(setq org-image-actual-width nil)
(setq ring-bell-function 'ignore)
(setq org-agenda-files '(
"~/sync/org/agenda.org"
"~/sync/org/school/agendas/"
))
(setq org-agenda-span 'fortnight)
2023-10-21 00:49:53 +00:00
2023-11-05 02:44:54 +00:00
(require 'ox-publish) (setq org-publish-project-alist
'(
2023-10-21 00:49:53 +00:00
2023-11-05 02:44:54 +00:00
;; ... add all the components here (see below)...
2023-10-21 00:49:53 +00:00
2023-11-05 02:44:54 +00:00
("org-notes"
:base-directory "~/sync/org/"
:base-extension "org"
:publishing-directory "~/public_html/"
:recursive t
:publishing-function org-html-publish-to-html
:headline-levels 4 ; Just the default for this project.
:auto-preamble t
)
2023-10-21 00:49:53 +00:00
2023-11-05 02:44:54 +00:00
("org-static"
:base-directory "~/sync/org/"
:base-extension "css\\|js\\|png\\|jpg\\|gif\\|pdf\\|mp3\\|ogg\\|swf"
:publishing-directory "~/public_html/"
:recursive t
:publishing-function org-publish-attachment
)
2023-10-21 00:49:53 +00:00
2023-11-05 02:44:54 +00:00
;; publish component
("org" :components ("org-notes" "org-static"))
2023-10-21 00:49:53 +00:00
2023-11-05 02:44:54 +00:00
))
2023-10-21 00:49:53 +00:00
''; # TODO move plugin setup into a seperate file to keep things organized
# also add autoloading so emacs starts faster
extraPackages = epkgs:
with epkgs; [
zenburn-theme
color-theme-tangotango
evil
evil-org
org-download
ox-pandoc
2023-11-05 02:44:54 +00:00
monokai-theme
2023-10-21 00:49:53 +00:00
];
};
}