(require 'package)

;; auto install all packages called by =use-package=
(require 'use-package-ensure)
(setq use-package-always-ensure t)

;; add package archives
(setq package-archives
 '(("melpa" . "https://melpa.org/packages/")
   ("gnu" . "https://elpa.gnu.org/packages/")
   ("gnu-devel" . "https://elpa.gnu.org/devel/")
   ("nongnu" . "https://elpa.nongnu.org/nongnu/")
   ))

(setq inhibit-startup-message t
      use-dialog-box nil)

(setq modus-themes-disable-other-themes t)
  
(setq modus-themes-italic-constructs t
      modus-themes-bold-constructs t
      modus-themes-mixed-fonts t
      modus-themes-variable-pitch-ui t)
  
(setq modus-themes-headings
      '((1 . (1.4))
	(2 . (1.3))
	(3 . (1.2))
	(t . (1.1))))
  
(setq modus-themes-to-toggle '(modus-operandi-tinted modus-vivendi-tinted))
(define-key global-map (kbd "<f5>") #'modus-themes-toggle)

(load-theme 'modus-operandi-tinted)

;; Move customization variables to a separate file and load it
(setq custom-file (locate-user-emacs-file "custom-vars.el"))
(load custom-file 'noerror 'nomessage)

;; Revert buffers when the underlying file has changed
(setq global-auto-revert-non-file-buffers t)
(global-auto-revert-mode 1)

;; Turn off some unneeded UI elements
(menu-bar-mode 1)  ; Leave this one on if you're a beginner!
(tool-bar-mode 0)
(scroll-bar-mode 0)

;; Turn on some QOL
(add-hook 'prog-mode-hook 'display-line-numbers-mode)
;; (global-display-line-numbers-mode 1)
(global-hl-line-mode 1)
(global-visual-line-mode 1)
(blink-cursor-mode 0)
; (global-display-fill-column-indicator-mode 1)
(which-key-mode 1)
(recentf-mode 1)
(savehist-mode 1)
(save-place-mode 1)
(setq make-backup-files nil)
 
(use-package magit)
(use-package auctex)
