diff options
| author | bard <[email protected]> | 2023-10-08 15:12:47 -0400 |
|---|---|---|
| committer | bard <[email protected]> | 2023-10-08 15:12:47 -0400 |
| commit | 16b4c9ed8f62dccce9a3ec32810077a9140f8925 (patch) | |
| tree | 018616babc3444abc695de3ea1db68da1f5ad1b9 | |
| parent | 4e8baf9b88dada3bbc0bf030b925430b62cfe297 (diff) | |
module files migration complete
| -rw-r--r-- | bard-elisp/bard-editing.el | 57 | ||||
| -rw-r--r-- | bard-emacs-modules/bard-emacs-org.el | 116 | ||||
| -rw-r--r-- | bard-emacs-modules/bard-emacs-package.el | 186 | ||||
| -rw-r--r-- | bard-emacs-modules/bard-emacs-ui.el | 96 | ||||
| -rw-r--r-- | bard-emacs-modules/bard-emms.el | 14 | ||||
| -rw-r--r-- | bard-emacs-modules/bard-lang.el | 9 |
6 files changed, 478 insertions, 0 deletions
diff --git a/bard-elisp/bard-editing.el b/bard-elisp/bard-editing.el new file mode 100644 index 0000000..1e34eea --- /dev/null +++ b/bard-elisp/bard-editing.el @@ -0,0 +1,57 @@ +;;; bard-editing.el --- My custom editing functions and keybinds -*- lexical-binding: t -*- + +;; Author: BardofSprites +;; Maintainer: BardofSprites +;; Version: 0.1.0 +;; Package-Requires: ((emacs "28.2")) + +;; This file is not part of GNU Emacs + +;; This program is free software: you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; This program is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with this program. If not, see <https://www.gnu.org/licenses/>. + + +;;; Commentary: +;; Custom editing functions with intended use of my personal GNU Emacs configuration +;;; Code: + +;; Surround region with character +(defun bard/wrap-text-with-markers (start-marker end-marker marker) + "Surround marked text with any character." + (interactive "r\nsEnter marker (e.g., \"): ") + (save-excursion + (goto-char end-marker) + (insert marker) + (goto-char start-marker) + (insert marker))) + +(global-set-key (kbd "C-c s") 'bard/wrap-text-with-markers) + +(defun bard/copy-current-line () + "Copy the current line." + (interactive) + (let ((line-text (buffer-substring (line-beginning-position) (line-end-position)))) + (kill-new line-text) + (message "Copied current line"))) + +(global-set-key (kbd "C-c l") 'bard/copy-current-line) + +;; Multiple cursors +(global-set-key (kbd "C-S-c C-S-c") 'mc/edit-lines) +(global-set-key (kbd "C->") 'mc/mark-next-like-this) +(global-set-key (kbd "C-<") 'mc/mark-previous-like-this) +(global-set-key (kbd "C-c C-<") 'mc/mark-all-like-this) +(global-set-key (kbd "C-\\") 'mc/skip-to-next-like-this) +(global-set-key (kbd "C-:") 'mc/skip-to-previous-like-this) + +;;; bard-editing.el ends here diff --git a/bard-emacs-modules/bard-emacs-org.el b/bard-emacs-modules/bard-emacs-org.el new file mode 100644 index 0000000..1e0c551 --- /dev/null +++ b/bard-emacs-modules/bard-emacs-org.el @@ -0,0 +1,116 @@ +;; |------------------------------------| +;; | Org Config | +;; |------------------------------------| + +(require 'bard-emacs-ui) + +;; Org Variables +(setq org-directory "~/Notes/Org-Roam/") +(setq org-agenda-files (list "~/Notes/Org-Roam/todo.org")) +(add-hook 'org-mode-hook 'bard/text-hook) +(add-hook 'org-agenda-mode-hook 'hl-todo-mode) + +;; Making org mode look nice +(setq org-startup-indented t + org-hide-emphasis-markers t + org-startup-with-inline-images t + org-image-actual-width '(300)) + +;; Org todo keywords +(setq org-todo-keywords + '((sequence "TODO" "WAIT" "DONE"))) + +;; Org Cliplink +(global-set-key (kbd "C-x p i") 'org-cliplink) + +;; Org Agenda Faces +(custom-set-faces '(org-agenda-structure ((t (:inherit bold :foreground "#70a89f" :height 1.5 :family "Iosevka Comfy Motion Duo"))))) + +;; Org Agenda +(defun bard/choose-agenda () + "For viewing my custom agenda" + (interactive) + (let ((agenda-views '("Default" "Monthly" "Yearly"))) + (setq chosen-view (completing-read "Choose an agenda view: " agenda-views)) + (cond + ((string= chosen-view "Yearly") + (org-agenda nil "Y")) + ((string= chosen-view "Monthly") + (org-agenda nil "M")) + ((string= chosen-view "Default") + (org-agenda nil "D"))))) + +(global-set-key (kbd "<f6>") 'bard/choose-agenda) + +;; Org Agenda +(setq org-agenda-custom-commands + `(("D" "Daily agenda and top priority tasks" + ((tags-todo "*" + ((org-agenda-skip-function '(org-agenda-skip-if nil '(timestamp))) + (org-agenda-skip-function '(org-agenda-skip-entry-if 'todo 'done)) + (org-agenda-overriding-header "All Tasks \n"))) + (agenda "" ((org-agenda-span 1) + (org-agenda-start-day nil) + (org-deadline-warning-days 0) + (org-scheduled-past-days 0) + ;; We don't need the `org-agenda-date-today' + ;; highlight because that only has a practical + ;; utility in multi-day views. + (org-agenda-day-face-function (lambda (date) 'org-agenda-date)) + (org-agenda-format-date "%A %-e %B %Y") + (org-agenda-overriding-header "Today's agenda \n"))) + ;; write skip function that skips saturdays and sundays + (agenda "" ((org-agenda-span 7) + (org-deadline-warning-days 0) + (org-agenda-skip-function '(org-agenda-skip-entry-if 'todo 'done)) + (org-agenda-overriding-header "Upcoming this week \n"))))) + ("Y" "Yearly view for all tasks" + ((agenda "" ((org-agenda-span 365) + (org-deadline-warning-days 2) + (org-agenda-skip-function '(org-agenda-skip-entry-if 'todo 'done)) + (org-agenda-overriding-header "Upcoming this Year\n"))))) + ("M" "Monthly view for all tasks" + ((agenda "" ((org-agenda-span 31) + (org-deadline-warning-days 2) + (org-agenda-skip-function '(org-agenda-skip-entry-if 'todo 'done)) + (org-agenda-overriding-header "Upcoming this month\n"))))))) + +;; Org capture templates +(setq org-capture-templates + '(("h" "Homework" entry (file+olp "~/Notes/Org-Roam/todo.org" "Inbox" "Homework") + "* TODO %?") + ("e" "Extra/Coding" entry (file+olp "~/Notes/Org-Roam/todo.org" "Inbox" "Extra/Coding") + "* TODO %?") + ("r" "Reading List" entry (file+olp "~/Notes/Org-Roam/todo.org" "Inbox" "Watch/Read List") + "* %?") + ("j" "Journal" entry (file+datetree "~/Notes/Org-Roam/journal.org") + "* %U %^{Title}\n %?") + ("a" "Appointment" entry (file+heading "~/Notes/Org-Roam/todo.org" "Appointment") + "* %^{Task}\n %^t\n %?"))) + +;; Org Roam capture templates +(setq org-roam-capture-templates + '(("d" "default" plain + "\n* Tags: \n%? \n\n" + :if-new (file+head "%<%Y%m%d%H%M%S>-${slug}.org" "#+TITLE: ${title}\n") + :unnarrowed t) + ("n" "notes" plain + "\n\n\n* Tags :: %? \n\n* ${title} \n" + :if-new (file+head "%<%Y%m%d%H%M%S>-${slug}.org" "#+TITLE: ${title}\n") + :unnarrowed t) + ("b" "bio" plain + "#+ANKI_DECK: Bio \n\n* Tags :: [[id:cfe7bda9-b154-4d6b-989f-6af778a98cbd][Biology]] \n\n* %? \n" + :if-new (file+head "%<%Y%m%d%H%M%S>-${slug}.org" "#+TITLE: ${title}\n") + :unnarrowed t) + ("u" "apush" plain + "#+ANKI_DECK: APUSH \n\n* Tags :: [[id:06334c1d-5c06-4b70-bfd8-a074c0c36706][APUSH]] \n\n* %? \n" + :if-new (file+head "%<%Y%m%d%H%M%S>-${slug}.org" "#+TITLE: ${title}\n") + :unnarrowed t) + ("s" "snapshot" plain + (file "~/Notes/Org/snapshot_template.org") + :if-new (file+head "%<%Y%m%d%H%M%S>-${slug}.org" "#+TITLE: ${title}\n") + :unnarrowed t) + ("i" "idea" plain + "\n* Tags: \n%? \n\n" + :if-new (file+head "Ideas/%<%Y%m%d%H%M%S>-${slug}.org" "#+TITLE: ${title}\n") + :unnarrowed t))) diff --git a/bard-emacs-modules/bard-emacs-package.el b/bard-emacs-modules/bard-emacs-package.el new file mode 100644 index 0000000..ccd5339 --- /dev/null +++ b/bard-emacs-modules/bard-emacs-package.el @@ -0,0 +1,186 @@ +;; |------------------------------------| +;; | Packages | +;; |------------------------------------| + +(add-to-list 'load-path "~/.emacs.d/elisp/") +(require 'package) + +(setq package-archives '(("org" . "https://orgmode.org/elpa/") + ("elpa" . "https://elpa.gnu.org/packages/") + ("melpa" . "https://melpa.org/packages/"))) + +(package-initialize) +(unless package-archive-contents + (package-refresh-contents)) + +;; Initialize use-package on non-Linux platforms +(unless (package-installed-p 'use-package) + (package-install 'use-package)) + +(require 'use-package) +(setq use-package-always-ensure t) + +;; Ef-themes +(use-package ef-themes + :ensure t + :config + (load-theme 'ef-cyprus t) + (define-key global-map (kbd "<f5>") #'ef-themes-toggle) + (setq ef-themes-to-toggle '(ef-autumn ef-cyprus))) + +(use-package modus-themes + :ensure t + :config + (define-key global-map (kbd "M-<f5>") #'modus-themes-toggle)) + +(use-package rainbow-mode + :ensure t) + +(use-package mixed-pitch + :ensure t + :hook + (olivetti-mode . mixed-pitch-mode) + :config + (setq mixed-pitch-cursor-type 'box)) + +;; Multiple Cursors +(use-package multiple-cursors + :ensure t) + +;; Magit +(use-package magit + :ensure t) + +;; Vertico completion +(use-package vertico + :ensure t + :init + (vertico-mode 1)) + +;; Marginalia - works with vertico +(use-package marginalia + :ensure t + :init + (marginalia-mode)) + +(use-package company + :ensure t + :init + (global-company-mode 1)) + +(use-package orderless + :ensure t) + +(use-package yasnippet + :init + (yas-global-mode) + :ensure t) + +(use-package yasnippet-snippets + :ensure t) + +(use-package which-key + :init + (which-key-mode 1) + :ensure t) + +(use-package org-roam + :ensure t + :custom + (org-roam-directory (file-truename "~/Notes/Org-Roam")) + :bind (("C-c n l" . org-roam-buffer-toggle) + ("C-c n f" . org-roam-node-find) + ("C-c n g" . org-roam-graph) + ("C-c n i" . org-roam-node-insert) + ("C-c n c" . org-roam-capture) + ("C-c n j" . org-roam-dailies-capture-today)) + :config + (org-roam-db-autosync-mode 1)) + +(use-package orderless + :ensure t + :custom + (completion-styles '(orderless basic)) + (completion-category-overrides '((file (styles basic partial-completion))))) + +(use-package projectile + :ensure t) + +(use-package counsel + :ensure t + :config + (setq councel-rg-base-command "rg --no-heading --colors always %s .") + (setq counsel-rg-command-prefix "rg --no-heading --color always %s .")) + +(use-package dashboard + :ensure t + :config + (dashboard-setup-startup-hook) + (setq dashboard-startup-banner "~/.emacs.d/img/catwithscarf.jpg") + (setq dashboard-banner-logo-width 50) + (setq dashboard-banner-logo-height 50) + (setq dashboard-center-content t) + (setq dashboard-items '((recents . 5) + (bookmarks . 5) + (projects . 5))) + (setq dashboard-banner-logo-title "An Old Farmer's Smile") + (setq dashboard-set-footer nil)) + +(use-package elfeed + :ensure t + :config + (global-set-key (kbd "C-x w") 'elfeed) + (setq elfeed-search-filter "+unread -academia")) + +(use-package elfeed-org + :ensure t + :init + (elfeed-org) + :config + (setq rmh-elfeed-org-files (list "~/.emacs.d/feeds.org" + "~/.emacs.d/youtube.org"))) + +(use-package elfeed-goodies + :ensure t + :init + (elfeed-goodies/setup) + :config + (setq elfeed-goodies/powerline-default-separator 'box)) + +(use-package org-cliplink + :ensure t) + +(use-package hl-todo + :ensure t + :init + (global-hl-todo-mode t) + :config + (setq hl-todo-keyword-faces + '(("TODO" error bold) + ("FIXME" error bold) + ("WAIT" warning bold) + ("HACK" font-lock-constant-face bold) + ("DEPRECATED" font-lock-doc-face bold) + ("BUG" error bold)))) + +(use-package pdf-tools + :ensure t) + +(use-package toc-org + :ensure t) + +(use-package expand-region + :ensure t + :bind ("C-=" . er/expand-region)) + +(use-package clojure-mode + :ensure t) + +(use-package cider + :ensure t) + +(use-package clojure-snippets + :ensure t) + +(use-package haskell-mode + :ensure t) diff --git a/bard-emacs-modules/bard-emacs-ui.el b/bard-emacs-modules/bard-emacs-ui.el new file mode 100644 index 0000000..d725e8a --- /dev/null +++ b/bard-emacs-modules/bard-emacs-ui.el @@ -0,0 +1,96 @@ +;;; bard-emacs-ui.el --- ui configuration for emacs -*- lexical-binding: t -*- + +;; Author: BardofSprites +;; Maintainer: BardofSprites +;; Version: 0.1.0 +;; Package-Requires: (emacs "28.2") + +;; This file is not part of GNU Emacs + +;; This program is free software: you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; This program is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with this program. If not, see <https://www.gnu.org/licenses/>. + +;;; Code: + +;; Variables +(setq display-line-numbers-type 'relative) +(setq inhibit-startup-message t) +(setq inhibit-startup-screen t) +(setq frame-title-format "GNU Emacs") + +;; Modes +(scroll-bar-mode -1) +(tool-bar-mode -1) +(tooltip-mode -1) +(set-fringe-mode 10) +(menu-bar-mode -1) +(tool-bar-mode 0) + +;; Fonts +(set-face-attribute 'default nil :font "Iosevka Comfy" :height 140) +(set-face-attribute 'fixed-pitch nil :font "Iosevka Comfy" :height 140) +(set-face-attribute 'variable-pitch nil :font "Iosevka Comfy Wide" :height 140) + +(add-to-list 'default-frame-alist '(font . "Iosevka Comfy-14.5")) + +;; Common UI hook +(defun bard/text-hook () + (bard/olivetti-toggle) + (display-line-numbers-mode 0) + (hl-todo-mode 1)) + +;; olivetti +(use-package olivetti + :config + (defun bard/olivetti-toggle-interactive () + (interactive) + "Distraction-free writing environment" + (if (equal olivetti-mode nil) + (progn + (window-configuration-to-register 1) + (delete-other-windows) + (text-scale-set 0.2) + (setq olivetti-body-width 100) + (olivetti-mode t)) + ;; TODO turn off line numbers + (progn + (if (eq (length (window-list)) 1) + (jump-to-register 1)) + (olivetti-mode 0) + (text-scale-set 0) + (mixed-pitch-mode 0) + ;; TODO turn restore line numbers + (setq cursor-type 'box)))) + (defun bard/olivetti-toggle () + "Distraction-free writing environment" + (if (equal olivetti-mode nil) + (progn + (window-configuration-to-register 1) + (delete-other-windows) + (text-scale-set 0.2) + (setq olivetti-body-width 100) + (display-line-numbers-mode 0) + (olivetti-mode t)) + (progn + (if (eq (length (window-list)) 1) + (jump-to-register 1)) + (olivetti-mode 0) + (text-scale-set 0) + (mixed-pitch-mode 0) + (setq cursor-type 'box)))) + :bind + (("<f9>" . bard/olivetti-toggle-interactive))) + +(provide 'bard-emacs-ui) + +;;; bard-emacs-ui.el ends here diff --git a/bard-emacs-modules/bard-emms.el b/bard-emacs-modules/bard-emms.el new file mode 100644 index 0000000..a562337 --- /dev/null +++ b/bard-emacs-modules/bard-emms.el @@ -0,0 +1,14 @@ +;; |------------------------------------| +;; | EMMS | +;; |------------------------------------| + +(require 'emms-setup) + +(emms-all) +(setq emms-player-list '(emms-player-mpv) + emms-info-functions '(emms-info-native) + emms-playlist-buffer-name "*Music*") + +;; Keymaps +(define-key global-map (kbd "<f8>") #'emms) +(define-key global-map (kbd "M-<f8>") #'emms-browser) diff --git a/bard-emacs-modules/bard-lang.el b/bard-emacs-modules/bard-lang.el new file mode 100644 index 0000000..2400ea5 --- /dev/null +++ b/bard-emacs-modules/bard-lang.el @@ -0,0 +1,9 @@ +(defun bard/common-modes-hook () + "Commonly used modes, bundled in one hook" + (display-line-numbers-mode 1) + (electric-pair-mode 1) + (hl-todo-mode 1)) + +(add-hook 'emacs-lisp-mode-hook 'bard/common-modes-hook) +(add-hook 'haskell-mode-hook 'bard/common-modes-hook) +(add-hook 'clojure-mode-hook 'bard/common-modes-hook) |
