doom.d/config.el

53 lines
2.0 KiB
EmacsLisp

;;; .doom.d/config.el -*- lexical-binding: t; -*-
;; Place your private configuration here
;;
;; Load appearance configuration
(load! "+ui")
;; Set projects directories
(setq projectile-project-search-path '("~/Projects"))
; Auto cleanup recentf
(setq recentf-auto-cleanup '300)
; Save backup files to ~/.cache and autosave files to ~/.cache/emacs
(setq backup-directory-alist `(("." . "~/.cache"))
auto-save-list-file-prefix
(concat "~/.cache/emacs"))
;; Set Magit repositories
(setq magit-repository-directories '(("~/Projects" . 2)
("~/.dotfiles" . 0)
("~/.doom.d" . 0)))
;; Load org configuration
(after! org (load! "+org"))
;; Enter writeroom and disable completion and line numbers in Markdown
(after! markdown
(set-company-backend! 'markdown-mode nil)
(add-hook 'markdown-mode-hook '(lambda () (display-line-numbers-mode -1)))
(add-hook 'markdown-mode-hook 'global-writeroom-mode))
;; Reload file from disk without confirmation
(defun revert-buffer-no-confirm ()
(interactive)
(revert-buffer :ignore-auto :noconfirm))
;; Select target in Makefile compilation as default
(map! :leader :n "c c" #'makefile-executor-execute-project-target)
;; Set docsets for each language
(after! python
(set-docsets! 'python-mode "Python 3" "NumPy" "Pandas"))
(after! c++
(set-docsets! 'c++-mode "C++"))
(after! go
(set-docsets! 'go-mode "Go"))
;; Align columns in CSV mode
(add-hook 'csv-mode-hook 'csv-align-mode)
;; Close compilation buffer if successfull(setq compilation-finish-functions
(setq compilation-finish-functions
(lambda (buf str)
(if (null (string-match ".*exited abnormally.*" str))
;;no errors, make the compilation window go away in a few seconds
(progn
(run-at-time
"0.5 sec" nil 'delete-windows-on
(get-buffer-create "*compilation*"))
(message "No Compilation Errors!")))))
;; Enable writeroom for text modes
(setq writeroom-major-modes '(markdown-mode org-mode))