From d84ec399603ee1ba49be5bb22422082f70481300 Mon Sep 17 00:00:00 2001 From: Muhammad Nauman Raza Date: Tue, 8 Nov 2022 17:53:06 +0000 Subject: [PATCH] feat: folder restructure --- init.el | 123 +++------------------------------------------- lisp/editor.el | 8 +++ lisp/interface.el | 27 ++++++++++ lisp/org.el | 41 ++++++++++++++++ lisp/packages.el | 47 ++++++++++++++++++ 5 files changed, 130 insertions(+), 116 deletions(-) create mode 100644 lisp/editor.el create mode 100644 lisp/interface.el create mode 100644 lisp/org.el create mode 100644 lisp/packages.el diff --git a/init.el b/init.el index 7054966..d5506fe 100644 --- a/init.el +++ b/init.el @@ -1,21 +1,8 @@ -;; Disable Emacs window resizing at startup -(setq frame-resize-pixelwise t) - -;; Remove the startup screen -(setq inhibit-startup-message t) - -;; Disable some GTK decoration +;; Disable Emacs' GTK decorations. Done in this file otherwise done too late. (menu-bar-mode -1) (tool-bar-mode -1) (scroll-bar-mode -1) -;; Enable line numbers globally -(global-display-line-numbers-mode 1) - -;; Add the melpa package repository and initialize package repositories -(require 'package) -(package-initialize) - ;; Straight.el bootstrap (defvar bootstrap-version) (let ((bootstrap-file @@ -37,106 +24,10 @@ ;; Disable the creation of files ending with '~' (setq make-backup-files nil) -;; Install the Doom Emacs theme megapack. -(use-package doom-themes - :ensure t - :config - (setq doom-themes-enable-bold t - doom-themes-enable-italic t) - (doom-themes-treemacs-config) - (doom-themes-org-config)) +(add-to-list 'load-path (concat user-emacs-directory + (convert-standard-filename "lisp/"))) -;; Don't enable package.el at startup -(setq package-enable-at-startup nil) - -;; Set theme to doom-tokyo-night, Dianicemacs' default -(load-theme 'doom-tokyo-night t) - -;; A nice border around Emacs -(modify-all-frames-parameters - '((right-divider-width . 15) - (internal-border-width . 15))) -(dolist (face '(window-divider - window-divider-first-pixel - window-divider-last-pixel)) - (face-spec-reset-face face) - (set-face-foreground face (face-attribute 'default :background))) -(set-face-background 'fringe (face-attribute 'default :background)) - -;; Vi layer inside of Emacs -;; undo-fu, used by evil for undo/redo functionality -(use-package undo-fu - :ensure t) - -(use-package evil - :requires undo-fu - :ensure t - :init - (setq evil-undo-system 'undo-fu) - (evil-mode 1)) - -;; Keep packages up to date -(use-package auto-package-update - :config - (setq auto-package-update-delete-old-versions t) - (setq auto-package-update-hide-results t) - (auto-package-update-maybe)) - -;; Modeline - doom-modeline -(use-package doom-modeline - :ensure t - :init (doom-modeline-mode 1) - :config - (setq doom-modeline-height 25 - doom-modeline-bar-width 0 - doom-modeline-project-detection 'auto - doom-modeline-buffer-encoding nil - doom-modeline-modal t - doom-modeline-modal-icon t - doom-modeline-buffer-file-name-style 'file-name)) - -;; A beautiful git porcelain inside of Emacs -(use-package magit - :ensure t) - -;; Icons for various UI elements -(use-package all-the-icons - :ensure t) - -;; Org Mode -(use-package org-superstar - :ensure t - :init (add-hook 'org-mode-hook (lambda() (org-superstar-mode 1))) - :config - (setq org-superstar-headline-bullets-list - '("🞉" "🞈" "🞇" "🞆" "🞅" "🞄")) - (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)) - -;; Customize Org mode -(setq org-ellipsis "..." - org-use-property-inheritance t - org-list-allow-alphabetical t - org-catch-invisible-edits 'smart - org-startup-indented t - org-hide-emphasis-markers t - org-startup-with-inline-images t - org-image-actual-width '(300) - org-pretty-entities t - org-hide-leading-stars t - org-adapt-indentation t) - -(plist-put org-format-latex-options :scale 1.75) - -;; Programming languages configuration -;; Rust +(require 'interface) +(require 'packages) +(require 'editor) +(require 'org) diff --git a/lisp/editor.el b/lisp/editor.el new file mode 100644 index 0000000..3ccacdf --- /dev/null +++ b/lisp/editor.el @@ -0,0 +1,8 @@ +;;; This file customizes Emacs' editor + +;; evil - A Vi Layer inside of Emacs +(evil-mode 1) ; Enable evil +(setq evil-undo-system 'undo-fu) ; Enable undo/redo functionality using undo-fu + +;; Provide this file to init.el +(provide 'editor) diff --git a/lisp/interface.el b/lisp/interface.el new file mode 100644 index 0000000..1e343d9 --- /dev/null +++ b/lisp/interface.el @@ -0,0 +1,27 @@ +;;; This file contains configuration for Emacs interface elements. + +;; Stop Emacs from resizing the window at startup +(setq frame-resize-pixelwise t) + +;; Disable the modeline +(setq-default mode-line-format nil) + +;; Remove the startup screen +(setq inhibit-startup-message t) + +;; Enable line numbers globally +(global-display-line-numbers-mode 1) + +;; Add a nice border around Emacs +(modify-all-frames-parameters + '((right-divider-width . 15) + (internal-border-width . 15))) +(dolist (face '(window-divider + window-divider-first-pixel + window-divider-last-pixel)) + (face-spec-reset-face face) + (set-face-foreground face (face-attribute 'default :background))) +(set-face-background 'fringe (face-attribute 'default :background)) + +;; Provide this file to init.el +(provide 'interface) diff --git a/lisp/org.el b/lisp/org.el new file mode 100644 index 0000000..a533bb0 --- /dev/null +++ b/lisp/org.el @@ -0,0 +1,41 @@ +;;; This file contains configuration for Emacs' org-mode + +;; Enable org-superstar-mode in org-mode files +(add-hook 'org-mode-hook (lambda() (org-superstar-mode 1))) + +;; Scale up latex elements +(plist-put org-format-latex-options :scale 1.75) + +;; Customize org-mode's default functionality +(setq org-ellipsis "..." + org-use-property-inheritance t + org-list-allow-alphabetical t + org-catch-invisible-edits 'smart + org-startup-indented t + org-hide-emphasis-markers t + org-startup-with-inline-images t + org-image-actual-width '(300) + org-pretty-entities t + org-hide-leading-stars t + org-adapt-indentation t) + +;; Change org-mode's heading bullets +(setq org-superstar-headline-bullets-list + '("🞉" "🞈" "🞇" "🞆" "🞅" "🞄")) + +;; 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) + +;; Provide this file to init.el +(provide 'org) diff --git a/lisp/packages.el b/lisp/packages.el new file mode 100644 index 0000000..005771e --- /dev/null +++ b/lisp/packages.el @@ -0,0 +1,47 @@ +;;; This file contains the packages that Dianciemacs uses + +;; magit - A beautiful git porcelain for Emacs +(use-package magit + :ensure t) + +;;; Themes +;; Install the Doom Emacs theme megapack. +(use-package doom-themes + :ensure t + :config + (setq doom-themes-enable-bold t + doom-themes-enable-italic t) + (doom-themes-treemacs-config) + (doom-themes-org-config)) + +;; kaolin-themes, depends on autothemer +(use-package kaolin-themes + :requires autothemer + :ensure t) + +(use-package autothemer + :ensure t) + +;; all-the-icons - Icons for various UI elements +(use-package all-the-icons + :ensure t) + +;;; org-mode +;; org-superstar +(use-package org-superstar + :ensure t) + +;;; evil - A Vi layer inside of Emacs +(use-package evil + :requires undo-fu + :ensure t) + +;; undo-fu, used by evil for undo/redo functionality +(use-package undo-fu + :ensure t) + +;; Set theme to doom-tokyo-night, Dianicemacs' default +(load-theme 'doom-tokyo-night t) + +;; Provide this file to init.el +(provide 'packages)