diff options
Diffstat (limited to 'doom')
-rw-r--r-- | doom/config.el | 252 | ||||
-rw-r--r-- | doom/init.el | 43 | ||||
-rw-r--r-- | doom/packages.el | 24 |
3 files changed, 249 insertions, 70 deletions
diff --git a/doom/config.el b/doom/config.el index b5ddb93..8f66eca 100644 --- a/doom/config.el +++ b/doom/config.el @@ -1,9 +1,5 @@ ;;; $DOOMDIR/config.el -*- lexical-binding: t; -*- -;; Place your private configuration here! Remember, you do not need to run 'doom -;; sync' after modifying this file! - - ;; Some functionality uses this to identify you, e.g. GPG configuration, email ;; clients, file templates and snippets. (setq user-full-name "Yann Herklotz" @@ -20,13 +16,13 @@ ;; They all accept either a font-spec, font string ("Input Mono-12"), or xlfd ;; font string. You generally only need these two: (setq doom-font (font-spec :family "Iosevka" :size 16) - doom-variable-pitch-font (font-spec :family "Libre Baskerville") - doom-serif-font (font-spec :family "Libre Baskerville")) + doom-variable-pitch-font (font-spec :family "Libre Baskerville" :size 12) + doom-serif-font (font-spec :family "Libre Baskerville" :size 12)) ;; There are two ways to load a theme. Both assume the theme is installed and ;; available. You can either set `doom-theme' or manually load a theme with the ;; `load-theme' function. This is the default: -(setq doom-theme 'sanityinc-tomorrow-night) +(setq doom-theme 'modus-operandi) ;; If you use `org' and don't want your org files in the default location below, ;; change `org-directory'. It must be set before org loads! @@ -49,7 +45,8 @@ (global-set-key (kbd "C-,") #'(lambda () (interactive) (other-window -1))) (global-set-key (kbd "C-c l") #'org-store-link) (global-set-key (kbd "C-c a") #'org-agenda) -(global-set-key (kbd "C-c c") #'org-capture) +(global-set-key (kbd "C-c /") #'avy-goto-word-1) +(global-set-key (kbd "M-=") #'count-words) ;; Set undo-only correctly (global-set-key (kbd "C-\\") 'undo-only) @@ -76,19 +73,6 @@ (global-set-key (kbd "C-`") #'push-mark-no-activate) (global-set-key (kbd "M-`") #'jump-to-mark) -;; Delete an emacs client frame. -(defun y/exit-emacs-client () - "consistent exit emacsclient. If not in emacs client, echo a - message in minibuffer, don't exit emacs. If in server mode and - editing file, do C-x # server-edit else do C-x 5 0 - delete-frame" - (interactive) - (if server-buffer-clients - (server-edit) - (delete-frame))) - -(global-set-key (kbd "C-c q") #'y/exit-emacs-client) - ;; Swap two window positions. (defun y/swap-windows () "Swaps two windows and leaves the cursor in the original one" @@ -106,6 +90,16 @@ (define-key y-map (kbd "g") 'password-store-generate) (define-key y-map (kbd "r") 'toggle-rot13-mode) +(electric-indent-mode -1) + +;; Mac configuration +(when (eq system-type 'darwin) + (setq mac-right-option-modifier 'none + mac-option-key-is-meta nil + mac-command-key-is-meta t + mac-command-modifier 'meta + mac-option-modifier nil)) + (defun y/insert-date () "Insert a timestamp according to locale's date and time format." (interactive) @@ -114,15 +108,46 @@ (define-key y-map (kbd "d") 'y/insert-date) ;; Set backup directories into the tmp folder -(setq backup-directory-alist - `((".*" . ,temporary-file-directory))) -(setq auto-save-file-name-transforms - `((".*" ,temporary-file-directory t))) +(defvar --backup-directory (concat user-emacs-directory "backups")) +(if (not (file-exists-p --backup-directory)) + (make-directory --backup-directory t)) +(setq backup-directory-alist `(("." . ,--backup-directory))) +(setq make-backup-files t ; backup of a file the first time it is saved. + backup-by-copying t ; don't clobber symlinks + version-control t ; version numbers for backup files + delete-old-versions t ; delete excess backup files silently + delete-by-moving-to-trash t + kept-old-versions 6 ; oldest versions to keep when a new numbered backup is made (default: 2) + kept-new-versions 9 ; newest versions to keep when a new numbered backup is made (default: 2) + auto-save-default t ; auto-save every buffer that visits a file + auto-save-timeout 20 ; number of seconds idle time before auto-save (default: 30) + auto-save-interval 200 ; number of keystrokes between auto-saves (default: 300) + ) + +;; Set sensitive data mode +(setq auto-mode-alist + (append + (list '("\\.\\(vcf\\|gpg\\)\\'" . sensitive-minor-mode) + '("\\.sv\\'" . verilog-mode)) + auto-mode-alist)) + +;; Remove the ring for emacs +(setq ring-bell-function 'ignore) ;; Automatically refresh files (global-auto-revert-mode 1) (setq auto-revert-verbose nil) +;; Set sentence to end with double space +(setq sentence-end-double-space t) + +;; Remove automatic `auto-fill-mode', and replace it by `visual-line-mode', +;; which is a personal preference. +(setq-default fill-column 100) +(remove-hook 'text-mode-hook #'auto-fill-mode) +(add-hook 'text-mode-hook #'+word-wrap-mode) +(add-hook 'text-mode-hook #'visual-fill-column-mode) + ;; Set up magit when C-c g is called (use-package! magit :bind (("C-x g" . magit-status))) @@ -140,7 +165,7 @@ :config (global-hungry-delete-mode)) ;; Org configuration -(use-package org +(use-package! org :mode ("\\.org\\'" . org-mode) :init (map! :map org-mode-map @@ -150,6 +175,9 @@ org-return-follows-link t org-confirm-babel-evaluate nil org-use-speed-commands t + org-hide-emphasis-markers t + org-adapt-indentation nil + org-cycle-separator-lines 1 org-structure-template-alist '(("a" . "export ascii") ("c" . "center") ("C" . "comment") @@ -162,36 +190,75 @@ ("v" . "verse") ("el" . "src emacs-lisp") ("d" . "definition") - ("t" . "theorem")))) + ("t" . "theorem"))) + (customize-set-variable 'org-blank-before-new-entry + '((heading . nil) + (plain-list-item . nil)))) -(use-package! org-id - :after org) +(use-package! org-contacts + :after org + :init + (setq org-contacts-files '("~/Dropbox/org/contacts.org"))) ;; Disable org indent mode and remove C-, from the org-mode-map. (after! org - (setq org-startup-indented nil) - (define-key org-mode-map (kbd "C-,") nil)) - -;; Set agenda files, refile targets and todo keywords. -(setq org-agenda-files (mapcar 'expand-file-name - (list "~/Dropbox/org/inbox.org" - "~/Dropbox/org/main.org" - "~/Dropbox/org/tickler.org" - (format-time-string "~/Dropbox/org/journals/%Y-%m.org"))) - org-refile-targets `(("~/Dropbox/org/main.org" :maxlevel . 2) - ("~/Dropbox/org/someday.org" :level . 1) - ("~/Dropbox/org/tickler.org" :maxlevel . 2) - (,(format-time-string "~/Dropbox/org/journals/%Y-%m.org") :maxlevel . 2)) - org-todo-keywords '((sequence "TODO(t)" "WAITING(w)" "|" "DONE(d)" "CANCELLED(c)"))) - -;; Set custom agenda commands which can be activated in the agenda viewer. -(setq org-agenda-custom-commands + (define-key org-mode-map (kbd "C-,") nil) + ;; Set agenda files, refile targets and todo keywords. + (setq org-startup-indented nil + org-agenda-files (mapcar 'expand-file-name + (list "~/Dropbox/org/inbox.org" + "~/Dropbox/org/main.org" + "~/Dropbox/org/tickler.org" + "~/Dropbox/org/projects.org" + "~/Dropbox/org/pldi2020.org" + (format-time-string "~/Dropbox/org/journals/%Y-%m.org"))) + org-refile-targets `(("~/Dropbox/org/main.org" :maxlevel . 2) + ("~/Dropbox/org/someday.org" :level . 1) + ("~/Dropbox/org/tickler.org" :maxlevel . 2) + ("~/Dropbox/org/projects.org" :level . 1) + (,(format-time-string "~/Dropbox/org/journals/%Y-%m.org") :maxlevel . 2)) + ;; Set custom agenda commands which can be activated in the agenda viewer. + org-agenda-custom-commands '(("w" "At work" tags-todo "@work" ((org-agenda-overriding-header "Work"))) ("h" "At home" tags-todo "@home" ((org-agenda-overriding-header "Home"))) ("u" "At uni" tags-todo "@uni" - ((org-agenda-overriding-header "University"))))) + ((org-agenda-overriding-header "University")))) + org-log-done 'time + org-capture-templates + `(("t" "Todo" entry (file+headline ,(format-time-string "~/Dropbox/org/journals/%Y-%m.org") "Today") + "* TODO %^{Title}\nCreated: %U\n\n%?\n") + ("c" "Contacts" entry (file "~/Dropbox/org/contacts.org") + "* %(org-contacts-template-name) + :PROPERTIES: + :EMAIL: %(org-contacts-template-email) + :END:")))) + +;; Set up org ref for PDFs +(use-package! org-ref + :after org + :bind (("C-c r" . org-ref-cite-hydra/body) + ("C-c b" . org-ref-bibtex-hydra/body)) + :config + (setq org-ref-bibliography-notes "~/Dropbox/bibliography/notes.org" + org-ref-default-bibliography '("~/Dropbox/bibliography/references.bib") + org-ref-pdf-directory "~/Dropbox/bibliography/papers/") + (setq org-ref-completion-library 'org-ref-ivy-cite)) + +;; Set up org-noter +(use-package! org-noter + :after org + :commands org-noter + :config (setq org-noter-default-notes-file-names '("notes.org") + org-noter-notes-search-path '("~/org/bibliography") + org-noter-separate-notes-from-heading t)) + +(use-package! org-superstar + :hook (org-mode . org-superstar-mode) + :config + (setq org-superstar-headline-bullets-list '("♠" "♣" "♥" "♦") + org-superstar-special-todo-items t)) ;; Set up org registers to quickly jump to files that I use often. (set-register ?l (cons 'file "~/.emacs.d/loader.org")) @@ -199,18 +266,84 @@ (set-register ?i (cons 'file "~/Dropbox/org/inbox.org")) (set-register ?c (cons 'file (format-time-string "~/Dropbox/org/journals/%Y-%m.org"))) +;; Bibtex stuff +(use-package! ebib + :bind (("C-c y b" . ebib)) + :init + (setq ebib-preload-bib-files '("~/Dropbox/bibliography/references.bib") + ebib-notes-directory "~/Dropbox/bibliography/notes/") + (add-to-list 'ebib-file-search-dirs "~/Dropbox/bibliography/papers") + (add-to-list 'ebib-file-associations '("pdf" . "open")) + (advice-add 'bibtex-generate-autokey :around + #'(lambda (orig-func &rest args) + (replace-regexp-in-string ":" "" (apply orig-func args))))) + ;; Set up dictionaries (setq ispell-dictionary "en_GB") (use-package! flyspell + :hook (text-mode . flyspell-mode) :config (define-key flyspell-mode-map (kbd "C-.") nil) (define-key flyspell-mode-map (kbd "C-,") nil)) ;; Set up zettelkasten mode (use-package! zettelkasten + :bind-keymap + ("C-c k" . zettelkasten-mode-map)) + +;; Proof general configuration +(setq proof-splash-enable nil + proof-auto-action-when-deactivating-scripting 'retract + proof-delete-empty-windows nil + proof-auto-raise-buffers t + coq-compile-before-require t) + +(setq coq-may-use-prettify nil + company-coq-prettify-symbols nil) +(global-prettify-symbols-mode -1) + +(use-package smartparens + :bind (("M-[" . sp-backward-unwrap-sexp) + ("M-]" . sp-unwrap-sexp) + ("C-M-f" . sp-forward-sexp) + ("C-M-b" . sp-backward-sexp) + ("C-M-d" . sp-down-sexp) + ("C-M-a" . sp-backward-down-sexp) + ("C-M-e" . sp-up-sexp) + ("C-M-u" . sp-backward-up-sexp) + ("C-M-t" . sp-transpose-sexp) + ("C-M-n" . sp-next-sexp) + ("C-M-p" . sp-previous-sexp) + ("C-M-k" . sp-kill-sexp) + ("C-M-w" . sp-copy-sexp) + ("C-)" . sp-forward-slurp-sexp) + ("C-}" . sp-forward-barf-sexp) + ("C-(" . sp-backward-slurp-sexp) + ("C-{" . sp-backward-barf-sexp) + ("M-D" . sp-splice-sexp) + ("C-]" . sp-select-next-thing-exchange) + ("C-<left_bracket>" . sp-select-previous-thing) + ("C-M-]" . sp-select-next-thing) + ("M-F" . sp-forward-symbol) + ("M-B" . sp-backward-symbol) + ("M-r" . sp-split-sexp)) :config - (zettelkasten-mode t)) + (require 'smartparens-config) + (show-smartparens-global-mode +1) + (smartparens-global-mode 1)) + +(use-package! ormolu + :hook (haskell-mode . ormolu-format-on-save-mode) + :bind + (:map haskell-mode-map + ("C-c r" . ormolu-format-buffer))) + +(after! writeroom-mode (setq +zen-text-scale 1)) + +(setq pdf-view-use-scaling t) + +(setq doc-view-resolution 300) ;; Here are some additional functions/macros that could help you configure Doom: ;; @@ -228,3 +361,26 @@ ;; ;; You can also try 'gd' (or 'C-c g d') to jump to their definition and see how ;; they are implemented. +(custom-set-variables + ;; custom-set-variables was added by Custom. + ;; If you edit it by hand, you could mess it up, so be careful. + ;; Your init file should contain only one such instance. + ;; If there is more than one, they won't work right. + '(org-blank-before-new-entry (quote ((heading) (plain-list-item)))) + '(package-selected-packages (quote (org-plus-contrib))) + '(safe-local-variable-values + (quote + ((eval add-to-list + (quote auto-mode-alist) + (quote + ("\\.v\\'" . verilog-mode))) + (eval setq org-ref-pdf-directory + (concat + (projectile-project-root) + "papers/")))))) +(custom-set-faces + ;; custom-set-faces was added by Custom. + ;; If you edit it by hand, you could mess it up, so be careful. + ;; Your init file should contain only one such instance. + ;; If there is more than one, they won't work right. + ) diff --git a/doom/init.el b/doom/init.el index d257bc2..682520c 100644 --- a/doom/init.el +++ b/doom/init.el @@ -32,11 +32,11 @@ ;;fill-column ; a `fill-column' indicator hl-todo ; highlight TODO/FIXME/NOTE/DEPRECATED/HACK/REVIEW hydra - ;;indent-guides ; highlighted indent columns + ;;indent-guides ; highlighted in dent columns modeline ; snazzy, Atom-inspired modeline, plus API ;;nav-flash ; blink the current line after jumping ;;neotree ; a project drawer, like NERDTree for vim - ophints ; highlight the region an operation acts on + ;;ophints ; highlight the region an operation acts on (popup +defaults) ; tame sudden yet inevitable temporary windows ;;pretty-code ; replace bits of code with pretty symbols ;;tabs ; an tab bar for Emacs @@ -50,7 +50,7 @@ :editor ;;(evil +everywhere); come to the dark side, we have cookies - file-templates ; auto-snippets for empty files + ;;file-templates ; auto-snippets for empty files fold ; (nigh) universal code folding ;;(format +onsave) ; automated prettiness ;;god ; run Emacs commands without modifier keys @@ -59,7 +59,7 @@ ;;objed ; text object editing for the innocent ;;parinfer ; turn lisp into python, sort of ;;rotate-text ; cycle region at point between text candidates - snippets ; my elves. They type so I don't have to + ;;snippets ; my elves. They type so I don't have to word-wrap ; soft wrapping with language-aware indent :emacs @@ -69,28 +69,28 @@ vc ; version-control and Emacs, sitting in a tree :term - ;;eshell ; a consistent, cross-platform shell (WIP) + eshell ; a consistent, cross-platform shell (WIP) ;;shell ; a terminal REPL for Emacs ;;term ; terminals in Emacs ;;vterm ; another terminals in Emacs :checkers syntax ; tasing you for every semicolon you forget - (spell +hunspell) ; tasing you for misspelling mispelling - grammar ; tasing grammar mistake every you make + (spell +aspell) ; tasing you for misspelling mispelling + ;;grammar ; tasing grammar mistake every you make :tools ;;ansible ;;debugger ; FIXME stepping through code, to help you add bugs direnv ;;docker - editorconfig ; let someone else argue about tabs vs spaces + editorconfig ; let someone else argue about tabs vs spaces ;;ein ; tame Jupyter notebooks with emacs (eval +overlay) ; run code, run (also, repls) ;;gist ; interacting with github gists - lookup ; navigate your code and its documentation + ;;lookup ; navigate your code and its documentation ;;lsp - ;;macos ; MacOS-specific commands + macos ; MacOS-specific commands magit ; a git porcelain for Emacs ;;make ; run make tasks from Emacs pass ; password manager for nerds @@ -104,23 +104,23 @@ :lang ;;agda ; types of types of types of types... ;;assembly ; assembly for fun or debugging - cc ; C/C++/Obj-C madness - clojure ; java with a lisp + cc ; C/C++/Obj-C madness + clojure ; java with a lisp ;;common-lisp ; if you've seen one lisp, you've seen them all - ;;coq ; proofs-as-programs + coq ; proofs-as-programs ;;crystal ; ruby at the speed of c ;;csharp ; unity, .NET, and mono shenanigans - data ; config/data formats + data ; config/data formats ;;elixir ; erlang done right ;;elm ; care for a cup of TEA? - emacs-lisp ; drown in parentheses + emacs-lisp ; drown in parentheses ;;erlang ; an elegant language for a more civilized age ;;ess ; emacs speaks statistics ;;faust ; dsp, but you get to keep your soul ;;fsharp ; ML stands for Microsoft's Language ;;fstar ; (dependent) types and (monadic) effects and Z3 ;;go ; the hipster dialect - (haskell +dante) ; a language that's lazier than I am + haskell ; a language that's lazier than I am ;;hy ; readability of scheme w/ speed of python ;;idris ; ;;(java +meghanada) ; the poster child for carpal tunnel syndrome @@ -137,12 +137,13 @@ nix ; I hereby declare "nix geht mehr!" ocaml ; an objective camel (org ; organize your plain life in plain text - +dragndrop ; drag & drop files/images into org buffers + ;;+dragndrop ; drag & drop files/images into org buffers ;;+hugo ; use Emacs for hugo blogging ;;+jupyter ; ipython/jupyter support for babel ;;+pandoc ; export-with-pandoc support ;;+pomodoro ; be fruitful with the tomato technique - +present) ; using org-mode for presentations + ;;+present ; using org-mode for presentations + ) ;;perl ; write code no one else can comprehend ;;php ; perl's insecure younger brother ;;plantuml ; diagrams for confusing people more @@ -153,7 +154,7 @@ ;;rest ; Emacs as a REST client ;;rst ; ReST in peace ;;(ruby +rails) ; 1.step {|i| p "Ruby is #{i.even? ? 'love' : 'life'}"} - ;;rust ; Fe2O3.unwrap().unwrap().unwrap().unwrap() + rust ; Fe2O3.unwrap().unwrap().unwrap().unwrap() ;;scala ; java, but good ;;scheme ; a fully conniving family of lisps sh ; she sells {ba,z,fi}sh shells on the C xor @@ -163,8 +164,8 @@ ;;web ; the tubes :email - (mu4e +gmail) - ;;notmuch + ;;(mu4e +gmail) + notmuch ;;(wanderlust +gmail) :app diff --git a/doom/packages.el b/doom/packages.el index 8891894..26532fb 100644 --- a/doom/packages.el +++ b/doom/packages.el @@ -50,7 +50,29 @@ ;; our package manager can't deal with; see raxod502/straight.el#279) ;(package! builtin-package :recipe (:branch "develop")) +;; Disabling packages +(disable-packages! undo-tree org-bullets helm pretty-code company-coq) + +;; `org-mode' dependencies +(package! org-ref) +(package! org-noter) +;; `org-bullets' replacement +(package! org-superstar) + +;; Bibtex stuff +(package! ebib) + +;; Haskell stuff +(package! ormolu) + +;; Misc dependencies (package! hungry-delete) -(package! color-theme-sanityinc-tomorrow) +(package! vagrant-tramp) (package! zettelkasten :recipe (:host github :repo "ymherklotz/emacs-zettelkasten")) +(package! pinentry) + +;; Themes +(package! color-theme-sanityinc-tomorrow) +(package! modus-operandi-theme) +(package! modus-vivendi-theme) |