emacs.d/behaviour.el
2023-02-05 17:07:29 +01:00

35 lines
992 B
EmacsLisp

;; Evil quit
(evil-define-command evil-quit
(&optional force)
:repeat nil
:repeat nil
(if (eq (window-main-window) (selected-window))
(if (equal (buffer-name) "*dashboard*") nil (kill-buffer))
(evil-window-delete)))
;; Treemacs directory expansion
(with-eval-after-load 'treemacs
(define-key treemacs-mode-map [mouse-1] #'treemacs-single-click-expand-action))
;; Save backup files to a single dir
(setq backup-directory-alist
`((".*" . ,temporary-file-directory)))
(setq auto-save-file-name-transforms
`((".*" ,temporary-file-directory t)))
;; LaTeX
(setq Tex-command-default "latexmk")
;; Use pdf-tools to open PDF files
(setq TeX-view-program-selection '((output-pdf "PDF Tools"))
TeX-source-correlate-start-server t)
;; Update PDF buffers after successful LaTeX runs
(add-hook 'TeX-after-compilation-finished-functions
#'TeX-revert-document-buffer)
;; Dired
;; Auto-refresh dired on file change
(add-hook 'dired-mode-hook 'auto-revert-mode)