(setq user-full-name " Tim Dysinger"
user-login-name " tim"
user-mail-address " [email protected] " )
(defconst my/pgp-public-key " 0x3F1AB897B5072741" )
(defconst my/org-directory (expand-file-name " ~/org" ))
(defconst my/org-agenda-file
(expand-file-name " agenda.org" my/org-directory))
(defconst my/org-projectile-file
(expand-file-name " projects.org" my/org-directory))
(defun my/sort-words (reverse beg end )
" Sort words from BEG to END alphabetically, in REVERSE if negative.
Prefixed with negative \\ [universal-argument], sorts in reverse.
The variable `sort-fold-case' determines whether alphabetic case
affects the sort order. See `sort-regexp-fields' ."
(interactive " *P\n r" )
(sort-regexp-fields reverse " \\ w+" " \\ &" beg end))
(set-language-environment " UTF-8" )
(set-default-coding-systems 'utf-8 )
(setq inhibit-splash-screen t )
(menu-bar-mode -1 )
(when (display-graphic-p )
(scroll-bar-mode -1 )
(tool-bar-mode -1 ))
(setq create-lockfiles nil )
(setq-default indent-tabs-mode nil )
(setq-default tabs-always-indent 'complete )
(setq-default fill-column 80 )
(add-hook
'prog-mode-hook
'(lambda ()
(bind-key " \C -m" 'newline-and-indent )))
(setq column-number-mode t )
(setq-default vc-follow-symlinks t )
(setq backup-directory-alist `((" ." . " ~/.emacs.d/backup" )))
Remove after nixification of pkgs
(setq-default package-archives
'((" gnu" . " https://elpa.gnu.org/packages/" )
; ;("melpa-stable" . "https://stable.melpa.org/packages/")
(" melpa" . " https://melpa.org/packages/" ))
package-enable-at-startup nil
; ; TLS BUG IN EMACS =< 26.3
gnutls-algorithm-priority " NORMAL:-VERS-TLS1.3" )
(package-initialize )
(unless (package-installed-p 'use-package )
(package-refresh-contents )
(package-install 'use-package )
(package-install 'bind-key )
(package-install 'delight ))
Remove after nixification of pkgs
(require 'use-package-ensure )
(setq use-package-always-ensure t )
(setq use-package-always-pin " melpa" )
(require 'bind-key )
(require 'delight )
(use-package use-package-chords
:config (key-chord-mode +1 ))
(use-package auto-package-update
:custom
((auto-package-update-delete-old-versions t )
(auto-package-update-hide-results t ))
:config
(auto-package-update-maybe))
(use-package quelpa)
(use-package quelpa-use-package)
(use-package base16-theme
:config
(setq base16-theme-256-color-source
(if (display-graphic-p ) " colors" " base16-shell" ))
(load-theme 'base16-phd t ))
(use-package whitespace
:custom
((whitespace-line-column 80 )
(whitespace-style '(face empty indentation tabs trailing lines)))
:config (global-whitespace-mode +1 )
:hook (before-save . whitespace-cleanup))
(use-package direnv
:hook (after-init . direnv-mode))
(use-package fish-mode)
(use-package fish-completion)
(use-package flycheck
:hook (after-init . global-flycheck-mode))
(use-package flycheck-rust
:hook (flycheck-mode . flycheck-rust-setup))
(use-package flycheck-ocaml :disabled t )
(use-package flycheck-ledger :disabled t )
(use-package ido
:custom
((ido-enable-flex-matching t )
(ido-use-filename-at-point 'guess ))
:hook (after-init . ido-mode))
(use-package ido-yes-or-no
:hook (after-init . ido-yes-or-no-mode))
(use-package autorevert
:delight auto-revert-mode
:hook (after-init . global-auto-revert-mode))
(use-package rainbow-identifiers
:hook (prog-mode . rainbow-identifiers-mode))
(use-package rainbow-delimiters
:hook (prog-mode . rainbow-delimiters-mode))
(use-package projectile
:delight '(:eval (concat " " (projectile-project-name)))
:bind-keymap (" C-c p" . projectile-command-map)
:config (projectile-mode))
(use-package projectile-direnv :disabled t )
(use-package projectile-git-autofetch :disabled t )
(use-package org
:custom
((org-agenda-dim-blocked-tasks 'dim )
(org-agenda-files (list my/org-agenda-file my/org-projectile-file))
(org-agenda-hide-tags-regexp " ^:$" )
; ; (org-agenda-skip-deadline-if-done t)
; ; (org-agenda-skip-deadline-prewarning-if-scheduled t)
; ; (org-agenda-skip-scheduled-if-deadline-is-shown t)
; ; (org-agenda-skip-scheduled-if-done t)
(org-agenda-span 'day )
(org-agenda-tags-column -120 )
; ; (org-agenda-tags-todo-honor-ignore-options t)
; ; (org-agenda-todo-ignore-deadlines 3)
; ; (org-agenda-todo-ignore-scheduled 3)
(org-agenda-custom-commands
; ; https://orgmode.org/manual/Custom-Agenda-Views.html
; ; https://github.com/alphapapa/org-super-agenda
'((" --" " Agenda"
((agenda
" "
((org-super-agenda-groups
'((:name " Overdue" :and (:deadline past :not (:tag " DONE" )))
(:name " Today" :time-grid t :log t :habit t )
(:auto-group " CATEGORY" )))))
(todo
" "
((org-agenda-overriding-header " Projects" )
(org-super-agenda-groups
'((:name none :children todo)
(:discard (:anything t ))))))))
(" -c" " @COMPUTER"
((tags-todo
" @COMPUTER"
((org-agenda-dim-blocked-tasks 'invisible )))))
(" -e" " @ERRAND"
((tags-todo
" @ERRAND"
((org-agenda-dim-blocked-tasks 'invisible )))))
(" -h" " @HOME"
((tags-todo
" @HOME"
((org-agenda-dim-blocked-tasks 'invisible )))))
(" -w" " @WORK"
((tags-todo
" @WORK"
((org-agenda-dim-blocked-tasks 'invisible )))))
(" -s" " @SARA"
((tags-todo
" @SARA"
((org-agenda-dim-blocked-tasks 'invisible )))))
(" -j"
" @JACOB"
((tags-todo
" @JACOB"
((org-agenda-dim-blocked-tasks 'invisible )))))
(" -a"
" @ABI"
((tags-todo
" @ABI"
((org-agenda-dim-blocked-tasks 'invisible )))))))
(org-archive-location " .%s.bak::" )
(org-babel-load-languages '((ditaa . t ) (dot . t ) (emacs-lisp . t ) (gnuplot . t ) (ledger . t ) (shell . t ) (shen . t )))
(org-capture-templates '((" t" " TODO" entry (file+headline my/org-agenda-file " Inbox" ) " * TODO %?\n " )))
(org-completion-use-ido t )
(org-crypt-key my/pgp-public-key)
(org-crypt-tag-matcher " SECRET" )
(org-default-notes-file my/org-agenda-file)
(org-directory my/org-directory)
(org-ditaa-jar-path " /run/current-system/sw/lib/ditaa.jar" )
(org-enforce-todo-checkbox-dependencies t )
(org-enforce-todo-dependencies t )
(org-global-properties '((" Effort_ALL" . " 0 0:15 0:30 1:00 2:00 3:00 4:00" )))
(org-habit-graph-column 60 )
(org-hide-block-startup t )
(org-hide-leading-stars t )
(org-modules '(org-habit))
(org-startup-folded 'content )
(org-tag-alist '((" @COMPUTER" . ?c ) (" @ERRAND" . ?e ) (" @HOME" . ?h ) (" @WORK" . ?w ) (" @TIM" . ?t ) (" @SARA" . ?s ) (" @JACOB" . ?j ) (" @ABI" . ?a )))
(org-odd-levels-only t )
(org-outline-path-complete-in-steps nil )
(org-refile-allow-creating-parent-nodes 'confirm )
(org-refile-targets '((nil :maxlevel . 6 ) (org-agenda-files :maxlevel . 6 )))
(org-refile-use-outline-path 'file )
(org-return-follows-link t )
(org-tags-column 0 )
(org-tags-exclude-from-inheritance '(" SECRET" ))
; ; (org-track-ordered-property-with-tag t)
; ; (org-use-property-inheritance t)
)
:config
(org-babel-do-load-languages 'org-babel-load-languages nil )
(require 'org-crypt )
:bind
((" C-c a" . org-agenda)
(" C-c c" . org-capture)
(" C-c t" . (lambda () (interactive ) (org-capture nil " t" )))
(" C-c s" . org-sort))
:hook
(kill-emacs-query-functions . 'my/org-clock-query-out ))
(use-package org-ql)
(use-package org-clock-csv :disabled t )
(use-package org-caldav
:disabled t
:config
(progn
(setq org-caldav-url " https://www.google.com/calendar/dav"
org-caldav-inbox my/org-agenda-file
org-caldav-files (list my/org-calendar-file)
org-icalendar-timezone " America/Los_Angeles" )))
(use-package org-pomodoro)
(use-package org-super-agenda
:hook (org-agenda-mode . org-super-agenda-mode))
(use-package ox-reveal
:disabled t
:commands org-reveal
:config
(setq org-reveal-root
" /nix/var/nix/profiles/system/sw/lib/node_modules/reveal" ))
(use-package org-projectile
:requires (:all org projectile)
:custom
((org-projectile-projects-file my/org-projectile-file))
:config
(push (org-projectile-project-todo-entry) org-capture-templates)
:bind
((" C-c n p" . org-projectile-project-todo-completing-read)))
(use-package deft
:custom
((deft-directory my/org-directory)
(deft-default-extension " org" )
(deft-use-filename-as-title t ))
:bind
((" C-x d" . deft)
(" C-x D" . deft-new-file)))
(use-package treemacs)
(use-package treemacs-projectile)
(use-package treemacs-magit)
(use-package magit :bind ((" C-x g" . magit-status)))
(use-package magit-annex :disabled t )
(use-package magit-gerrit :disabled t )
(use-package magit-gh-pulls :disabled t )
(use-package magit-gitflow :disabled t )
(use-package magit-lfs :disabled t )
(use-package magit-pop-up :disabled t )
(use-package magit-svn :disabled t )
(use-package magit-topgit :disabled t )
(use-package origami
:disabled t
:delight origami-mode
; ;:config
; ;(add-to-list 'origami-parser-alist '(reason-mode . origami-c-style-parser))
:hook prog-mode
:bind
((" <backtab>" . origami-forward-toggle-node)))
(use-package iedit
:disabled t
:bind ((" C-c i" . iedit-mode)))
(use-package markdown-mode)
(use-package nix-mode
:config (add-to-list 'auto-mode-alist '(" .*\\ .nix\\ '" . nix-mode)))
(use-package dhall-mode)
(use-package json-mode)
(use-package toml-mode)
(use-package yaml-mode)
(use-package web-mode)
(use-package js2-mode :custom ((js-indent-level 2 )))
(use-package rjsx-mode
:config (add-to-list 'auto-mode-alist '(" .*\\ .js\\ '" . rjsx-mode)))
(use-package helm
:bind ((" M-x" . helm-M-x)
(" C-x b" . helm-mini)
(" C-x C-b" . helm-buffers-list)
(" C-h f" . helm-apropos))
:hook (after-init . (lambda () (helm-mode +1 ))))
(use-package helm-dash :disabled t )
(use-package helm-projectile)
(use-package helm-lsp)
(use-package company :hook (after-init . global-company-mode))
(use-package company-lsp)
(use-package company-ngram)
(use-package company-racer)
(use-package company-shell)
(use-package company-statistics)
(use-package company-web)
(use-package lsp-mode)
(use-package lsp-haskell)
(use-package lsp-ocaml :disabled t )
(use-package lsp-origami)
(use-package lsp-rust :hook (rust-mode . lsp-rust-enable))
(use-package lsp-sh :disabled t )
(use-package lsp-treemacs)
(use-package merlin
:requires (tuareg company)
:custom
((merlin-command " ocamlmerlin" )
(merlin-completion-with-doc t ))
:config
(add-to-list 'company-backends 'merlin-company-backend )
:bind
(:map merlin-mode-map
(" M-." . merlin-locate)
(" M-," . merlin-pop-stack)
(" M-m" . merlin-error-next)
(" M-n" . merlin-error-prev)
(" C-c C-o" . merlin-occurrences)
(" C-c C-j" . merlin-jump)
(" C-c i" . merlin-locate-ident)
(" C-c C-e" . merlin-iedit-occurrences))
:hook tuareg-mode)
(use-package tuareg)
(use-package ocp-indent :config (ocp-setup-indent))
(use-package utop
:requires tuareg
:hook (tuareg-mode . utop-minor-mode))
(use-package reason-mode
:requires (utop merlin)
:hook
((before-save . refmt-before-save)
(reason-mode . merlin-mode)
(reason-mode . utop-minor-mode))
:custom
((utop-command " rtop -emacs" )))
; ; ADD DUNE (OCAML/REASONML) FILES TO LISP MODE
(let ((mode-alist (list '(" dune-project\\ '" . lisp-mode)
'(" dune\\ '" . lisp-mode)
'(" jbuild\\ '" . lisp-mode))))
(dolist (mode mode-alist)
(add-to-list 'auto-mode-alist mode)))
(use-package rust-mode :custom (rust-format-on-save t ))
(use-package rust-playground :disabled t )
(use-package cargo
:hook ((rust-mode . cargo-minor-mode)
(toml-mode . cargo-minor-mode)))
(use-package racer
:hook
((rust-mode . racer-mode)
(racer-mode . eldoc-mode)))
(use-package haskell-mode)
(use-package ghcid :load-path " lisp" )
(use-package intero
:config
(flycheck-add-next-checker 'intero '(warning . haskell-hlint))
:hook (haskell-mode . inter-mode))
(use-package dante
:disabled t ; USE INTERO FOR NOW
:hook (haskell-mode . dante-mode)
:config
(flycheck-add-next-checker 'haskell-dante '(warning . haskell-hlint)))
(use-package hindent :hook haskell-mode)
(use-package paredit
:hook
((emacs-lisp-mode . paredit-mode)
(lisp-mode . paredit-mode)
(racket-mode . paredit-mode)
(scheme-mode . paredit-mode)
(shen-mode . paredit-mode)))
(use-package racket-mode)
(use-package flymake-racket)
(use-package shen-elisp)
(use-package shen-mode :pin gnu
:config
(add-to-list 'auto-mode-alist '(" .*\\ .shen\\ '" . shen-mode)))
(use-package docker-cli)
(use-package dockerfile-mode)
(use-package kubernetes :disabled t )
(use-package kubernetes-helm :disabled t )
(use-package ledger-mode)
(use-package ledger-import)