diff --git a/init.el b/init.el index 4cb0584..30d5892 100644 --- a/init.el +++ b/init.el @@ -55,4 +55,7 @@ (convert-standard-filename "user/"))) (load "init") +;; Make gc pauses faster by decreasing the threshold. +(setq gc-cons-threshold (* 2 1000 1000)) + ;;; init.el ends here diff --git a/lisp/editor.el b/lisp/editor.el index f28ccc0..bbcd78c 100644 --- a/lisp/editor.el +++ b/lisp/editor.el @@ -25,23 +25,39 @@ ;; evil-commentary - Comment stuff out (use-package evil-commentary + :after evil :init (evil-commentary-mode)) +;; evil-surround - You will be surrounded +(use-package evil-surround + :after evil + :init + (global-evil-surround-mode)) + +;; evil-snipe - 2-char searching for evil-mode +(use-package evil-snipe + :after evil + :init + (evil-snipe-override-mode 1)) + ;; evil-collection - A collection of keybinds for evil (use-package evil-collection + :after evil :custom (evil-collection-setup-minibuffer t) :init (evil-collection-init)) ;; evil-escape - Escape from insert mode using jk (use-package evil-escape + :after evil :config (setq-default evil-escape-key-sequence "jk") :init (evil-escape-mode 1)) ;; undo-fu, used by evil for undo/redo functionality -(use-package undo-fu) +(use-package undo-fu + :after evil) ;; Disable the creation of files ending with '~' (backup files) (setq make-backup-files nil) @@ -53,13 +69,6 @@ (setq auto-save-file-name-transforms `((".*" ,temporary-file-directory t))) -;; Themes -;; Customize doom-themes -(setq doom-themes-enable-bold t - doom-themes-enable-italic t) -(doom-themes-treemacs-config) ; Enable theming of treemacs -(doom-themes-org-config) ; And org-mode - ;; Set theme to `graphite', Dianicemacs' default (use-package autothemer) (use-package graphite-theme @@ -72,26 +81,22 @@ :hook (prog-mode . rainbow-mode)) -;; Keybinds -;; Enable which-key -(which-key-mode) -(setq which-key-idle-delay 0.1) ; Make the popup appear faster -(setq which-key-separator " - " ) ; Change the seperator which-key uses - ;; general - More convenient key definitions for Emacs (use-package general + :after evil :config (general-evil-setup t) :init (general-create-definer diancite/leaders :prefix leader-key)) -(diancite/leaders - :keymaps 'normal - "f" '(:wk "File") - "n" '(:wk "Org") - "m" '(:wk "Magit") - "w" '(:wk "Evil") - "p" '(:wk "Projects")) - +(with-eval-after-load 'general + (diancite/leaders + :keymaps 'normal + "f" '(:wk "File") + "n" '(:wk "Org") + "m" '(:wk "Magit") + "w" '(:wk "Evil") + "p" '(:wk "Projects"))) + ;;; editor.el ends here diff --git a/lisp/interface.el b/lisp/interface.el index 5c0cb46..a174990 100644 --- a/lisp/interface.el +++ b/lisp/interface.el @@ -22,8 +22,8 @@ ;; Add a nice border around Emacs (modify-all-frames-parameters - '((right-divider-width . 15) - (internal-border-width . 15))) + '((right-divider-width . 20) + (internal-border-width . 20))) (dolist (face '(window-divider window-divider-first-pixel window-divider-last-pixel)) @@ -31,8 +31,14 @@ (set-face-foreground face (face-attribute 'default :background))) (set-face-background 'fringe (face-attribute 'default :background)) +;; vertico - An amazing search engine! +(use-package vertico + :init + (vertico-mode 1)) + ;; Use the `orderless' completion mechanism (use-package orderless + :after vertico :init (setq completion-styles '(orderless basic) completion-category-defaults nil @@ -52,23 +58,12 @@ (use-package magit) ;; which-key - a popup which displays available keybindings -(use-package which-key) - -;; Themes -;; Install the Doom Emacs theme megapack. -(use-package doom-themes) - -;; kaolin-themes, depends on autothemer -(use-package kaolin-themes - :requires autothemer) - -;; all-the-icons - Icons for various UI elements -(use-package all-the-icons) - -;; vertico - An amazing search engine! -(use-package vertico +(use-package which-key :init - (vertico-mode 1)) + (which-key-mode) + :custom + (which-key-idle-delay 0.1) ; Make the popup appear faster + (which-key-separator " - ")) ; Change the seperator which-key uses (use-package diredfl ; Colourise dired! :hook dired-mode) diff --git a/lisp/org-mode.el b/lisp/org-mode.el index 6e56c41..99f3629 100644 --- a/lisp/org-mode.el +++ b/lisp/org-mode.el @@ -9,10 +9,11 @@ ;; org-mode ;; org-superstar (use-package org-superstar - :config + :custom ;; Change org-mode's heading bullets - (setq org-superstar-headline-bullets-list - '("🞉" "🞈" "🞇" "🞆" "🞅" "🞄"))) + (org-superstar-headline-bullets-list + '("🞉" "🞈" "🞇" "🞆" "🞅" "🞄")) + :hook org-mode) ;; Customize org-mode's default functionality (setq org-ellipsis "..." @@ -24,42 +25,38 @@ org-startup-with-inline-images t org-image-actual-width '(300) org-pretty-entities t - org-hide-leading-stars t org-adapt-indentation t) -;; Faces for the font sizes of org-mode headings -(set-face-attribute 'org-level-8 nil :weight 'bold :inherit 'default) -(set-face-attribute 'org-level-7 nil :inherit 'org-level-8) -(set-face-attribute 'org-level-6 nil :inherit 'org-level-8) -(set-face-attribute 'org-level-5 nil :inherit 'org-level-8) -(set-face-attribute 'org-level-4 nil :inherit 'org-level-8) -(set-face-attribute 'org-level-3 nil :inherit 'org-level-8 :height 1.15) -(set-face-attribute 'org-level-2 nil :inherit 'org-level-8 :height 1.35) -(set-face-attribute 'org-level-1 nil :inherit 'org-level-8 :height 1.65) -(set-face-attribute 'org-document-title nil +(with-eval-after-load 'org-superstar + ;; Faces for the font sizes of org-mode headings + (set-face-attribute 'org-level-8 nil :weight 'bold :inherit 'default) + (set-face-attribute 'org-level-7 nil :inherit 'org-level-8) + (set-face-attribute 'org-level-6 nil :inherit 'org-level-8) + (set-face-attribute 'org-level-5 nil :inherit 'org-level-8) + (set-face-attribute 'org-level-4 nil :inherit 'org-level-8) + (set-face-attribute 'org-level-3 nil :inherit 'org-level-8 :height 1.15) + (set-face-attribute 'org-level-2 nil :inherit 'org-level-8 :height 1.35) + (set-face-attribute 'org-level-1 nil :inherit 'org-level-8 :height 1.65) + (set-face-attribute 'org-document-title nil :height 1.85 :foreground 'unspecified - :inherit 'org-level-8) + :inherit 'org-level-8)) -;; Scale up latex elements -(plist-put org-format-latex-options :scale 2.5) - -;; Enable org-superstar-mode in org-mode files -(add-hook 'org-mode-hook 'org-superstar-mode) +(with-eval-after-load 'org + (plist-put org-format-latex-options :scale 2.5) ; Scale up latex elements + (setq org-directory "~/Org/") ; Set the folder used by org-mode + (setq org-agenda-files (quote ("~/Org/"))) + (setq org-roam-directory "~/Org/Roam/")) ; Set the folder used by org-roam ;; org-roam - A plain-text personal knowledge management system (use-package org-roam - :custom - (org-directory file-truename "~/Org/") ; Set the folder used by org-mode - (org-roam-directory (file-truename "~/Org/Roam/")) ; Set the folder used by org-roam :init - (org-roam-db-autosync-mode 1)) ; Automatically sync nodes - -(setq org-roam-capture-templates + (org-roam-db-autosync-mode 1) + (setq org-roam-capture-templates '(("d" "default" plain "\n%?" :if-new (file+head "${slug}.org" "#+title: ${title}\n#+date: %U\n#+author: %n\n") - :unnarrowed t))) + :unnarrowed t)))) ; Automatically sync nodes ;; Keybinds for org-mode ;; evil-org - Some nice keybinds for org-mode and org-agenda @@ -71,18 +68,15 @@ (require 'evil-org-agenda) (evil-org-agenda-set-keys)) -(general-create-definer diancite/org - :prefix leader-key) - -(diancite/org - :keymaps 'normal - "n r" '(org-roam-node-find :wk "Find Nodes") - "n s" '(org-roam-db-sync :wk "Sync Nodes") - "n c" '(org-todo :wk "Cycle Todo") - "n l" '(org-latex-preview :wk "Preview Latex") - "n a" '(org-agenda :wk "Agenda") - "n t" '(org-table-align :wk "Align Table")) - -(setq org-agenda-files (quote ("~/Org"))) +(with-eval-after-load 'general + (general-create-definer diancite/org :prefix leader-key) + (diancite/org + :keymaps 'normal + "n r" '(org-roam-node-find :wk "Find Nodes") + "n s" '(org-roam-db-sync :wk "Sync Nodes") + "n c" '(org-todo :wk "Cycle Todo") + "n l" '(org-latex-preview :wk "Preview Latex") + "n a" '(org-agenda :wk "Agenda") + "n t" '(org-table-align :wk "Align Table"))) ;;; org-mode.el ends here diff --git a/lisp/performance.el b/lisp/performance.el index d745be8..cf08513 100644 --- a/lisp/performance.el +++ b/lisp/performance.el @@ -6,12 +6,7 @@ ;; ;;; Code: -;; Reduce garbage collection at startup -(setq gc-cons-threshold most-positive-fixnum) - -;; Lower threshold back to 8 MiB (default is 800kB) -(add-hook 'emacs-startup-hook - (lambda () - (setq gc-cons-threshold (expt 2 23)))) +;; Increase the threshold +(setq gc-cons-threshold (* 50 1000 1000)) ;;; performance.el ends here