aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYann Herklotz <git@yannherklotz.com>2020-10-24 19:15:18 +0100
committerYann Herklotz <git@yannherklotz.com>2020-12-01 19:05:03 +0000
commit000683abe7c01d0e7ce545789dc24721c4f251d1 (patch)
tree34e140d39a9c9002fde642b38b8261ef9c8cd8c1
parentb1673e899ec30f25b71cdc9d1ffd6c8246634191 (diff)
downloaddotfiles-000683abe7c01d0e7ce545789dc24721c4f251d1.tar.gz
dotfiles-000683abe7c01d0e7ce545789dc24721c4f251d1.zip
Update doom config
-rw-r--r--doom/config.el71
-rw-r--r--doom/init.el14
2 files changed, 69 insertions, 16 deletions
diff --git a/doom/config.el b/doom/config.el
index 8f66eca..e42b4f1 100644
--- a/doom/config.el
+++ b/doom/config.el
@@ -124,6 +124,34 @@
auto-save-interval 200 ; number of keystrokes between auto-saves (default: 300)
)
+(setq tramp-auto-save-directory "/tmp")
+(defvar disable-tramp-backups '(all))
+(eval-after-load "tramp"
+ '(progn
+ ;; Modified from https://www.gnu.org/software/emacs/manual/html_node/tramp/Auto_002dsave-and-Backup.html
+ (setq backup-enable-predicate
+ (lambda (name)
+ (and (normal-backup-enable-predicate name)
+ ;; Disable all tramp backups
+ (and disable-tramp-backups
+ (member 'all disable-tramp-backups)
+ (not (file-remote-p name 'method)))
+ (not ;; disable backup for tramp with the listed methods
+ (let ((method (file-remote-p name 'method)))
+ (when (stringp method)
+ (member method disable-tramp-backups)))))))
+
+ (defun tramp-set-auto-save--check (original)
+ (if (funcall backup-enable-predicate (buffer-file-name))
+ (funcall original)
+ (auto-save-mode -1)))
+
+ (advice-add 'tramp-set-auto-save :around #'tramp-set-auto-save--check)
+
+ ;; Use my ~/.ssh/config control master settings according to https://puppet.com/blog/speed-up-ssh-by-reusing-connections
+ (setq tramp-ssh-controlmaster-options "")))
+
+
;; Set sensitive data mode
(setq auto-mode-alist
(append
@@ -131,6 +159,9 @@
'("\\.sv\\'" . verilog-mode))
auto-mode-alist))
+(after! verilog-mode
+ (setq verilog-simulator "iverilog"))
+
;; Remove the ring for emacs
(setq ring-bell-function 'ignore)
@@ -210,13 +241,11 @@
"~/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")))
+ (format-time-string "~/Dropbox/org/%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))
+ (,(format-time-string "~/Dropbox/org/%Y-%m.org") :level . 1))
;; Set custom agenda commands which can be activated in the agenda viewer.
org-agenda-custom-commands
'(("w" "At work" tags-todo "@work"
@@ -227,24 +256,41 @@
((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")
+ `(("t" "Todo" entry (file+headline ,(format-time-string "~/Dropbox/org/%Y-%m.org") "Tasks")
"* 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:"))))
+ :END:"))
+ org-todo-keywords
+ '((sequence
+ "TODO(t)" ; A task that needs doing & is ready to do
+ "PROJ(p)" ; A project, which usually contains other tasks
+ "STRT(s)" ; A task that is in progress
+ "WAIT(w)" ; Something external is holding up this task
+ "HOLD(h)" ; This task is paused/on hold because of me
+ "|"
+ "DONE(d!)" ; Task successfully completed
+ "KILL(k)") ; Task was cancelled, aborted or is no longer applicable
+ (sequence
+ "[ ](T)" ; A task that needs doing
+ "[-](S)" ; Task is in progress
+ "[?](W)" ; Task is being held up or paused
+ "|"
+ "[X](D)")))) ; Task was completed))
;; 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
+ :init
(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))
+ (setq org-ref-completion-library 'org-ref-ivy-cite)
+ (setq reftex-default-bibliography '("~/Dropbox/bibliography/references.bib")))
;; Set up org-noter
(use-package! org-noter
@@ -264,7 +310,7 @@
(set-register ?l (cons 'file "~/.emacs.d/loader.org"))
(set-register ?m (cons 'file "~/Dropbox/org/main.org"))
(set-register ?i (cons 'file "~/Dropbox/org/inbox.org"))
-(set-register ?c (cons 'file (format-time-string "~/Dropbox/org/journals/%Y-%m.org")))
+(set-register ?c (cons 'file (format-time-string "~/Dropbox/org/%Y-%m.org")))
;; Bibtex stuff
(use-package! ebib
@@ -272,6 +318,7 @@
:init
(setq ebib-preload-bib-files '("~/Dropbox/bibliography/references.bib")
ebib-notes-directory "~/Dropbox/bibliography/notes/")
+ :config
(add-to-list 'ebib-file-search-dirs "~/Dropbox/bibliography/papers")
(add-to-list 'ebib-file-associations '("pdf" . "open"))
(advice-add 'bibtex-generate-autokey :around
@@ -345,6 +392,12 @@
(setq doc-view-resolution 300)
+(after! tuareg-mode
+ (add-hook 'tuareg-mode-hook
+ (lambda ()
+ (define-key tuareg-mode-map (kbd "C-M-<tab>") #'ocamlformat)
+ (add-hook 'before-save-hook #'ocamlformat-before-save))))
+
;; Here are some additional functions/macros that could help you configure Doom:
;;
;; - `load!' for loading external *.el files relative to this one
diff --git a/doom/init.el b/doom/init.el
index 682520c..e60b799 100644
--- a/doom/init.el
+++ b/doom/init.el
@@ -102,11 +102,11 @@
;;upload ; map local to remote projects via ssh/ftp
:lang
- ;;agda ; types of types of types of types...
+ 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
- ;;common-lisp ; if you've seen one lisp, you've seen them all
+ common-lisp ; if you've seen one lisp, you've seen them all
coq ; proofs-as-programs
;;crystal ; ruby at the speed of c
;;csharp ; unity, .NET, and mono shenanigans
@@ -122,10 +122,10 @@
;;go ; the hipster dialect
haskell ; a language that's lazier than I am
;;hy ; readability of scheme w/ speed of python
- ;;idris ;
+ idris ;
;;(java +meghanada) ; the poster child for carpal tunnel syndrome
;;javascript ; all(hope(abandon(ye(who(enter(here))))))
- ;;julia ; a better, faster MATLAB
+ julia ; a better, faster MATLAB
;;kotlin ; a better, slicker Java(Script)
latex ; writing papers in Emacs has never been so fun
;;lean
@@ -150,13 +150,13 @@
;;purescript ; javascript, but functional
python ; beautiful is better than ugly
;;qt ; the 'cutest' gui framework ever
- ;;racket ; a DSL for DSLs
+ racket ; a DSL for DSLs
;;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()
- ;;scala ; java, but good
- ;;scheme ; a fully conniving family of lisps
+ scala ; java, but good
+ scheme ; a fully conniving family of lisps
sh ; she sells {ba,z,fi}sh shells on the C xor
;;solidity ; do you need a blockchain? No.
;;swift ; who asked for emoji variables?