doom.d/config.el

56 lines
2.0 KiB
EmacsLisp
Raw Normal View History

2019-12-03 23:21:32 +01:00
;;; .doom.d/config.el -*- lexical-binding: t; -*-
;; Place your private configuration here
2019-12-04 04:42:19 +01:00
;;
2020-01-06 10:20:20 +01:00
;; Load appearance configuration
(load! "+ui")
2019-12-04 04:43:02 +01:00
;; Set projects directories
(setq projectile-project-search-path '("~/Projects"))
2019-12-04 04:43:02 +01:00
; Auto cleanup recentf
2020-06-20 02:08:47 +02:00
(setq recentf-auto-cleanup 300)
2019-12-04 04:43:02 +01:00
; 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
2020-04-02 01:42:51 +02:00
(setq magit-repository-directories '(("~/Projects" . 3)
("~/.dotfiles" . 0)
("~/.doom.d" . 0)))
;; Load org configuration
(after! org (load! "+org"))
2020-01-26 14:06:00 +01:00
;; Enter writeroom and disable completion and line numbers in Markdown
(add-hook 'markdown-mode-hook (lambda () (display-line-numbers-mode -1)))
(after! markdown
2020-01-26 14:06:00 +01:00
(set-company-backend! 'markdown-mode nil)
(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
2020-01-06 10:20:20 +01:00
(after! python
(set-docsets! 'python-mode "Python 3" "NumPy" "Pandas"))
(after! c++
(set-docsets! 'c++-mode "C++"))
2020-01-26 14:06:00 +01:00
(after! go
(set-docsets! 'go-mode "Go"))
2020-01-06 10:20:20 +01:00
;; Align columns in CSV mode
(add-hook 'csv-mode-hook 'csv-align-mode)
;; Close compilation buffer if successful
(setq compilation-finish-functions
(lambda (buf str)
(if (null (string-match ".*exited abnormally.*" str))
(progn
(run-at-time
"0.5 sec" nil 'delete-windows-on
(get-buffer-create "*compilation*"))
(message "No Compilation Errors!")))))
2020-01-26 14:06:00 +01:00
;; Enable writeroom for text modes
(setq writeroom-major-modes '(markdown-mode org-mode))
;; Speed up company mode
(setq company-idle-delay nil)
2020-07-10 00:02:43 +02:00
;; Map leader key for major mode to ,
(setq doom-localleader-key ",")