config/doom: fix backups & xdg-open

This commit is contained in:
xerus2000 2021-02-24 12:19:09 +01:00
parent 44f2ccca2a
commit 0997203052
2 changed files with 27 additions and 22 deletions

View File

@ -1,4 +1,3 @@
init.el
local.el local.el
custom.el custom.el
*/ */

View File

@ -50,16 +50,17 @@
(whitespace-mode 0) (whitespace-mode 0)
;; Backups & auto-saves ;; Backups & auto-saves
(setq auto-save-default t (setq auto-save-default t
auto-save-interval 40) auto-save-interval 40)
(setq backup-directory-alist `(("." . ,(expand-file-name "backups/" user-emacs-directory)))) (setq make-backup-files t
(setq delete-old-versions t backup-directory-alist (list (cons "." (concat doom-cache-dir "backup/")))
kept-new-versions 6 delete-old-versions t
kept-old-versions 2 version-control t
version-control t vc-make-backup-files t
vc-make-backup-files t kept-new-versions 5
) kept-old-versions 3
)
;; Data dirs ;; Data dirs
@ -67,10 +68,7 @@
(load! "./local.el" nil t) (load! "./local.el" nil t)
; ORG ;; ORG
;; Fix xdg-open - https://askubuntu.com/questions/646631/emacs-doesnot-work-with-xdg-open
(setq process-connection-type nil)
(let ((default-directory user-data-dir)) (let ((default-directory user-data-dir))
(setq org-directory (expand-file-name "1-projects")) (setq org-directory (expand-file-name "1-projects"))
@ -81,7 +79,8 @@
(lambda (directory) (lambda (directory)
(directory-files-recursively (directory-files-recursively
directory org-agenda-file-regexp)) directory org-agenda-file-regexp))
'("1-projects" "2-standards" "3-resources")))) '("1-projects" "2-standards" "3-resources")
)))
) )
(set-file-template! 'org-mode :ignore t) (set-file-template! 'org-mode :ignore t)
@ -89,17 +88,24 @@
(setq org-read-date-prefer-future nil) (setq org-read-date-prefer-future nil)
(setq org-image-actual-width nil) (setq org-image-actual-width nil)
; Exporting - https://orgmode.org/manual/Export-Settings.html ;; Exporting - https://orgmode.org/manual/Export-Settings.html
(setq org-latex-pdf-export "latexmk -outdir=/tmp/latexmk -f -pdf %F; mv %f /tmp/latexmk; mv /tmp/latexmk/%b.pdf %o") (setq org-latex-pdf-export "latexmk -outdir=/tmp/latexmk -f -pdf %F; mv %f /tmp/latexmk; mv /tmp/latexmk/%b.pdf %o")
(setq org-latex-packages-alist '(("margin=3cm" "geometry") ("avoid-all" "widows-and-orphans"))) (setq org-latex-packages-alist '(("margin=3cm" "geometry") ("avoid-all" "widows-and-orphans")))
(setq org-export-with-sub-superscripts nil) (setq org-export-with-sub-superscripts nil)
(setq org-export-with-tags nil) (setq org-export-with-tags nil)
(setq org-export-with-tasks nil) (setq org-export-with-tasks nil)
; Org startup - https://orgmode.org/manual/In_002dbuffer-Settings.html ;; Org startup - https://orgmode.org/manual/In_002dbuffer-Settings.html
(setq org-startup-folded 'show2levels) (setq org-startup-folded 'show2levels)
(setq org-startup-with-inline-images t) (setq org-startup-with-inline-images t)
;; Fix xdg-open & open PDF in Emacs - https://depp.brause.cc/dotemacs/#orgd97f08c
(setq org-file-apps '((remote . emacs)
(auto-mode . emacs)
(directory . emacs)
(system . "setsid -w xdg-open %s")
(t . system)))
;; org toggle source blocks with C-c t ;; org toggle source blocks with C-c t
(defvar org-blocks-hidden nil) (defvar org-blocks-hidden nil)
(defun org-toggle-blocks () (defun org-toggle-blocks ()
@ -160,11 +166,11 @@
) )
(add-to-list 'org-src-lang-modes '("plantuml" . plantuml)) (add-to-list 'org-src-lang-modes '("plantuml" . plantuml))
(with-eval-after-load 'org (with-eval-after-load 'org
(org-babel-do-load-languages (org-babel-do-load-languages
'org-babel-load-languages 'org-babel-load-languages
'(other Babel languages '(other Babel languages (plantuml . t))
(plantuml . t) )
))) )
) )
(use-package! adoc-mode ; Asciidoc, a md alternative (use-package! adoc-mode ; Asciidoc, a md alternative
:config :config