(setq inhibit-startup-message t) ;; turn off splash screen (scroll-bar-mode -1) ;; disable scroll bar (tool-bar-mode -1) ;; disable toolbar (tooltip-mode -1) ;; disable tooltips (menu-bar-mode -1) ;; disable menu bar (setq visible-bell t) ;; visual indicator instead of noise on bells ;;line numbers - relative (setq display-line-numbers-type 'relative) (global-display-line-numbers-mode) ;;disable line numbers for modes where it's weird (dolist (mode '(org-mode-hook term-mode-hook shell-mode-hook eshell-mode-hook)) (add-hook mode (lambda () (display-line-numbers-mode 0)))) ;;disable file backups (setq make-backup-files nil) (setq create-lockfiles nil) ;; always follow symlinks without asking (setq vc-follows-symlinks t find-file-visit-truename t) ;;set up package management (require 'package) (setq package-archives '(("mepla" . "https://melpa.org/packages/") ("org" . "https://orgmode.org/elpa") ("elpa" . "https://elpa.gnu.org/packages/"))) (package-initialize) (unless package-archive-contents (package-refresh-contents)) (unless (package-installed-p 'use-package) (package-install 'use-package)) (require 'use-package) (setq use-package-always-ensure t) ;;end package management set-up ;;theme (use-package gruvbox-theme :ensure t :config (load-theme 'gruvbox-dark-hard t)) ;;completions (use-package vertico :ensure t :init (vertico-mode)) ;;completion commands (use-package consult :ensure t :bind (("C-x b" . consult-buffer) ("C-s" . consult-line) ("M-y" . consult-yank-pop))) ;;fuzzy matching (use-package orderless :ensure t :config (setq completion-styles '(orderless basic) completion-category-defaults nil)) ;;minibuffer annotations (use-package marginalia :ensure t :init (marginalia-mode)) ;;actions on minibuffer candidates (use-package embark :ensure t :bind (("C-." . embark-act) ("M-." . embark-dwim))) (use-package embark-consult :ensure t) ;;search across entire projects (use-package projectile :diminish projectile-mode :config (projectile-mode) :bind-keymap ("C-c p" . projectile-command-map) :init (when (file-directory-p "~/src") (setq projectile-project-search-path '("~/src"))) (setq projectile-switch-project-action #'projectile-dired)) (use-package consult-projectile :ensure t :bind (("C-c h" . consult-projectile))) ;;icons are required for modeline (use-package all-the-icons :ensure t :if (display-graphic-p)) ;;replace the line at the bottom with something more stylish (use-package doom-modeline :ensure t :init (doom-modeline-mode 1) :config (setq doom-modeline-height 15)) (use-package rainbow-delimiters :hook (prod-mode . rainbow-delimiters-mode)) (use-package which-key :init (which-key-mode) :diminish which-key-mode :config (setq which-key-idle-delay 1)) (use-package magit :commands (magit-status magit-get-current-branch) :bind (("C-x g" . magit-status) ("C-x M-g" . magit-dispatch) ("C-c M-g" . magit-file-dispatch)) :custom (magit-display-buffer-function #'magit-display-buffer-same-window-except-diff-v1) ;; Show refined diffs for current hunk only (better performance) (magit-diff-refine-hunk t) ;; Don't automatically revert file-visiting buffers (magit-auto-revert-mode nil) ;; Use default terminal for SSH (if relevant) (magit-process-find-password-functions '(magit-process-password-auth-source))) ;; Org Mode Configuration ------------------------------------------------------ (defun rh/org-mode-setup () (org-indent-mode) (variable-pitch-mode 1) (visual-line-mode 1)) (defun rh/org-font-setup () ;; Replace list hyphen with dot (font-lock-add-keywords 'org-mode '(("^ *\\([-]\\) " (0 (prog1 () (compose-region (match-beginning 1) (match-end 1) "•")))))) ;; Set faces for heading levels (dolist (face '((org-level-1 . 1.2) (org-level-2 . 1.1) (org-level-3 . 1.05) (org-level-4 . 1.0) (org-level-5 . 1.1) (org-level-6 . 1.1) (org-level-7 . 1.1) (org-level-8 . 1.1))) (set-face-attribute (car face) nil :font "Cantarell" :weight 'regular :height (cdr face))) ;; Ensure that anything that should be fixed-pitch in Org files appears that way (set-face-attribute 'org-block nil :foreground nil :inherit 'fixed-pitch) (set-face-attribute 'org-code nil :inherit '(shadow fixed-pitch)) (set-face-attribute 'org-table nil :inherit '(shadow fixed-pitch)) (set-face-attribute 'org-verbatim nil :inherit '(shadow fixed-pitch)) (set-face-attribute 'org-special-keyword nil :inherit '(font-lock-comment-face fixed-pitch)) (set-face-attribute 'org-meta-line nil :inherit '(font-lock-comment-face fixed-pitch)) (set-face-attribute 'org-checkbox nil :inherit 'fixed-pitch)) (use-package org :hook (org-mode . rh/org-mode-setup) :config (setq org-ellipsis " ▾") (rh/org-font-setup)) (use-package org-bullets :after org :hook (org-mode . org-bullets-mode) :custom (org-bullets-bullet-list '("◉" "○" "●" "○" "●" "○" "●"))) (defun rh/org-mode-visual-fill () (setq visual-fill-column-width 100 visual-fill-column-center-text t) (visual-fill-column-mode 1)) (use-package visual-fill-column :hook (org-mode . efs/org-mode-visual-fill)) (custom-set-variables ;; custom-set-variables was added by Custom. ;; If you edit it by hand, you could mess it up, so be careful. ;; Your init file should contain only one such instance. ;; If there is more than one, they won't work right. '(package-selected-packages '(all-the-icons consult-projectile doom-modeline embark-consult gruvbox-theme magit marginalia orderless org-bullets rainbow-delimiters vertico visual-fill-column))) (custom-set-faces ;; custom-set-faces was added by Custom. ;; If you edit it by hand, you could mess it up, so be careful. ;; Your init file should contain only one such instance. ;; If there is more than one, they won't work right. )