diff --git a/.config/doom/bookmarks b/.config/doom/bookmarks deleted file mode 100644 index d6949fc..0000000 --- a/.config/doom/bookmarks +++ /dev/null @@ -1,10 +0,0 @@ -;;;; Emacs Bookmark Format Version 1;;;; -*- coding: utf-8-emacs; mode: lisp-data -*- -;;; This format is meant to be slightly human-readable; -;;; nevertheless, you probably don't want to edit it. -;;; -*- End Of Bookmark File Format Version Stamp -*- -(("org-capture-last-stored" - (filename . "~/nc/Org/roam/20230110120652-start.org") - (front-context-string) - (rear-context-string . "\n#+title: start\n") - (position . 83)) -) diff --git a/.config/doom/config.el b/.config/doom/config.el index 9f90658..d711a1e 100644 --- a/.config/doom/config.el +++ b/.config/doom/config.el @@ -1,838 +1,77 @@ -(beacon-mode 1) +;;; $DOOMDIR/config.el -*- lexical-binding: t; -*- -(setq bookmark-default-file "~/.config/doom/bookmarks") +;; Place your private configuration here! Remember, you do not need to run 'doom +;; sync' after modifying this file! -(map! :leader - (:prefix ("b". "buffer") - :desc "List bookmarks" "L" #'list-bookmarks - :desc "Set bookmark" "m" #'bookmark-set - :desc "Delete bookmark" "M" #'bookmark-set - :desc "Save current bookmarks to bookmark file" "w" #'bookmark-save)) -(global-auto-revert-mode 1) -(setq global-auto-revert-non-file-buffers t) +;; Some functionality uses this to identify you, e.g. GPG configuration, email +;; clients, file templates and snippets. It is optional. +;; (setq user-full-name "John Doe" +;; user-mail-address "john@doe.com") -(evil-define-key 'normal ibuffer-mode-map - (kbd "f c") 'ibuffer-filter-by-content - (kbd "f d") 'ibuffer-filter-by-directory - (kbd "f f") 'ibuffer-filter-by-filename - (kbd "f m") 'ibuffer-filter-by-mode - (kbd "f n") 'ibuffer-filter-by-name - (kbd "f x") 'ibuffer-filter-disable - (kbd "g h") 'ibuffer-do-kill-lines - (kbd "g H") 'ibuffer-update) - -;; https://stackoverflow.com/questions/9547912/emacs-calendar-show-more-than-3-months -(defun dt/year-calendar (&optional year) - (interactive) - (require 'calendar) - (let* ( - (current-year (number-to-string (nth 5 (decode-time (current-time))))) - (month 0) - (year (if year year (string-to-number (format-time-string "%Y" (current-time)))))) - (switch-to-buffer (get-buffer-create calendar-buffer)) - (when (not (eq major-mode 'calendar-mode)) - (calendar-mode)) - (setq displayed-month month) - (setq displayed-year year) - (setq buffer-read-only nil) - (erase-buffer) - ;; horizontal rows - (dotimes (j 4) - ;; vertical columns - (dotimes (i 3) - (calendar-generate-month - (setq month (+ month 1)) - year - ;; indentation / spacing between months - (+ 5 (* 25 i)))) - (goto-char (point-max)) - (insert (make-string (- 10 (count-lines (point-min) (point-max))) ?\n)) - (widen) - (goto-char (point-max)) - (narrow-to-region (point-max) (point-max))) - (widen) - (goto-char (point-min)) - (setq buffer-read-only t))) - -(defun dt/scroll-year-calendar-forward (&optional arg event) - "Scroll the yearly calendar by year in a forward direction." - (interactive (list (prefix-numeric-value current-prefix-arg) - last-nonmenu-event)) - (unless arg (setq arg 0)) - (save-selected-window - (if (setq event (event-start event)) (select-window (posn-window event))) - (unless (zerop arg) - (let* ( - (year (+ displayed-year arg))) - (dt/year-calendar year))) - (goto-char (point-min)) - (run-hooks 'calendar-move-hook))) - -(defun dt/scroll-year-calendar-backward (&optional arg event) - "Scroll the yearly calendar by year in a backward direction." - (interactive (list (prefix-numeric-value current-prefix-arg) - last-nonmenu-event)) - (dt/scroll-year-calendar-forward (- (or arg 1)) event)) - -(map! :leader - :desc "Scroll year calendar backward" "" #'dt/scroll-year-calendar-backward - :desc "Scroll year calendar forward" "" #'dt/scroll-year-calendar-forward) - -(defalias 'year-calendar 'dt/year-calendar) - -(use-package! calfw) -(use-package! calfw-org) - -(setq centaur-tabs-set-bar 'over - centaur-tabs-set-icons t - centaur-tabs-gray-out-icons 'buffer - centaur-tabs-height 24 - centaur-tabs-set-modified-marker t - centaur-tabs-style "bar" - centaur-tabs-modified-marker "•") -(map! :leader - :desc "Toggle tabs globally" "t c" #'centaur-tabs-mode - :desc "Toggle tabs local display" "t C" #'centaur-tabs-local-mode) -(evil-define-key 'normal centaur-tabs-mode-map (kbd "g ") 'centaur-tabs-forward ; default Doom binding is 'g t' - (kbd "g ") 'centaur-tabs-backward ; default Doom binding is 'g T' - (kbd "g ") 'centaur-tabs-forward-group - (kbd "g ") 'centaur-tabs-backward-group) - -(map! :leader - (:prefix ("c h" . "Help info from Clippy") - :desc "Clippy describes function under point" "f" #'clippy-describe-function - :desc "Clippy describes variable under point" "v" #'clippy-describe-variable)) - -(map! :leader - (:prefix ("d" . "dired") - :desc "Open dired" "d" #'dired - :desc "Dired jump to current" "j" #'dired-jump) - (:after dired - (:map dired-mode-map - :desc "Peep-dired image previews" "d p" #'peep-dired - :desc "Dired view file" "d v" #'dired-view-file))) - -(evil-define-key 'normal dired-mode-map - (kbd "M-RET") 'dired-display-file - (kbd "h") 'dired-up-directory - (kbd "l") 'dired-open-file ; use dired-find-file instead of dired-open. - (kbd "m") 'dired-mark - (kbd "t") 'dired-toggle-marks - (kbd "u") 'dired-unmark - (kbd "C") 'dired-do-copy - (kbd "D") 'dired-do-delete - (kbd "J") 'dired-goto-file - (kbd "M") 'dired-do-chmod - (kbd "O") 'dired-do-chown - (kbd "P") 'dired-do-print - (kbd "R") 'dired-do-rename - (kbd "T") 'dired-do-touch - (kbd "Y") 'dired-copy-filenamecopy-filename-as-kill ; copies filename to kill ring. - (kbd "Z") 'dired-do-compress - (kbd "+") 'dired-create-directory - (kbd "-") 'dired-do-kill-lines - (kbd "% l") 'dired-downcase - (kbd "% m") 'dired-mark-files-regexp - (kbd "% u") 'dired-upcase - (kbd "* %") 'dired-mark-files-regexp - (kbd "* .") 'dired-mark-extension - (kbd "* /") 'dired-mark-directories - (kbd "; d") 'epa-dired-do-decrypt - (kbd "; e") 'epa-dired-do-encrypt) -;; Get file icons in dired -(add-hook 'dired-mode-hook 'all-the-icons-dired-mode) -;; With dired-open plugin, you can launch external programs for certain extensions -;; For example, I set all .png files to open in 'sxiv' and all .mp4 files to open in 'mpv' -(setq dired-open-extensions '(("gif" . "sxiv") - ("jpg" . "sxiv") - ("png" . "sxiv") - ("mkv" . "mpv") - ("mp4" . "mpv"))) - -(evil-define-key 'normal peep-dired-mode-map - (kbd "j") 'peep-dired-next-file - (kbd "k") 'peep-dired-prev-file) -(add-hook 'peep-dired-hook 'evil-normalize-keymaps) - -(setq delete-by-moving-to-trash t - trash-directory "~/.local/share/Trash/files/") +;; Doom exposes five (optional) variables for controlling fonts in Doom: +;; +;; - `doom-font' -- the primary font to use +;; - `doom-variable-pitch-font' -- a non-monospace font (where applicable) +;; - `doom-big-font' -- used for `doom-big-font-mode'; use this for +;; presentations or streaming. +;; - `doom-symbol-font' -- for symbols +;; - `doom-serif-font' -- for the `fixed-pitch-serif' face +;; +;; See 'C-h v doom-font' for documentation and more examples of what they +;; accept. For example: +;; +;;(setq doom-font (font-spec :family "Fira Code" :size 12 :weight 'semi-light) +;; doom-variable-pitch-font (font-spec :family "Fira Sans" :size 13)) +;; +;; If you or Emacs can't find your font, use 'M-x describe-font' to look them +;; up, `M-x eval-region' to execute elisp code, and 'M-x doom/reload-font' to +;; refresh your font settings. If Emacs still can't find your font, it likely +;; wasn't installed correctly. Font issues are rarely Doom issues! +;; There are two ways to load a theme. Both assume the theme is installed and +;; available. You can either set `doom-theme' or manually load a theme with the +;; `load-theme' function. This is the default: (setq doom-theme 'doom-one) -(map! :leader - :desc "Load new theme" "h t" #'counsel-load-theme) - -(ednc-mode 1) - -(defun show-notification-in-buffer (old new) - (let ((name (format "Notification %d" (ednc-notification-id (or old new))))) - (with-current-buffer (get-buffer-create name) - (if new (let ((inhibit-read-only t)) - (if old (erase-buffer) (ednc-view-mode)) - (insert (ednc-format-notification new t)) - (pop-to-buffer (current-buffer))) - (kill-buffer))))) - -(add-hook 'ednc-notification-presentation-functions - #'show-notification-in-buffer) - -(evil-define-key 'normal ednc-view-mode-map - (kbd "d") 'ednc-dismiss-notification - (kbd "RET") 'ednc-invoke-action - (kbd "e") 'ednc-toggle-expanded-view) - -(setq elfeed-goodies/entry-pane-size 0.5) - -(evil-define-key 'normal elfeed-show-mode-map - (kbd "J") 'elfeed-goodies/split-show-next - (kbd "K") 'elfeed-goodies/split-show-prev) -(evil-define-key 'normal elfeed-search-mode-map - (kbd "J") 'elfeed-goodies/split-show-next - (kbd "K") 'elfeed-goodies/split-show-prev) -(setq elfeed-feeds (quote - (("https://www.reddit.com/r/linux.rss" reddit linux) - ("https://www.reddit.com/r/commandline.rss" reddit commandline) - ("https://www.reddit.com/r/distrotube.rss" reddit distrotube) - ("https://www.reddit.com/r/emacs.rss" reddit emacs) - ("https://www.gamingonlinux.com/article_rss.php" gaming linux) - ("https://hackaday.com/blog/feed/" hackaday linux) - ("https://opensource.com/feed" opensource linux) - ("https://linux.softpedia.com/backend.xml" softpedia linux) - ("https://itsfoss.com/feed/" itsfoss linux) - ("https://www.zdnet.com/topic/linux/rss.xml" zdnet linux) - ("https://www.phoronix.com/rss.php" phoronix linux) - ("http://feeds.feedburner.com/d0od" omgubuntu linux) - ("https://www.computerworld.com/index.rss" computerworld linux) - ("https://www.networkworld.com/category/linux/index.rss" networkworld linux) - ("https://www.techrepublic.com/rssfeeds/topic/open-source/" techrepublic linux) - ("https://betanews.com/feed" betanews linux) - ("http://lxer.com/module/newswire/headlines.rss" lxer linux)))) - -(emms-all) -(emms-default-players) -(emms-mode-line 1) -(emms-playing-time 1) -(setq emms-source-file-default-directory "~/Music/" - emms-playlist-buffer-name "*Music*" - emms-info-asynchronously t - emms-source-file-directory-tree-function 'emms-source-file-directory-tree-find) -(map! :leader - (:prefix ("a" . "EMMS audio player") - :desc "Go to emms playlist" "a" #'emms-playlist-mode-go - :desc "Emms pause track" "x" #'emms-pause - :desc "Emms stop track" "s" #'emms-stop - :desc "Emms play previous track" "p" #'emms-previous - :desc "Emms play next track" "n" #'emms-next)) - -(use-package emojify - :hook (after-init . global-emojify-mode)) - -(map! :leader - (:prefix ("e". "evaluate/ERC/EWW") - :desc "Launch ERC with TLS connection" "E" #'erc-tls)) - -(setq erc-prompt (lambda () (concat "[" (buffer-name) "]")) - erc-server "irc.libera.chat" - erc-nick "distrotube" - erc-user-full-name "Derek Taylor" - erc-track-shorten-start 24 - erc-autojoin-channels-alist '(("irc.libera.chat" "#archlinux" "#linux" "#emacs")) - erc-kill-buffer-on-part t - erc-fill-column 100 - erc-fill-function 'erc-fill-static - erc-fill-static-center 20 - ;; erc-auto-query 'bury - ) - -(map! :leader - (:prefix ("e". "evaluate/ERC/EWW") - :desc "Evaluate elisp in buffer" "b" #'eval-buffer - :desc "Evaluate defun" "d" #'eval-defun - :desc "Evaluate elisp expression" "e" #'eval-expression - :desc "Evaluate last sexpression" "l" #'eval-last-sexp - :desc "Evaluate elisp in region" "r" #'eval-region)) - -(setq browse-url-browser-function 'eww-browse-url) -(map! :leader - :desc "Search web for text between BEG/END" - "s w" #'eww-search-words - (:prefix ("e" . "evaluate/ERC/EWW") - :desc "Eww web browser" "w" #'eww - :desc "Eww reload page" "R" #'eww-reload)) - -(autoload 'exwm-enable "exwm-config.el") - -(setq doom-font (font-spec :family "JetBrains Mono" :size 15) - doom-variable-pitch-font (font-spec :family "Ubuntu" :size 15) - doom-big-font (font-spec :family "JetBrains Mono" :size 24)) -(after! doom-themes - (setq doom-themes-enable-bold t - doom-themes-enable-italic t)) -(custom-set-faces! - '(font-lock-comment-face :slant italic) - '(font-lock-keyword-face :slant italic)) - -(setq imenu-list-focus-after-activation t) - -(map! :leader - (:prefix ("s" . "Search") - :desc "Menu to jump to places in buffer" "i" #'counsel-imenu)) - -(map! :leader - (:prefix ("t" . "Toggle") - :desc "Toggle imenu shown in a sidebar" "i" #'imenu-list-smart-toggle)) - -(defun dt/insert-todays-date (prefix) - (interactive "P") - (let ((format (cond - ((not prefix) "%A, %B %d, %Y") - ((equal prefix '(4)) "%m-%d-%Y") - ((equal prefix '(16)) "%Y-%m-%d")))) - (insert (format-time-string format)))) - -(require 'calendar) -(defun dt/insert-any-date (date) - "Insert DATE using the current locale." - (interactive (list (calendar-read-date))) - (insert (calendar-date-string date))) - -(map! :leader - (:prefix ("i d" . "Insert date") - :desc "Insert any date" "a" #'dt/insert-any-date - :desc "Insert todays date" "t" #'dt/insert-todays-date)) - -(setq ivy-posframe-display-functions-alist - '((swiper . ivy-posframe-display-at-point) - (complete-symbol . ivy-posframe-display-at-point) - (counsel-M-x . ivy-display-function-fallback) - (counsel-esh-history . ivy-posframe-display-at-window-center) - (counsel-describe-function . ivy-display-function-fallback) - (counsel-describe-variable . ivy-display-function-fallback) - (counsel-find-file . ivy-display-function-fallback) - (counsel-recentf . ivy-display-function-fallback) - (counsel-register . ivy-posframe-display-at-frame-bottom-window-center) - (dmenu . ivy-posframe-display-at-frame-top-center) - (nil . ivy-posframe-display)) - ivy-posframe-height-alist - '((swiper . 20) - (dmenu . 20) - (t . 10))) -(ivy-posframe-mode 1) ; 1 enables posframe-mode, 0 disables it. - -(map! :leader - (:prefix ("v" . "Ivy") - :desc "Ivy push view" "v p" #'ivy-push-view - :desc "Ivy switch view" "v s" #'ivy-switch-view)) +(setq doom-font (font-spec :family "JetBrains Mono" :size 15)) +;; This determines the style of line numbers in effect. If set to `nil', line +;; numbers are disabled. For relative line numbers, set this to `relative'. (setq display-line-numbers-type t) -(map! :leader - :desc "Comment or uncomment lines" "TAB TAB" #'comment-line - (:prefix ("t" . "toggle") - :desc "Toggle line numbers" "l" #'doom/toggle-line-numbers - :desc "Toggle line highlight in frame" "h" #'hl-line-mode - :desc "Toggle line highlight globally" "H" #'global-hl-line-mode - :desc "Toggle truncate lines" "t" #'toggle-truncate-lines)) -(custom-set-faces - '(markdown-header-face ((t (:inherit font-lock-function-name-face :weight bold :family "variable-pitch")))) - '(markdown-header-face-1 ((t (:inherit markdown-header-face :height 1.7)))) - '(markdown-header-face-2 ((t (:inherit markdown-header-face :height 1.6)))) - '(markdown-header-face-3 ((t (:inherit markdown-header-face :height 1.5)))) - '(markdown-header-face-4 ((t (:inherit markdown-header-face :height 1.4)))) - '(markdown-header-face-5 ((t (:inherit markdown-header-face :height 1.3)))) - '(markdown-header-face-6 ((t (:inherit markdown-header-face :height 1.2))))) +;; If you use `org' and don't want your org files in the default location below, +;; change `org-directory'. It must be set before org loads! +(setq org-directory "~/org/") -(setq minimap-window-location 'right) -(map! :leader - (:prefix ("t" . "toggle") - :desc "Toggle minimap-mode" "m" #'minimap-mode)) -(set-face-attribute 'mode-line nil :font "Ubuntu Mono-13") -(setq doom-modeline-height 30 ;; sets modeline height - doom-modeline-bar-width 5 ;; sets right bar width - doom-modeline-persp-name t ;; adds perspective name to modeline - doom-modeline-persp-icon t) ;; adds folder icon next to persp name - -(xterm-mouse-mode 1) - -(after! neotree - (setq neo-smart-open t - neo-window-fixed-size nil)) -(after! doom-themes - (setq doom-neotree-enable-variable-pitch t)) -(map! :leader - :desc "Toggle neotree file viewer" "t n" #'neotree-toggle - :desc "Open directory in neotree" "d n" #'neotree-dir) - -(map! :leader - (:prefix ("=" . "open file") - :desc "Edit agenda file" "=" #'(lambda () (interactive) (find-file "~/.config/doom/start.org")) - :desc "Edit agenda file" "a" #'(lambda () (interactive) (find-file "~/nc/Org/agenda.org")) - :desc "Edit doom config.org" "c" #'(lambda () (interactive) (find-file "~/.config/doom/config.org")) - :desc "Edit doom init.el" "i" #'(lambda () (interactive) (find-file "~/.config/doom/init.el")) - :desc "Edit doom packages.el" "p" #'(lambda () (interactive) (find-file "~/.config/doom/packages.el")))) -(map! :leader - (:prefix ("= e" . "open eshell files") - :desc "Edit eshell aliases" "a" #'(lambda () (interactive) (find-file "~/.config/doom/eshell/aliases")) - :desc "Edit eshell profile" "p" #'(lambda () (interactive) (find-file "~/.config/doom/eshell/profile")))) - -(map! :leader - :desc "Org babel tangle" "m B" #'org-babel-tangle) -(after! org - (setq org-directory "~/nc/Org/" - org-default-notes-file (expand-file-name "notes.org" org-directory) - org-ellipsis " ▼ " - org-superstar-headline-bullets-list '("◉" "●" "○" "◆" "●" "○" "◆") - org-superstar-itembullet-alist '((?+ . ?➤) (?- . ?✦)) ; changes +/- symbols in item lists - org-log-done 'time - org-hide-emphasis-markers t - ;; ex. of org-link-abbrev-alist in action - ;; [[arch-wiki:Name_of_Page][Description]] - org-link-abbrev-alist ; This overwrites the default Doom org-link-abbrev-list - '(("google" . "http://www.google.com/search?q=") - ("arch-wiki" . "https://wiki.archlinux.org/index.php/") - ("ddg" . "https://duckduckgo.com/?q=") - ("wiki" . "https://en.wikipedia.org/wiki/")) - org-table-convert-region-max-lines 20000 - org-todo-keywords ; This overwrites the default Doom org-todo-keywords - '((sequence - "TODO(t)" ; A task that is ready to be tackled - "BLOG(b)" ; Blog writing assignments - "GYM(g)" ; Things to accomplish at the gym - "PROJ(p)" ; A project that contains other tasks - "VIDEO(v)" ; Video assignments - "WAIT(w)" ; Something is holding up this task - "|" ; The pipe necessary to separate "active" states and "inactive" states - "DONE(d)" ; Task has been completed - "CANCELLED(c)" )))) ; Task has been cancelled - -(after! org - (setq org-agenda-files '("~/nc/Org/agenda.org"))) - -(setq - ;; org-fancy-priorities-list '("[A]" "[B]" "[C]") - ;; org-fancy-priorities-list '("❗" "[B]" "[C]") - org-fancy-priorities-list '("🟥" "🟧" "🟨") - org-priority-faces - '((?A :foreground "#ff6c6b" :weight bold) - (?B :foreground "#98be65" :weight bold) - (?C :foreground "#c678dd" :weight bold)) - org-agenda-block-separator 8411) - -(setq org-agenda-custom-commands - '(("v" "A better agenda view" - ((tags "PRIORITY=\"A\"" - ((org-agenda-skip-function '(org-agenda-skip-entry-if 'todo 'done)) - (org-agenda-overriding-header "High-priority unfinished tasks:"))) - (tags "PRIORITY=\"B\"" - ((org-agenda-skip-function '(org-agenda-skip-entry-if 'todo 'done)) - (org-agenda-overriding-header "Medium-priority unfinished tasks:"))) - (tags "PRIORITY=\"C\"" - ((org-agenda-skip-function '(org-agenda-skip-entry-if 'todo 'done)) - (org-agenda-overriding-header "Low-priority unfinished tasks:"))) - (tags "customtag" - ((org-agenda-skip-function '(org-agenda-skip-entry-if 'todo 'done)) - (org-agenda-overriding-header "Tasks marked with customtag:"))) - - (agenda "") - (alltodo ""))))) - -(use-package! org-auto-tangle - :defer t - :hook (org-mode . org-auto-tangle-mode) - :config - (setq org-auto-tangle-default t)) - -(defun dt/insert-auto-tangle-tag () - "Insert auto-tangle tag in a literate config." - (interactive) - (evil-org-open-below 1) - (insert "#+auto_tangle: t ") - (evil-force-normal-state)) - -(map! :leader - :desc "Insert auto_tangle tag" "i a" #'dt/insert-auto-tangle-tag) - -(defun dt/org-colors-doom-one () - "Enable Doom One colors for Org headers." - (interactive) - (dolist - (face - '((org-level-1 1.7 "#51afef" ultra-bold) - (org-level-2 1.6 "#c678dd" extra-bold) - (org-level-3 1.5 "#98be65" bold) - (org-level-4 1.4 "#da8548" semi-bold) - (org-level-5 1.3 "#5699af" normal) - (org-level-6 1.2 "#a9a1e1" normal) - (org-level-7 1.1 "#46d9ff" normal) - (org-level-8 1.0 "#ff6c6b" normal))) - (set-face-attribute (nth 0 face) nil :font doom-variable-pitch-font :weight (nth 3 face) :height (nth 1 face) :foreground (nth 2 face))) - (set-face-attribute 'org-table nil :font doom-font :weight 'normal :height 1.0 :foreground "#bfafdf")) - -(defun dt/org-colors-dracula () - "Enable Dracula colors for Org headers." - (interactive) - (dolist - (face - '((org-level-1 1.7 "#8be9fd" ultra-bold) - (org-level-2 1.6 "#bd93f9" extra-bold) - (org-level-3 1.5 "#50fa7b" bold) - (org-level-4 1.4 "#ff79c6" semi-bold) - (org-level-5 1.3 "#9aedfe" normal) - (org-level-6 1.2 "#caa9fa" normal) - (org-level-7 1.1 "#5af78e" normal) - (org-level-8 1.0 "#ff92d0" normal))) - (set-face-attribute (nth 0 face) nil :font doom-variable-pitch-font :weight (nth 3 face) :height (nth 1 face) :foreground (nth 2 face))) - (set-face-attribute 'org-table nil :font doom-font :weight 'normal :height 1.0 :foreground "#bfafdf")) - -(defun dt/org-colors-gruvbox-dark () - "Enable Gruvbox Dark colors for Org headers." - (interactive) - (dolist - (face - '((org-level-1 1.7 "#458588" ultra-bold) - (org-level-2 1.6 "#b16286" extra-bold) - (org-level-3 1.5 "#98971a" bold) - (org-level-4 1.4 "#fb4934" semi-bold) - (org-level-5 1.3 "#83a598" normal) - (org-level-6 1.2 "#d3869b" normal) - (org-level-7 1.1 "#d79921" normal) - (org-level-8 1.0 "#8ec07c" normal))) - (set-face-attribute (nth 0 face) nil :font doom-variable-pitch-font :weight (nth 3 face) :height (nth 1 face) :foreground (nth 2 face))) - (set-face-attribute 'org-table nil :font doom-font :weight 'normal :height 1.0 :foreground "#bfafdf")) - -(defun dt/org-colors-monokai-pro () - "Enable Monokai Pro colors for Org headers." - (interactive) - (dolist - (face - '((org-level-1 1.7 "#78dce8" ultra-bold) - (org-level-2 1.6 "#ab9df2" extra-bold) - (org-level-3 1.5 "#a9dc76" bold) - (org-level-4 1.4 "#fc9867" semi-bold) - (org-level-5 1.3 "#ff6188" normal) - (org-level-6 1.2 "#ffd866" normal) - (org-level-7 1.1 "#78dce8" normal) - (org-level-8 1.0 "#ab9df2" normal))) - (set-face-attribute (nth 0 face) nil :font doom-variable-pitch-font :weight (nth 3 face) :height (nth 1 face) :foreground (nth 2 face))) - (set-face-attribute 'org-table nil :font doom-font :weight 'normal :height 1.0 :foreground "#bfafdf")) - -(defun dt/org-colors-nord () - "Enable Nord colors for Org headers." - (interactive) - (dolist - (face - '((org-level-1 1.7 "#81a1c1" ultra-bold) - (org-level-2 1.6 "#b48ead" extra-bold) - (org-level-3 1.5 "#a3be8c" bold) - (org-level-4 1.4 "#ebcb8b" semi-bold) - (org-level-5 1.3 "#bf616a" normal) - (org-level-6 1.2 "#88c0d0" normal) - (org-level-7 1.1 "#81a1c1" normal) - (org-level-8 1.0 "#b48ead" normal))) - (set-face-attribute (nth 0 face) nil :font doom-variable-pitch-font :weight (nth 3 face) :height (nth 1 face) :foreground (nth 2 face))) - (set-face-attribute 'org-table nil :font doom-font :weight 'normal :height 1.0 :foreground "#bfafdf")) - -(defun dt/org-colors-oceanic-next () - "Enable Oceanic Next colors for Org headers." - (interactive) - (dolist - (face - '((org-level-1 1.7 "#6699cc" ultra-bold) - (org-level-2 1.6 "#c594c5" extra-bold) - (org-level-3 1.5 "#99c794" bold) - (org-level-4 1.4 "#fac863" semi-bold) - (org-level-5 1.3 "#5fb3b3" normal) - (org-level-6 1.2 "#ec5f67" normal) - (org-level-7 1.1 "#6699cc" normal) - (org-level-8 1.0 "#c594c5" normal))) - (set-face-attribute (nth 0 face) nil :font doom-variable-pitch-font :weight (nth 3 face) :height (nth 1 face) :foreground (nth 2 face))) - (set-face-attribute 'org-table nil :font doom-font :weight 'normal :height 1.0 :foreground "#bfafdf")) - -(defun dt/org-colors-palenight () - "Enable Palenight colors for Org headers." - (interactive) - (dolist - (face - '((org-level-1 1.7 "#82aaff" ultra-bold) - (org-level-2 1.6 "#c792ea" extra-bold) - (org-level-3 1.5 "#c3e88d" bold) - (org-level-4 1.4 "#ffcb6b" semi-bold) - (org-level-5 1.3 "#a3f7ff" normal) - (org-level-6 1.2 "#e1acff" normal) - (org-level-7 1.1 "#f07178" normal) - (org-level-8 1.0 "#ddffa7" normal))) - (set-face-attribute (nth 0 face) nil :font doom-variable-pitch-font :weight (nth 3 face) :height (nth 1 face) :foreground (nth 2 face))) - (set-face-attribute 'org-table nil :font doom-font :weight 'normal :height 1.0 :foreground "#bfafdf")) - -(defun dt/org-colors-solarized-dark () - "Enable Solarized Dark colors for Org headers." - (interactive) - (dolist - (face - '((org-level-1 1.7 "#268bd2" ultra-bold) - (org-level-2 1.6 "#d33682" extra-bold) - (org-level-3 1.5 "#859900" bold) - (org-level-4 1.4 "#b58900" semi-bold) - (org-level-5 1.3 "#cb4b16" normal) - (org-level-6 1.2 "#6c71c4" normal) - (org-level-7 1.1 "#2aa198" normal) - (org-level-8 1.0 "#657b83" normal))) - (set-face-attribute (nth 0 face) nil :font doom-variable-pitch-font :weight (nth 3 face) :height (nth 1 face) :foreground (nth 2 face))) - (set-face-attribute 'org-table nil :font doom-font :weight 'normal :height 1.0 :foreground "#bfafdf")) - -(defun dt/org-colors-solarized-light () - "Enable Solarized Light colors for Org headers." - (interactive) - (dolist - (face - '((org-level-1 1.7 "#268bd2" ultra-bold) - (org-level-2 1.6 "#d33682" extra-bold) - (org-level-3 1.5 "#859900" bold) - (org-level-4 1.4 "#b58900" semi-bold) - (org-level-5 1.3 "#cb4b16" normal) - (org-level-6 1.2 "#6c71c4" normal) - (org-level-7 1.1 "#2aa198" normal) - (org-level-8 1.0 "#657b83" normal))) - (set-face-attribute (nth 0 face) nil :font doom-variable-pitch-font :weight (nth 3 face) :height (nth 1 face) :foreground (nth 2 face))) - (set-face-attribute 'org-table nil :font doom-font :weight 'normal :height 1.0 :foreground "#bfafdf")) - -(defun dt/org-colors-tomorrow-night () - "Enable Tomorrow Night colors for Org headers." - (interactive) - (dolist - (face - '((org-level-1 1.7 "#81a2be" ultra-bold) - (org-level-2 1.6 "#b294bb" extra-bold) - (org-level-3 1.5 "#b5bd68" bold) - (org-level-4 1.4 "#e6c547" semi-bold) - (org-level-5 1.3 "#cc6666" normal) - (org-level-6 1.2 "#70c0ba" normal) - (org-level-7 1.1 "#b77ee0" normal) - (org-level-8 1.0 "#9ec400" normal))) - (set-face-attribute (nth 0 face) nil :font doom-variable-pitch-font :weight (nth 3 face) :height (nth 1 face) :foreground (nth 2 face))) - (set-face-attribute 'org-table nil :font doom-font :weight 'normal :height 1.0 :foreground "#bfafdf")) - -;; Load our desired dt/org-colors-* theme on startup -(dt/org-colors-doom-one) - -(use-package ox-man) -(use-package ox-gemini) - -(setq org-journal-dir "~/nc/Org/journal/" - org-journal-date-prefix "* " - org-journal-time-prefix "** " - org-journal-date-format "%B %d, %Y (%A) " - org-journal-file-format "%Y-%m-%d.org") - -(setq org-publish-use-timestamps-flag nil) -(setq org-export-with-broken-links t) -(setq org-publish-project-alist - '(("distro.tube without manpages" - :base-directory "~/nc/gitlab-repos/distro.tube/" - :base-extension "org" - :publishing-directory "~/nc/gitlab-repos/distro.tube/html/" - :recursive t - :exclude "org-html-themes/.*\\|man-org/man*" - :publishing-function org-html-publish-to-html - :headline-levels 4 ; Just the default for this project. - :auto-preamble t) - ("man0p" - :base-directory "~/nc/gitlab-repos/distro.tube/man-org/man0p/" - :base-extension "org" - :publishing-directory "~/nc/gitlab-repos/distro.tube/html/man-org/man0p/" - :recursive t - :publishing-function org-html-publish-to-html - :headline-levels 4 ; Just the default for this project. - :auto-preamble t) - ("man1" - :base-directory "~/nc/gitlab-repos/distro.tube/man-org/man1/" - :base-extension "org" - :publishing-directory "~/nc/gitlab-repos/distro.tube/html/man-org/man1/" - :recursive t - :publishing-function org-html-publish-to-html - :headline-levels 4 ; Just the default for this project. - :auto-preamble t) - ("man1p" - :base-directory "~/nc/gitlab-repos/distro.tube/man-org/man1p/" - :base-extension "org" - :publishing-directory "~/nc/gitlab-repos/distro.tube/html/man-org/man1p/" - :recursive t - :publishing-function org-html-publish-to-html - :headline-levels 4 ; Just the default for this project. - :auto-preamble t) - ("man2" - :base-directory "~/nc/gitlab-repos/distro.tube/man-org/man2/" - :base-extension "org" - :publishing-directory "~/nc/gitlab-repos/distro.tube/html/man-org/man2/" - :recursive t - :publishing-function org-html-publish-to-html - :headline-levels 4 ; Just the default for this project. - :auto-preamble t) - ("man3" - :base-directory "~/nc/gitlab-repos/distro.tube/man-org/man3/" - :base-extension "org" - :publishing-directory "~/nc/gitlab-repos/distro.tube/html/man-org/man3/" - :recursive t - :publishing-function org-html-publish-to-html - :headline-levels 4 ; Just the default for this project. - :auto-preamble t) - ("man3p" - :base-directory "~/nc/gitlab-repos/distro.tube/man-org/man3p/" - :base-extension "org" - :publishing-directory "~/nc/gitlab-repos/distro.tube/html/man-org/man3p/" - :recursive t - :publishing-function org-html-publish-to-html - :headline-levels 4 ; Just the default for this project. - :auto-preamble t) - ("man4" - :base-directory "~/nc/gitlab-repos/distro.tube/man-org/man4/" - :base-extension "org" - :publishing-directory "~/nc/gitlab-repos/distro.tube/html/man-org/man4/" - :recursive t - :publishing-function org-html-publish-to-html - :headline-levels 4 ; Just the default for this project. - :auto-preamble t) - ("man5" - :base-directory "~/nc/gitlab-repos/distro.tube/man-org/man5/" - :base-extension "org" - :publishing-directory "~/nc/gitlab-repos/distro.tube/html/man-org/man5/" - :recursive t - :publishing-function org-html-publish-to-html - :headline-levels 4 ; Just the default for this project. - :auto-preamble t) - ("man6" - :base-directory "~/nc/gitlab-repos/distro.tube/man-org/man6/" - :base-extension "org" - :publishing-directory "~/nc/gitlab-repos/distro.tube/html/man-org/man6/" - :recursive t - :publishing-function org-html-publish-to-html - :headline-levels 4 ; Just the default for this project. - :auto-preamble t) - ("man7" - :base-directory "~/nc/gitlab-repos/distro.tube/man-org/man7/" - :base-extension "org" - :publishing-directory "~/nc/gitlab-repos/distro.tube/html/man-org/man7/" - :recursive t - :publishing-function org-html-publish-to-html - :headline-levels 4 ; Just the default for this project. - :auto-preamble t) - ("man8" - :base-directory "~/nc/gitlab-repos/distro.tube/man-org/man8/" - :base-extension "org" - :publishing-directory "~/nc/gitlab-repos/distro.tube/html/man-org/man8/" - :recursive t - :publishing-function org-html-publish-to-html - :headline-levels 4 ; Just the default for this project. - :auto-preamble t) - ("org-static" - :base-directory "~/Org/website" - :base-extension "css\\|js\\|png\\|jpg\\|gif\\|pdf\\|mp3\\|ogg\\|swf" - :publishing-directory "~/public_html/" - :recursive t - :exclude ".*/org-html-themes/.*" - :publishing-function org-publish-attachment) - ("dtos.dev" - :base-directory "~/nc/gitlab-repos/dtos.dev/" - :base-extension "org" - :publishing-directory "~/nc/gitlab-repos/dtos.dev/html/" - :recursive t - :publishing-function org-html-publish-to-html - :headline-levels 4 ; Just the default for this project. - :auto-preamble t) - - )) - -(after! org - (setq org-roam-directory "~/nc/Org/roam/" - org-roam-graph-viewer "/usr/bin/brave")) - -(map! :leader - (:prefix ("n r" . "org-roam") - :desc "Completion at point" "c" #'completion-at-point - :desc "Find node" "f" #'org-roam-node-find - :desc "Show graph" "g" #'org-roam-graph - :desc "Insert node" "i" #'org-roam-node-insert - :desc "Capture to node" "n" #'org-roam-capture - :desc "Toggle roam buffer" "r" #'org-roam-buffer-toggle)) - -(use-package! password-store) - -(map! :leader - :desc "Switch to perspective NAME" "DEL" #'persp-switch - :desc "Switch to buffer in perspective" "," #'persp-switch-to-buffer - :desc "Switch to next perspective" "]" #'persp-next - :desc "Switch to previous perspective" "[" #'persp-prev - :desc "Add a buffer current perspective" "+" #'persp-add-buffer - :desc "Remove perspective by name" "-" #'persp-remove-by-name) - -(define-globalized-minor-mode global-rainbow-mode rainbow-mode - (lambda () - (when (not (memq major-mode - (list 'org-agenda-mode))) - (rainbow-mode 1)))) -(global-rainbow-mode 1 ) - -(map! :leader - (:prefix ("r" . "registers") - :desc "Copy to register" "c" #'copy-to-register - :desc "Frameset to register" "f" #'frameset-to-register - :desc "Insert contents of register" "i" #'insert-register - :desc "Jump to register" "j" #'jump-to-register - :desc "List registers" "l" #'list-registers - :desc "Number to register" "n" #'number-to-register - :desc "Interactively choose a register" "r" #'counsel-register - :desc "View a register" "v" #'view-register - :desc "Window configuration to register" "w" #'window-configuration-to-register - :desc "Increment register" "+" #'increment-register - :desc "Point to register" "SPC" #'point-to-register)) - -(setq shell-file-name "/bin/fish" - vterm-max-scrollback 5000) -(setq eshell-rc-script "~/.config/doom/eshell/profile" - eshell-aliases-file "~/.config/doom/eshell/aliases" - eshell-history-size 5000 - eshell-buffer-maximum-lines 5000 - eshell-hist-ignoredups t - eshell-scroll-to-bottom-on-input t - eshell-destroy-buffer-when-process-dies t - eshell-visual-commands'("bash" "fish" "htop" "ssh" "top" "zsh")) -(map! :leader - :desc "Eshell" "e s" #'eshell - :desc "Eshell popup toggle" "e t" #'+eshell/toggle - :desc "Counsel eshell history" "e h" #'counsel-esh-history - :desc "Vterm popup toggle" "v t" #'+vterm/toggle) - -(defun prefer-horizontal-split () - (set-variable 'split-height-threshold nil t) - (set-variable 'split-width-threshold 40 t)) ; make this as low as needed -(add-hook 'markdown-mode-hook 'prefer-horizontal-split) -(map! :leader - :desc "Clone indirect buffer other window" "b c" #'clone-indirect-buffer-other-window) - -(setq initial-buffer-choice "~/.config/doom/start.org") - -(define-minor-mode start-mode - "Provide functions for custom start page." - :lighter " start" - :keymap (let ((map (make-sparse-keymap))) - ;;(define-key map (kbd "M-z") 'eshell) - (evil-define-key 'normal start-mode-map - (kbd "1") '(lambda () (interactive) (find-file "~/.config/doom/config.org")) - (kbd "2") '(lambda () (interactive) (find-file "~/.config/doom/init.el")) - (kbd "3") '(lambda () (interactive) (find-file "~/.config/doom/packages.el")) - (kbd "4") '(lambda () (interactive) (find-file "~/.config/doom/eshell/aliases")) - (kbd "5") '(lambda () (interactive) (find-file "~/.config/doom/eshell/profile"))) - map)) - -(add-hook 'start-mode-hook 'read-only-mode) ;; make start.org read-only; use 'SPC t r' to toggle off read-only. -(provide 'start-mode) - -(map! :leader - (:prefix ("w" . "window") - :desc "Winner redo" "" #'winner-redo - :desc "Winner undo" "" #'winner-undo)) - -(map! :leader - :desc "Zap to char" "z" #'zap-to-char - :desc "Zap up to char" "Z" #'zap-up-to-char) +;; Whenever you reconfigure a package, make sure to wrap your config in an +;; `after!' block, otherwise Doom's defaults may override your settings. E.g. +;; +;; (after! PACKAGE +;; (setq x y)) +;; +;; The exceptions to this rule: +;; +;; - Setting file/directory variables (like `org-directory') +;; - Setting variables which explicitly tell you to set them before their +;; package is loaded (see 'C-h v VARIABLE' to look up their documentation). +;; - Setting doom variables (which start with 'doom-' or '+'). +;; +;; Here are some additional functions/macros that will help you configure Doom. +;; +;; - `load!' for loading external *.el files relative to this one +;; - `use-package!' for configuring packages +;; - `after!' for running code after a package has loaded +;; - `add-load-path!' for adding directories to the `load-path', relative to +;; this file. Emacs searches the `load-path' when you load packages with +;; `require' or `use-package'. +;; - `map!' for binding new keys +;; +;; To get information about any of these functions/macros, move the cursor over +;; the highlighted symbol at press 'K' (non-evil users must press 'C-c c k'). +;; This will open documentation for it, including demos of how they are used. +;; Alternatively, use `C-h o' to look up a symbol (functions, variables, faces, +;; etc). +;; +;; You can also try 'gd' (or 'C-c c d') to jump to their definition and see how +;; they are implemented. diff --git a/.config/doom/config.org b/.config/doom/config.org deleted file mode 100644 index 7ad6f82..0000000 --- a/.config/doom/config.org +++ /dev/null @@ -1,1387 +0,0 @@ -#+TITLE: DT's Doom Emacs Config -#+AUTHOR: Derek Taylor (DT) -#+DESCRIPTION: DT's personal Doom Emacs config. -#+STARTUP: showeverything - -* TABLE OF CONTENTS :toc: -- [[#about-this-config][ABOUT THIS CONFIG]] -- [[#beacon][BEACON]] -- [[#bookmarks-and-buffers][BOOKMARKS AND BUFFERS]] - - [[#bookmarks][Bookmarks]] - - [[#buffers][Buffers]] - - [[#global-auto-revert][Global Auto Revert]] - - [[#keybindings-within-ibuffer-mode][Keybindings within ibuffer mode]] -- [[#calendar][CALENDAR]] -- [[#centaur-tabs][CENTAUR-TABS]] -- [[#clippy][CLIPPY]] -- [[#dired][DIRED]] - - [[#keybindings-to-open-dired][Keybindings To Open Dired]] - - [[#keybindings-within-dired][Keybindings Within Dired]] - - [[#keybindings-within-dired-with-peep-dired-mode-enabled][Keybindings Within Dired With Peep-Dired-Mode Enabled]] - - [[#making-deleted-files-go-to-trash-can][Making deleted files go to trash can]] -- [[#doom-theme][DOOM THEME]] -- [[#ednc-notifications][EDNC (Notifications)]] -- [[#elfeed][ELFEED]] -- [[#emms][EMMS]] -- [[#emojis][EMOJIS]] -- [[#erc][ERC]] -- [[#evaluate-elisp-expressions][EVALUATE ELISP EXPRESSIONS]] -- [[#eww][EWW]] -- [[#exwm][EXWM]] -- [[#fonts][FONTS]] -- [[#imenu][IMENU]] -- [[#insert-date][INSERT DATE]] -- [[#ivy][IVY]] - - [[#ivy-posframe][IVY-POSFRAME]] - - [[#ivy-keybindings][IVY KEYBINDINGS]] -- [[#line-settings][LINE SETTINGS]] -- [[#markdown][MARKDOWN]] -- [[#minimap][MINIMAP]] -- [[#modeline][MODELINE]] -- [[#mouse-support][MOUSE SUPPORT]] -- [[#neotree][NEOTREE]] -- [[#open-specific-files][OPEN SPECIFIC FILES]] -- [[#org-mode][ORG MODE]] - - [[#org-agenda][Org-agenda]] - - [[#org-auto-tangle][Org-auto-tangle]] - - [[#org-fonts][Org fonts]] - - [[#org-export][Org-export]] - - [[#org-journal][Org-journal]] - - [[#org-publish][Org-publish]] - - [[#org-roam][Org-roam]] -- [[#password-store][PASSWORD STORE]] -- [[#perspective][PERSPECTIVE]] -- [[#rainbow-mode][RAINBOW MODE]] -- [[#registers][REGISTERS]] -- [[#shells][SHELLS]] -- [[#splits][SPLITS]] -- [[#start-page][START PAGE]] -- [[#winner-mode][WINNER MODE]] -- [[#zap-to-char][ZAP TO CHAR]] - -* ABOUT THIS CONFIG -This is my personal Doom Emacs config. Doom Emacs is a distribution of Emacs that uses the "evil" keybindings (Vim keybindings) and includes a number of nice extensions and a bit of configuration out of the box. I am maintaining this config not just for myself, but also for those that want to explore some of what is possible with Emacs. I will add a lot of examples of plugins and settings, some of them I may not even use personally. I do this because many people following me on YouTube look at my configs as "documentation". - -* BEACON -Never lose your cursor. When you scroll, your cursor will shine! This is a global minor-mode. Turn it on everywhere with: - -#+begin_src emacs-lisp -(beacon-mode 1) -#+end_src - -* BOOKMARKS AND BUFFERS -Doom Emacs uses 'SPC b' for keybindings related to bookmarks and buffers. - -** Bookmarks -Bookmarks are somewhat like registers in that they record positions you can jump to. Unlike registers, they have long names, and they persist automatically from one Emacs session to the next. The prototypical use of bookmarks is to record where you were reading in various files. - -| COMMAND | DESCRIPTION | KEYBINDING | -|-----------------+----------------------------------------+------------| -| list-bookmarks | /List bookmarks/ | SPC b L | -| bookmark-set | /Set bookmark/ | SPC b m | -| bookmark-delete | /Delete bookmark/ | SPC b M | -| bookmark-save | /Save current bookmark to bookmark file/ | SPC b w | - -#+BEGIN_SRC emacs-lisp -(setq bookmark-default-file "~/.config/doom/bookmarks") - -(map! :leader - (:prefix ("b". "buffer") - :desc "List bookmarks" "L" #'list-bookmarks - :desc "Set bookmark" "m" #'bookmark-set - :desc "Delete bookmark" "M" #'bookmark-set - :desc "Save current bookmarks to bookmark file" "w" #'bookmark-save)) -#+END_SRC - -** Buffers -Regarding /buffers/, the text you are editing in Emacs resides in an object called a /buffer/. Each time you visit a file, a buffer is used to hold the file’s text. Each time you invoke Dired, a buffer is used to hold the directory listing. /Ibuffer/ is a program that lists all of your Emacs /buffers/, allowing you to navigate between them and filter them. - -| COMMAND | DESCRIPTION | KEYBINDING | -|-----------------+----------------------+------------| -| ibuffer | /Launch ibuffer/ | SPC b i | -| kill-buffer | /Kill current buffer/ | SPC b k | -| next-buffer | /Goto next buffer/ | SPC b n | -| previous-buffer | /Goto previous buffer/ | SPC b p | -| save-buffer | /Save current buffer/ | SPC b s | - -** Global Auto Revert -A buffer can get out of sync with respect to its visited file on disk if that file is changed by another program. To keep it up to date, you can enable Auto Revert mode by typing M-x auto-revert-mode, or you can set it to be turned on globally with 'global-auto-revert-mode'. I have also turned on Global Auto Revert on non-file buffers, which is especially useful for 'dired' buffers. - -#+begin_src emacs-lisp -(global-auto-revert-mode 1) -(setq global-auto-revert-non-file-buffers t) -#+end_src - -** Keybindings within ibuffer mode -| COMMAND | DESCRIPTION | KEYBINDING | -|-----------------------------------+----------------------------------------+------------| -| ibuffer-mark-forward | /Mark the buffer/ | m | -| ibuffer-unmark-forward | /Unmark the buffer/ | u | -| ibuffer-do-kill-on-deletion-marks | /Kill the marked buffers/ | x | -| ibuffer-filter-by-content | /Ibuffer filter by content/ | f c | -| ibuffer-filter-by-directory | /Ibuffer filter by directory/ | f d | -| ibuffer-filter-by-filename | /Ibuffer filter by filename (full path)/ | f f | -| ibuffer-filter-by-mode | /Ibuffer filter by mode/ | f m | -| ibuffer-filter-by-name | /Ibuffer filter by name/ | f n | -| ibuffer-filter-disable | /Disable ibuffer filter/ | f x | -| ibuffer-do-kill-lines | /Hide marked buffers/ | g h | -| ibuffer-update | /Restore hidden buffers/ | g H | - -#+begin_src emacs-lisp -(evil-define-key 'normal ibuffer-mode-map - (kbd "f c") 'ibuffer-filter-by-content - (kbd "f d") 'ibuffer-filter-by-directory - (kbd "f f") 'ibuffer-filter-by-filename - (kbd "f m") 'ibuffer-filter-by-mode - (kbd "f n") 'ibuffer-filter-by-name - (kbd "f x") 'ibuffer-filter-disable - (kbd "g h") 'ibuffer-do-kill-lines - (kbd "g H") 'ibuffer-update) -#+end_src - -* CALENDAR -Let's make a 12-month calendar available so we can have a calendar app that, when we click on time/date in xmobar, we get a nice 12-month calendar to view. - -This is a modification of: http://homepage3.nifty.com/oatu/emacs/calendar.html -See also: https://stackoverflow.com/questions/9547912/emacs-calendar-show-more-than-3-months - -#+begin_src emacs-lisp -;; https://stackoverflow.com/questions/9547912/emacs-calendar-show-more-than-3-months -(defun dt/year-calendar (&optional year) - (interactive) - (require 'calendar) - (let* ( - (current-year (number-to-string (nth 5 (decode-time (current-time))))) - (month 0) - (year (if year year (string-to-number (format-time-string "%Y" (current-time)))))) - (switch-to-buffer (get-buffer-create calendar-buffer)) - (when (not (eq major-mode 'calendar-mode)) - (calendar-mode)) - (setq displayed-month month) - (setq displayed-year year) - (setq buffer-read-only nil) - (erase-buffer) - ;; horizontal rows - (dotimes (j 4) - ;; vertical columns - (dotimes (i 3) - (calendar-generate-month - (setq month (+ month 1)) - year - ;; indentation / spacing between months - (+ 5 (* 25 i)))) - (goto-char (point-max)) - (insert (make-string (- 10 (count-lines (point-min) (point-max))) ?\n)) - (widen) - (goto-char (point-max)) - (narrow-to-region (point-max) (point-max))) - (widen) - (goto-char (point-min)) - (setq buffer-read-only t))) - -(defun dt/scroll-year-calendar-forward (&optional arg event) - "Scroll the yearly calendar by year in a forward direction." - (interactive (list (prefix-numeric-value current-prefix-arg) - last-nonmenu-event)) - (unless arg (setq arg 0)) - (save-selected-window - (if (setq event (event-start event)) (select-window (posn-window event))) - (unless (zerop arg) - (let* ( - (year (+ displayed-year arg))) - (dt/year-calendar year))) - (goto-char (point-min)) - (run-hooks 'calendar-move-hook))) - -(defun dt/scroll-year-calendar-backward (&optional arg event) - "Scroll the yearly calendar by year in a backward direction." - (interactive (list (prefix-numeric-value current-prefix-arg) - last-nonmenu-event)) - (dt/scroll-year-calendar-forward (- (or arg 1)) event)) - -(map! :leader - :desc "Scroll year calendar backward" "" #'dt/scroll-year-calendar-backward - :desc "Scroll year calendar forward" "" #'dt/scroll-year-calendar-forward) - -(defalias 'year-calendar 'dt/year-calendar) -#+end_src - -Let's also play around with calfw. -#+begin_src emacs-lisp -(use-package! calfw) -(use-package! calfw-org) -#+end_src - -* CENTAUR-TABS -To use tabs in Doom Emacs, be sure to uncomment "tabs" in Doom's init.el. Displays tabs at the top of the window similar to tabbed web browsers such as Firefox. I don't actually use tabs in Emacs. I placed this in my config to help others who may want tabs. In the default configuration of Doom Emacs, 'SPC t' is used for "toggle" keybindings, so I choose 'SPC t c' to toggle centaur-tabs. The "g" prefix for keybindings is used for a bunch of evil keybindings in Doom, but "g" plus the arrow keys were not used, so I thought I would bind those for tab navigation. But I did leave the default "g t" and "g T" intact if you prefer to use those for centaur-tabs-forward/backward. - -| COMMAND | DESCRIPTION | KEYBINDING | -|-----------------------------+---------------------------+------------------| -| centaur-tabs-mode | /Toggle tabs globally/ | SPC t c | -| centaur-tabs-local-mode | /Toggle tabs local display/ | SPC t C | -| centaur-tabs-forward | /Next tab/ | g or g t | -| centaur-tabs-backward | /Previous tab/ | g or g T | -| centaur-tabs-forward-group | /Next tab group/ | g | -| centaur-tabs-backward-group | /Previous tab group/ | g | - -#+BEGIN_SRC emacs-lisp -(setq centaur-tabs-set-bar 'over - centaur-tabs-set-icons t - centaur-tabs-gray-out-icons 'buffer - centaur-tabs-height 24 - centaur-tabs-set-modified-marker t - centaur-tabs-style "bar" - centaur-tabs-modified-marker "•") -(map! :leader - :desc "Toggle tabs globally" "t c" #'centaur-tabs-mode - :desc "Toggle tabs local display" "t C" #'centaur-tabs-local-mode) -(evil-define-key 'normal centaur-tabs-mode-map (kbd "g ") 'centaur-tabs-forward ; default Doom binding is 'g t' - (kbd "g ") 'centaur-tabs-backward ; default Doom binding is 'g T' - (kbd "g ") 'centaur-tabs-forward-group - (kbd "g ") 'centaur-tabs-backward-group) -#+END_SRC - -* CLIPPY -Gives us a popup box with "Clippy, the paper clip". You can make him say various things by calling 'clippy-say' function. But the more useful functions of clippy are the two describe functions provided: 'clippy-describe-function' and 'clippy-describe-variable'. Hit the appropriate keybinding while the point is over a function/variable to call it. A popup with helpful clippy will appear, telling you about the function/variable (using describe-function and describe-variable respectively). - -| COMMAND | DESCRIPTION | KEYBINDING | -|--------------------------+---------------------------------------+------------| -| clippy-describe-function | /Clippy describes function under point/ | SPC c h f | -| clippy-describe-variable | /Clippy describes variable under point/ | SPC c h v | - -#+begin_src emacs-lisp -(map! :leader - (:prefix ("c h" . "Help info from Clippy") - :desc "Clippy describes function under point" "f" #'clippy-describe-function - :desc "Clippy describes variable under point" "v" #'clippy-describe-variable)) - -#+end_src - -* DIRED -Dired is the file manager within Emacs. Below, I setup keybindings for image previews (peep-dired). Doom Emacs does not use 'SPC d' for any of its keybindings, so I've chosen the format of 'SPC d' plus 'key'. - -** Keybindings To Open Dired - -| COMMAND | DESCRIPTION | KEYBINDING | -|------------+------------------------------------+------------| -| dired | /Open dired file manager/ | SPC d d | -| dired-jump | /Jump to current directory in dired/ | SPC d j | - -** Keybindings Within Dired -*** Basic dired commands - -| COMMAND | DESCRIPTION | KEYBINDING | -|------------------------+---------------------------------------------+------------| -| dired-view-file | /View file in dired/ | SPC d v | -| dired-up-directory | /Go up in directory tree/ | h | -| dired-find-file | /Go down in directory tree (or open if file)/ | l | -| dired-next-line | /Move down to next line/ | j | -| dired-previous-line | /Move up to previous line/ | k | -| dired-mark | /Mark file at point/ | m | -| dired-unmark | /Unmark file at point/ | u | -| dired-do-copy | /Copy current file or marked files/ | C | -| dired-do-rename | /Rename current file or marked files/ | R | -| dired-hide-details | /Toggle detailed listings on/off/ | ( | -| dired-git-info-mode | /Toggle git information on/off/ | ) | -| dired-create-directory | /Create new empty directory/ | + | -| dired-diff | /Compare file at point with another/ | = | -| dired-subtree-toggle | /Toggle viewing subtree at point/ | TAB | - -*** Dired commands using regex - -| COMMAND | DESCRIPTION | KEYBINDING | -|-------------------------+----------------------------+------------| -| dired-mark-files-regexp | /Mark files using regex/ | % m | -| dired-do-copy-regexp | /Copy files using regex/ | % C | -| dired-do-rename-regexp | /Rename files using regex/ | % R | -| dired-mark-files-regexp | /Mark all files using regex/ | * % | - -*** File permissions and ownership - -| COMMAND | DESCRIPTION | KEYBINDING | -|-----------------+----------------------------------+------------| -| dired-do-chgrp | /Change the group of marked files/ | g G | -| dired-do-chmod | /Change the mode of marked files/ | M | -| dired-do-chown | /Change the owner of marked files/ | O | -| dired-do-rename | /Rename file or all marked files/ | R | - -#+begin_src emacs-lisp -(map! :leader - (:prefix ("d" . "dired") - :desc "Open dired" "d" #'dired - :desc "Dired jump to current" "j" #'dired-jump) - (:after dired - (:map dired-mode-map - :desc "Peep-dired image previews" "d p" #'peep-dired - :desc "Dired view file" "d v" #'dired-view-file))) - -(evil-define-key 'normal dired-mode-map - (kbd "M-RET") 'dired-display-file - (kbd "h") 'dired-up-directory - (kbd "l") 'dired-open-file ; use dired-find-file instead of dired-open. - (kbd "m") 'dired-mark - (kbd "t") 'dired-toggle-marks - (kbd "u") 'dired-unmark - (kbd "C") 'dired-do-copy - (kbd "D") 'dired-do-delete - (kbd "J") 'dired-goto-file - (kbd "M") 'dired-do-chmod - (kbd "O") 'dired-do-chown - (kbd "P") 'dired-do-print - (kbd "R") 'dired-do-rename - (kbd "T") 'dired-do-touch - (kbd "Y") 'dired-copy-filenamecopy-filename-as-kill ; copies filename to kill ring. - (kbd "Z") 'dired-do-compress - (kbd "+") 'dired-create-directory - (kbd "-") 'dired-do-kill-lines - (kbd "% l") 'dired-downcase - (kbd "% m") 'dired-mark-files-regexp - (kbd "% u") 'dired-upcase - (kbd "* %") 'dired-mark-files-regexp - (kbd "* .") 'dired-mark-extension - (kbd "* /") 'dired-mark-directories - (kbd "; d") 'epa-dired-do-decrypt - (kbd "; e") 'epa-dired-do-encrypt) -;; Get file icons in dired -(add-hook 'dired-mode-hook 'all-the-icons-dired-mode) -;; With dired-open plugin, you can launch external programs for certain extensions -;; For example, I set all .png files to open in 'sxiv' and all .mp4 files to open in 'mpv' -(setq dired-open-extensions '(("gif" . "sxiv") - ("jpg" . "sxiv") - ("png" . "sxiv") - ("mkv" . "mpv") - ("mp4" . "mpv"))) -#+end_src - -** Keybindings Within Dired With Peep-Dired-Mode Enabled -If peep-dired is enabled, you will get image previews as you go up/down with 'j' and 'k' - -| COMMAND | DESCRIPTION | KEYBINDING | -|----------------------+------------------------------------------+------------| -| peep-dired | /Toggle previews within dired/ | SPC d p | -| peep-dired-next-file | /Move to next file in peep-dired-mode/ | j | -| peep-dired-prev-file | /Move to previous file in peep-dired-mode/ | k | - -#+BEGIN_SRC emacs-lisp -(evil-define-key 'normal peep-dired-mode-map - (kbd "j") 'peep-dired-next-file - (kbd "k") 'peep-dired-prev-file) -(add-hook 'peep-dired-hook 'evil-normalize-keymaps) -#+END_SRC - -** Making deleted files go to trash can -#+begin_src emacs-lisp -(setq delete-by-moving-to-trash t - trash-directory "~/.local/share/Trash/files/") -#+end_src - -=NOTE=: For convenience, you may want to create a symlink to 'local/share/Trash' in your home directory: -#+begin_example -cd ~/ -ln -s ~/.local/share/Trash . -#+end_example - -* DOOM THEME -Setting the theme to doom-one. To try out new themes, I set a keybinding for counsel-load-theme with 'SPC h t'. - -#+BEGIN_SRC emacs-lisp -(setq doom-theme 'doom-one) -(map! :leader - :desc "Load new theme" "h t" #'counsel-load-theme) -#+END_SRC - -* EDNC (Notifications) -The Emacs Desktop Notification Center (EDNC) is an Emacs package written in pure Lisp that implements a desktop notifications service according to the freedesktop.org specification. EDNC aspires to be a small, but flexible drop-in replacement of standalone daemons like dunst. - -=NOTE=: Ensure that no other notification daemon (such as dunst) is active to use EDNC. - -#+begin_src emacs-lisp -(ednc-mode 1) - -(defun show-notification-in-buffer (old new) - (let ((name (format "Notification %d" (ednc-notification-id (or old new))))) - (with-current-buffer (get-buffer-create name) - (if new (let ((inhibit-read-only t)) - (if old (erase-buffer) (ednc-view-mode)) - (insert (ednc-format-notification new t)) - (pop-to-buffer (current-buffer))) - (kill-buffer))))) - -(add-hook 'ednc-notification-presentation-functions - #'show-notification-in-buffer) - -(evil-define-key 'normal ednc-view-mode-map - (kbd "d") 'ednc-dismiss-notification - (kbd "RET") 'ednc-invoke-action - (kbd "e") 'ednc-toggle-expanded-view) -#+end_src - -* ELFEED -An RSS newsfeed reader for Emacs. - -#+BEGIN_SRC emacs-lisp -(setq elfeed-goodies/entry-pane-size 0.5) - -(evil-define-key 'normal elfeed-show-mode-map - (kbd "J") 'elfeed-goodies/split-show-next - (kbd "K") 'elfeed-goodies/split-show-prev) -(evil-define-key 'normal elfeed-search-mode-map - (kbd "J") 'elfeed-goodies/split-show-next - (kbd "K") 'elfeed-goodies/split-show-prev) -(setq elfeed-feeds (quote - (("https://www.reddit.com/r/linux.rss" reddit linux) - ("https://www.reddit.com/r/commandline.rss" reddit commandline) - ("https://www.reddit.com/r/distrotube.rss" reddit distrotube) - ("https://www.reddit.com/r/emacs.rss" reddit emacs) - ("https://www.gamingonlinux.com/article_rss.php" gaming linux) - ("https://hackaday.com/blog/feed/" hackaday linux) - ("https://opensource.com/feed" opensource linux) - ("https://linux.softpedia.com/backend.xml" softpedia linux) - ("https://itsfoss.com/feed/" itsfoss linux) - ("https://www.zdnet.com/topic/linux/rss.xml" zdnet linux) - ("https://www.phoronix.com/rss.php" phoronix linux) - ("http://feeds.feedburner.com/d0od" omgubuntu linux) - ("https://www.computerworld.com/index.rss" computerworld linux) - ("https://www.networkworld.com/category/linux/index.rss" networkworld linux) - ("https://www.techrepublic.com/rssfeeds/topic/open-source/" techrepublic linux) - ("https://betanews.com/feed" betanews linux) - ("http://lxer.com/module/newswire/headlines.rss" lxer linux)))) -#+END_SRC - -* EMMS -One of the media players available for Emacs is emms, which stands for Emacs Multimedia System. By default, Doom Emacs does not use 'SPC a',' so the format I use for these bindings is 'SPC a' plus 'key'. - -| COMMAND | DESCRIPTION | KEYBINDING | -|-----------------------+-----------------------------------+------------| -| emms-playlist-mode-go | /Switch to the playlist buffer/ | SPC a a | -| emms-pause | /Pause the track/ | SPC a x | -| emms-stop | /Stop the track/ | SPC a s | -| emms-previous | /Play previous track in playlist/ | SPC a p | -| emms-next | /Play next track in playlist/ | SPC a n | - -#+BEGIN_SRC emacs-lisp -(emms-all) -(emms-default-players) -(emms-mode-line 1) -(emms-playing-time 1) -(setq emms-source-file-default-directory "~/Music/" - emms-playlist-buffer-name "*Music*" - emms-info-asynchronously t - emms-source-file-directory-tree-function 'emms-source-file-directory-tree-find) -(map! :leader - (:prefix ("a" . "EMMS audio player") - :desc "Go to emms playlist" "a" #'emms-playlist-mode-go - :desc "Emms pause track" "x" #'emms-pause - :desc "Emms stop track" "s" #'emms-stop - :desc "Emms play previous track" "p" #'emms-previous - :desc "Emms play next track" "n" #'emms-next)) -#+END_SRC - -* EMOJIS -Emojify is an Emacs extension to display emojis. It can display github style emojis like :smile: or plain ascii ones like :). - -#+begin_src emacs-lisp -(use-package emojify - :hook (after-init . global-emojify-mode)) -#+end_src - -* ERC -ERC is a built-in Emacs IRC client. - -| COMMAND | DESCRIPTION | KEYBINDING | -|---------+---------------------------------------------+------------| -| erc-tls | /Launch ERC using more secure TLS connection/ | SPC e E | - -#+begin_src emacs-lisp -(map! :leader - (:prefix ("e". "evaluate/ERC/EWW") - :desc "Launch ERC with TLS connection" "E" #'erc-tls)) - -(setq erc-prompt (lambda () (concat "[" (buffer-name) "]")) - erc-server "irc.libera.chat" - erc-nick "distrotube" - erc-user-full-name "Derek Taylor" - erc-track-shorten-start 24 - erc-autojoin-channels-alist '(("irc.libera.chat" "#archlinux" "#linux" "#emacs")) - erc-kill-buffer-on-part t - erc-fill-column 100 - erc-fill-function 'erc-fill-static - erc-fill-static-center 20 - ;; erc-auto-query 'bury - ) -#+end_src - -* EVALUATE ELISP EXPRESSIONS -Changing some keybindings from their defaults to better fit with Doom Emacs, and to avoid conflicts with my window managers which sometimes use the control key in their keybindings. By default, Doom Emacs does not use 'SPC e' for anything, so I choose to use the format 'SPC e' plus 'key' for these (I also use 'SPC e' for 'eww' keybindings). - -| COMMAND | DESCRIPTION | KEYBINDING | -|-----------------+----------------------------------------------+------------| -| eval-buffer | /Evaluate elisp in buffer/ | SPC e b | -| eval-defun | /Evaluate the defun containing or after point/ | SPC e d | -| eval-expression | /Evaluate an elisp expression/ | SPC e e | -| eval-last-sexp | /Evaluate elisp expression before point/ | SPC e l | -| eval-region | /Evaluate elisp in region/ | SPC e r | - -#+Begin_src emacs-lisp -(map! :leader - (:prefix ("e". "evaluate/ERC/EWW") - :desc "Evaluate elisp in buffer" "b" #'eval-buffer - :desc "Evaluate defun" "d" #'eval-defun - :desc "Evaluate elisp expression" "e" #'eval-expression - :desc "Evaluate last sexpression" "l" #'eval-last-sexp - :desc "Evaluate elisp in region" "r" #'eval-region)) -#+END_SRC - -* EWW -EWW is the Emacs Web Wowser, the builtin browser in Emacs. Below I set urls to open in a specific browser (eww) with browse-url-browser-function. By default, Doom Emacs does not use 'SPC e' for anything, so I choose to use the format 'SPC e' plus 'key' for these (I also use 'SPC e' for 'eval' keybindings). I chose to use 'SPC s w' for eww-search-words because Doom Emacs uses 'SPC s' for 'search' commands. - -#+BEGIN_SRC emacs-lisp -(setq browse-url-browser-function 'eww-browse-url) -(map! :leader - :desc "Search web for text between BEG/END" - "s w" #'eww-search-words - (:prefix ("e" . "evaluate/ERC/EWW") - :desc "Eww web browser" "w" #'eww - :desc "Eww reload page" "R" #'eww-reload)) -#+END_SRC - -* EXWM -#+begin_src emacs-lisp -(autoload 'exwm-enable "exwm-config.el") -#+end_src - -* FONTS -Settings related to fonts within Doom Emacs: -+ 'doom-font' -- standard monospace font that is used for most things in Emacs. -+ 'doom-variable-pitch-font' -- variable font which is useful in some Emacs plugins. -+ 'doom-big-font' -- used in doom-big-font-mode; useful for presentations. -+ 'font-lock-comment-face' -- for comments. -+ 'font-lock-keyword-face' -- for keywords with special significance like 'setq' in elisp. - -#+BEGIN_SRC emacs-lisp -(setq doom-font (font-spec :family "JetBrains Mono" :size 15) - doom-variable-pitch-font (font-spec :family "Ubuntu" :size 15) - doom-big-font (font-spec :family "JetBrains Mono" :size 24)) -(after! doom-themes - (setq doom-themes-enable-bold t - doom-themes-enable-italic t)) -(custom-set-faces! - '(font-lock-comment-face :slant italic) - '(font-lock-keyword-face :slant italic)) -#+END_SRC - -* IMENU -Imenu produces menus for accessing locations in documents, typically in the current buffer. You can access the locations using an ordinary menu (menu bar or other) or using minibuffer completion, or you can install 'imenu-list' and have the imenu displayed as a vertical split that you can toggle show/hide. - -| COMMAND | DESCRIPTION | KEYBINDING | -|-------------------------+----------------------------------+------------| -| counsel-imenu | /Menu to jump to places in buffer/ | SPC s i | -| imenu-list-smart-toggle | /Toggle imenu shown in a sidebar/ | SPC t i | - -#+BEGIN_SRC emacs-lisp -(setq imenu-list-focus-after-activation t) - -(map! :leader - (:prefix ("s" . "Search") - :desc "Menu to jump to places in buffer" "i" #'counsel-imenu)) - -(map! :leader - (:prefix ("t" . "Toggle") - :desc "Toggle imenu shown in a sidebar" "i" #'imenu-list-smart-toggle)) - -#+END_SRC - -* INSERT DATE -Some custom functions to insert the date. The function 'insert-todays-date' can be used one of three different ways: (1) just the keybinding without the universal argument prefix, (2) with one universal argument prefix, or (3) with two universal argument prefixes. The universal argument prefix is 'SPC-u' in Doom Emacs (C-u in standard GNU Emacs). The function 'insert-any-date' only outputs to one format, which is the same format as 'insert-todays-date' without a prefix. - -| COMMAND | EXAMPLE OUTPUT | KEYBINDING | -|-----------------------+---------------------------+-----------------------| -| dt/insert-todays-date | /Friday, November 19, 2021/ | SPC i d t | -| dt/insert-todays-date | /11-19-2021/ | SPC u SPC i d t | -| dt/insert-todays-date | /2021-11-19/ | SPC u SPC u SPC i d t | -| dt/insert-any-date | /Friday, November 19, 2021/ | SPC i d a | - -#+begin_src emacs-lisp -(defun dt/insert-todays-date (prefix) - (interactive "P") - (let ((format (cond - ((not prefix) "%A, %B %d, %Y") - ((equal prefix '(4)) "%m-%d-%Y") - ((equal prefix '(16)) "%Y-%m-%d")))) - (insert (format-time-string format)))) - -(require 'calendar) -(defun dt/insert-any-date (date) - "Insert DATE using the current locale." - (interactive (list (calendar-read-date))) - (insert (calendar-date-string date))) - -(map! :leader - (:prefix ("i d" . "Insert date") - :desc "Insert any date" "a" #'dt/insert-any-date - :desc "Insert todays date" "t" #'dt/insert-todays-date)) -#+end_src - -* IVY -Ivy is a generic completion mechanism for Emacs. - -** IVY-POSFRAME -Ivy-posframe is an ivy extension, which lets ivy use posframe to show its candidate menu. Some of the settings below involve: -+ ivy-posframe-display-functions-alist -- sets the display position for specific programs -+ ivy-posframe-height-alist -- sets the height of the list displayed for specific programs - -Available functions (positions) for 'ivy-posframe-display-functions-alist' -+ ivy-posframe-display-at-frame-center -+ ivy-posframe-display-at-window-center -+ ivy-posframe-display-at-frame-bottom-left -+ ivy-posframe-display-at-window-bottom-left -+ ivy-posframe-display-at-frame-bottom-window-center -+ ivy-posframe-display-at-point -+ ivy-posframe-display-at-frame-top-center - -=NOTE:= If the setting for 'ivy-posframe-display' is set to 'nil' (false), anything that is set to 'ivy-display-function-fallback' will just default to their normal position in Doom Emacs (usually a bottom split). However, if this is set to 't' (true), then the fallback position will be centered in the window. - -#+BEGIN_SRC emacs-lisp -(setq ivy-posframe-display-functions-alist - '((swiper . ivy-posframe-display-at-point) - (complete-symbol . ivy-posframe-display-at-point) - (counsel-M-x . ivy-display-function-fallback) - (counsel-esh-history . ivy-posframe-display-at-window-center) - (counsel-describe-function . ivy-display-function-fallback) - (counsel-describe-variable . ivy-display-function-fallback) - (counsel-find-file . ivy-display-function-fallback) - (counsel-recentf . ivy-display-function-fallback) - (counsel-register . ivy-posframe-display-at-frame-bottom-window-center) - (dmenu . ivy-posframe-display-at-frame-top-center) - (nil . ivy-posframe-display)) - ivy-posframe-height-alist - '((swiper . 20) - (dmenu . 20) - (t . 10))) -(ivy-posframe-mode 1) ; 1 enables posframe-mode, 0 disables it. -#+END_SRC - -** IVY KEYBINDINGS -By default, Doom Emacs does not use 'SPC v', so the format I use for these bindings is 'SPC v' plus 'key'. - -#+BEGIN_SRC emacs-lisp -(map! :leader - (:prefix ("v" . "Ivy") - :desc "Ivy push view" "v p" #'ivy-push-view - :desc "Ivy switch view" "v s" #'ivy-switch-view)) -#+END_SRC - -* LINE SETTINGS -I set comment-line to 'SPC TAB TAB' which is a rather comfortable keybinding for me on my ZSA Moonlander keyboard. The standard Emacs keybinding for comment-line is 'C-x C-;'. The other keybindings are for commands that toggle on/off various line-related settings. Doom Emacs uses 'SPC t' for "toggle" commands, so I choose 'SPC t' plus 'key' for those bindings. - -| COMMAND | DESCRIPTION | KEYBINDING | -|--------------------------+-------------------------------------------+-------------| -| comment-line | /Comment or uncomment lines/ | SPC TAB TAB | -| hl-line-mode | /Toggle line highlighting in current frame/ | SPC t h | -| global-hl-line-mode | /Toggle line highlighting globally/ | SPC t H | -| doom/toggle-line-numbers | /Toggle line numbers/ | SPC t l | -| toggle-truncate-lines | /Toggle truncate lines/ | SPC t t | - -#+BEGIN_SRC emacs-lisp -(setq display-line-numbers-type t) -(map! :leader - :desc "Comment or uncomment lines" "TAB TAB" #'comment-line - (:prefix ("t" . "toggle") - :desc "Toggle line numbers" "l" #'doom/toggle-line-numbers - :desc "Toggle line highlight in frame" "h" #'hl-line-mode - :desc "Toggle line highlight globally" "H" #'global-hl-line-mode - :desc "Toggle truncate lines" "t" #'toggle-truncate-lines)) -#+END_SRC - -* MARKDOWN - -#+begin_src emacs-lisp -(custom-set-faces - '(markdown-header-face ((t (:inherit font-lock-function-name-face :weight bold :family "variable-pitch")))) - '(markdown-header-face-1 ((t (:inherit markdown-header-face :height 1.7)))) - '(markdown-header-face-2 ((t (:inherit markdown-header-face :height 1.6)))) - '(markdown-header-face-3 ((t (:inherit markdown-header-face :height 1.5)))) - '(markdown-header-face-4 ((t (:inherit markdown-header-face :height 1.4)))) - '(markdown-header-face-5 ((t (:inherit markdown-header-face :height 1.3)))) - '(markdown-header-face-6 ((t (:inherit markdown-header-face :height 1.2))))) - -#+end_src - -* MINIMAP -A minimap sidebar displaying a smaller version of the current buffer on either the left or right side. It highlights the currently shown region and updates its position automatically. Be aware that this minimap program does not work in Org documents. This is not unusual though because I have tried several minimap programs and none of them can handle Org. - -| COMMAND | DESCRIPTION | KEYBINDING | -|--------------+-------------------------------------------+------------| -| minimap-mode | /Toggle minimap-mode/ | SPC t m | - -#+begin_src emacs-lisp -(setq minimap-window-location 'right) -(map! :leader - (:prefix ("t" . "toggle") - :desc "Toggle minimap-mode" "m" #'minimap-mode)) -#+end_src - -* MODELINE -The modeline is the bottom status bar that appears in Emacs windows. For more information on what is available to configure in the Doom modeline, check out: -https://github.com/seagle0128/doom-modeline - -#+begin_src emacs-lisp -(set-face-attribute 'mode-line nil :font "Ubuntu Mono-13") -(setq doom-modeline-height 30 ;; sets modeline height - doom-modeline-bar-width 5 ;; sets right bar width - doom-modeline-persp-name t ;; adds perspective name to modeline - doom-modeline-persp-icon t) ;; adds folder icon next to persp name -#+end_src - -* MOUSE SUPPORT -Adding mouse support in the terminal version of Emacs. - -#+begin_src emacs-lisp -(xterm-mouse-mode 1) -#+end_src - -* NEOTREE -Neotree is a file tree viewer. When you open neotree, it jumps to the current file thanks to neo-smart-open. The neo-window-fixed-size setting makes the neotree width be adjustable. Doom Emacs had no keybindings set for neotree. Since Doom Emacs uses 'SPC t' for 'toggle' keybindings, I used 'SPC t n' for toggle-neotree. - -| COMMAND | DESCRIPTION | KEYBINDING | -|----------------+---------------------------+------------| -| neotree-toggle | /Toggle neotree/ | SPC t n | -| neotree- dir | /Open directory in neotree/ | SPC d n | - -#+BEGIN_SRC emacs-lisp -(after! neotree - (setq neo-smart-open t - neo-window-fixed-size nil)) -(after! doom-themes - (setq doom-neotree-enable-variable-pitch t)) -(map! :leader - :desc "Toggle neotree file viewer" "t n" #'neotree-toggle - :desc "Open directory in neotree" "d n" #'neotree-dir) -#+END_SRC - -* OPEN SPECIFIC FILES -Keybindings to open files that I work with all the time using the find-file command, which is the interactive file search that opens with 'C-x C-f' in GNU Emacs or 'SPC f f' in Doom Emacs. These keybindings use find-file non-interactively since we specify exactly what file to open. The format I use for these bindings is 'SPC =' plus 'key' since Doom Emacs does not use 'SPC ='. - -=NOTE=: Doom Emacs already has a function 'doom/open-private-config' set to the keybinding 'SPC f p'. This allows you to open any file in your HOME/.config/doom directory, so the following keybindings that I created are not really necessary, but I created this section as an example of how to to create bindings that open specific files on your system. - -| PATH TO FILE | DESCRIPTION | KEYBINDING | -|-------------------------------+-----------------------------+------------| -| ~/.config/doom/start.org | /Edit start.org (start page)/ | SPC = = | -| ~/nc/Org/agenda.org | /Edit agenda file/ | SPC = a | -| ~/.config/doom/config.org | /Edit doom config.org/ | SPC = c | -| ~/.config/doom/init.el | /Edit doom init.el/ | SPC = i | -| ~/.config/doom/packages.el | /Edit doom packages.el/ | SPC = p | -| ~/.config/doom/eshell/aliases | /Edit eshell aliases/ | SPC = e a | -| ~/.config/doom/eshell/profile | /Edit eshell profile/ | SPC = e p | - -#+BEGIN_SRC emacs-lisp -(map! :leader - (:prefix ("=" . "open file") - :desc "Edit agenda file" "=" #'(lambda () (interactive) (find-file "~/.config/doom/start.org")) - :desc "Edit agenda file" "a" #'(lambda () (interactive) (find-file "~/nc/Org/agenda.org")) - :desc "Edit doom config.org" "c" #'(lambda () (interactive) (find-file "~/.config/doom/config.org")) - :desc "Edit doom init.el" "i" #'(lambda () (interactive) (find-file "~/.config/doom/init.el")) - :desc "Edit doom packages.el" "p" #'(lambda () (interactive) (find-file "~/.config/doom/packages.el")))) -(map! :leader - (:prefix ("= e" . "open eshell files") - :desc "Edit eshell aliases" "a" #'(lambda () (interactive) (find-file "~/.config/doom/eshell/aliases")) - :desc "Edit eshell profile" "p" #'(lambda () (interactive) (find-file "~/.config/doom/eshell/profile")))) -#+END_SRC - -* ORG MODE -I wrapped most of this block in (after! org). Without this, my settings might be evaluated too early, which will result in my settings being overwritten by Doom's defaults. I have also enabled org-journal, org-superstar and org-roam by adding (+journal +pretty +roam2) to the org section of my Doom Emacs init.el. - -=NOTE=: I have the location of my Org directory and Roam directory in $HOME/nc/ which is a Nextcloud folder that allows me to instantly sync all of my Org work between my home computer and my office computer. - -#+BEGIN_SRC emacs-lisp -(map! :leader - :desc "Org babel tangle" "m B" #'org-babel-tangle) -(after! org - (setq org-directory "~/nc/Org/" - org-default-notes-file (expand-file-name "notes.org" org-directory) - org-ellipsis " ▼ " - org-superstar-headline-bullets-list '("◉" "●" "○" "◆" "●" "○" "◆") - org-superstar-itembullet-alist '((?+ . ?➤) (?- . ?✦)) ; changes +/- symbols in item lists - org-log-done 'time - org-hide-emphasis-markers t - ;; ex. of org-link-abbrev-alist in action - ;; [[arch-wiki:Name_of_Page][Description]] - org-link-abbrev-alist ; This overwrites the default Doom org-link-abbrev-list - '(("google" . "http://www.google.com/search?q=") - ("arch-wiki" . "https://wiki.archlinux.org/index.php/") - ("ddg" . "https://duckduckgo.com/?q=") - ("wiki" . "https://en.wikipedia.org/wiki/")) - org-table-convert-region-max-lines 20000 - org-todo-keywords ; This overwrites the default Doom org-todo-keywords - '((sequence - "TODO(t)" ; A task that is ready to be tackled - "BLOG(b)" ; Blog writing assignments - "GYM(g)" ; Things to accomplish at the gym - "PROJ(p)" ; A project that contains other tasks - "VIDEO(v)" ; Video assignments - "WAIT(w)" ; Something is holding up this task - "|" ; The pipe necessary to separate "active" states and "inactive" states - "DONE(d)" ; Task has been completed - "CANCELLED(c)" )))) ; Task has been cancelled -#+END_SRC - -** Org-agenda -#+begin_src emacs-lisp -(after! org - (setq org-agenda-files '("~/nc/Org/agenda.org"))) - -(setq - ;; org-fancy-priorities-list '("[A]" "[B]" "[C]") - ;; org-fancy-priorities-list '("❗" "[B]" "[C]") - org-fancy-priorities-list '("🟥" "🟧" "🟨") - org-priority-faces - '((?A :foreground "#ff6c6b" :weight bold) - (?B :foreground "#98be65" :weight bold) - (?C :foreground "#c678dd" :weight bold)) - org-agenda-block-separator 8411) - -(setq org-agenda-custom-commands - '(("v" "A better agenda view" - ((tags "PRIORITY=\"A\"" - ((org-agenda-skip-function '(org-agenda-skip-entry-if 'todo 'done)) - (org-agenda-overriding-header "High-priority unfinished tasks:"))) - (tags "PRIORITY=\"B\"" - ((org-agenda-skip-function '(org-agenda-skip-entry-if 'todo 'done)) - (org-agenda-overriding-header "Medium-priority unfinished tasks:"))) - (tags "PRIORITY=\"C\"" - ((org-agenda-skip-function '(org-agenda-skip-entry-if 'todo 'done)) - (org-agenda-overriding-header "Low-priority unfinished tasks:"))) - (tags "customtag" - ((org-agenda-skip-function '(org-agenda-skip-entry-if 'todo 'done)) - (org-agenda-overriding-header "Tasks marked with customtag:"))) - - (agenda "") - (alltodo ""))))) -#+end_src - -** Org-auto-tangle -=org-auto-tangle= allows you to add the option =#+auto_tangle: t= in your Org file so that it automatically tangles when you save the document. I have made adding this to your file even easier by creating a function 'dt/insert-auto-tangle-tag' and setting it to a keybinding 'SPC i a'. - -#+begin_src emacs-lisp -(use-package! org-auto-tangle - :defer t - :hook (org-mode . org-auto-tangle-mode) - :config - (setq org-auto-tangle-default t)) - -(defun dt/insert-auto-tangle-tag () - "Insert auto-tangle tag in a literate config." - (interactive) - (evil-org-open-below 1) - (insert "#+auto_tangle: t ") - (evil-force-normal-state)) - -(map! :leader - :desc "Insert auto_tangle tag" "i a" #'dt/insert-auto-tangle-tag) -#+end_src - -** Org fonts -I have created an interactive function for each color scheme (M-x dt/org-colors-*). These functions will set appropriate colors and font attributes for org-level fonts and the org-table font. - -#+begin_src emacs-lisp -(defun dt/org-colors-doom-one () - "Enable Doom One colors for Org headers." - (interactive) - (dolist - (face - '((org-level-1 1.7 "#51afef" ultra-bold) - (org-level-2 1.6 "#c678dd" extra-bold) - (org-level-3 1.5 "#98be65" bold) - (org-level-4 1.4 "#da8548" semi-bold) - (org-level-5 1.3 "#5699af" normal) - (org-level-6 1.2 "#a9a1e1" normal) - (org-level-7 1.1 "#46d9ff" normal) - (org-level-8 1.0 "#ff6c6b" normal))) - (set-face-attribute (nth 0 face) nil :font doom-variable-pitch-font :weight (nth 3 face) :height (nth 1 face) :foreground (nth 2 face))) - (set-face-attribute 'org-table nil :font doom-font :weight 'normal :height 1.0 :foreground "#bfafdf")) - -(defun dt/org-colors-dracula () - "Enable Dracula colors for Org headers." - (interactive) - (dolist - (face - '((org-level-1 1.7 "#8be9fd" ultra-bold) - (org-level-2 1.6 "#bd93f9" extra-bold) - (org-level-3 1.5 "#50fa7b" bold) - (org-level-4 1.4 "#ff79c6" semi-bold) - (org-level-5 1.3 "#9aedfe" normal) - (org-level-6 1.2 "#caa9fa" normal) - (org-level-7 1.1 "#5af78e" normal) - (org-level-8 1.0 "#ff92d0" normal))) - (set-face-attribute (nth 0 face) nil :font doom-variable-pitch-font :weight (nth 3 face) :height (nth 1 face) :foreground (nth 2 face))) - (set-face-attribute 'org-table nil :font doom-font :weight 'normal :height 1.0 :foreground "#bfafdf")) - -(defun dt/org-colors-gruvbox-dark () - "Enable Gruvbox Dark colors for Org headers." - (interactive) - (dolist - (face - '((org-level-1 1.7 "#458588" ultra-bold) - (org-level-2 1.6 "#b16286" extra-bold) - (org-level-3 1.5 "#98971a" bold) - (org-level-4 1.4 "#fb4934" semi-bold) - (org-level-5 1.3 "#83a598" normal) - (org-level-6 1.2 "#d3869b" normal) - (org-level-7 1.1 "#d79921" normal) - (org-level-8 1.0 "#8ec07c" normal))) - (set-face-attribute (nth 0 face) nil :font doom-variable-pitch-font :weight (nth 3 face) :height (nth 1 face) :foreground (nth 2 face))) - (set-face-attribute 'org-table nil :font doom-font :weight 'normal :height 1.0 :foreground "#bfafdf")) - -(defun dt/org-colors-monokai-pro () - "Enable Monokai Pro colors for Org headers." - (interactive) - (dolist - (face - '((org-level-1 1.7 "#78dce8" ultra-bold) - (org-level-2 1.6 "#ab9df2" extra-bold) - (org-level-3 1.5 "#a9dc76" bold) - (org-level-4 1.4 "#fc9867" semi-bold) - (org-level-5 1.3 "#ff6188" normal) - (org-level-6 1.2 "#ffd866" normal) - (org-level-7 1.1 "#78dce8" normal) - (org-level-8 1.0 "#ab9df2" normal))) - (set-face-attribute (nth 0 face) nil :font doom-variable-pitch-font :weight (nth 3 face) :height (nth 1 face) :foreground (nth 2 face))) - (set-face-attribute 'org-table nil :font doom-font :weight 'normal :height 1.0 :foreground "#bfafdf")) - -(defun dt/org-colors-nord () - "Enable Nord colors for Org headers." - (interactive) - (dolist - (face - '((org-level-1 1.7 "#81a1c1" ultra-bold) - (org-level-2 1.6 "#b48ead" extra-bold) - (org-level-3 1.5 "#a3be8c" bold) - (org-level-4 1.4 "#ebcb8b" semi-bold) - (org-level-5 1.3 "#bf616a" normal) - (org-level-6 1.2 "#88c0d0" normal) - (org-level-7 1.1 "#81a1c1" normal) - (org-level-8 1.0 "#b48ead" normal))) - (set-face-attribute (nth 0 face) nil :font doom-variable-pitch-font :weight (nth 3 face) :height (nth 1 face) :foreground (nth 2 face))) - (set-face-attribute 'org-table nil :font doom-font :weight 'normal :height 1.0 :foreground "#bfafdf")) - -(defun dt/org-colors-oceanic-next () - "Enable Oceanic Next colors for Org headers." - (interactive) - (dolist - (face - '((org-level-1 1.7 "#6699cc" ultra-bold) - (org-level-2 1.6 "#c594c5" extra-bold) - (org-level-3 1.5 "#99c794" bold) - (org-level-4 1.4 "#fac863" semi-bold) - (org-level-5 1.3 "#5fb3b3" normal) - (org-level-6 1.2 "#ec5f67" normal) - (org-level-7 1.1 "#6699cc" normal) - (org-level-8 1.0 "#c594c5" normal))) - (set-face-attribute (nth 0 face) nil :font doom-variable-pitch-font :weight (nth 3 face) :height (nth 1 face) :foreground (nth 2 face))) - (set-face-attribute 'org-table nil :font doom-font :weight 'normal :height 1.0 :foreground "#bfafdf")) - -(defun dt/org-colors-palenight () - "Enable Palenight colors for Org headers." - (interactive) - (dolist - (face - '((org-level-1 1.7 "#82aaff" ultra-bold) - (org-level-2 1.6 "#c792ea" extra-bold) - (org-level-3 1.5 "#c3e88d" bold) - (org-level-4 1.4 "#ffcb6b" semi-bold) - (org-level-5 1.3 "#a3f7ff" normal) - (org-level-6 1.2 "#e1acff" normal) - (org-level-7 1.1 "#f07178" normal) - (org-level-8 1.0 "#ddffa7" normal))) - (set-face-attribute (nth 0 face) nil :font doom-variable-pitch-font :weight (nth 3 face) :height (nth 1 face) :foreground (nth 2 face))) - (set-face-attribute 'org-table nil :font doom-font :weight 'normal :height 1.0 :foreground "#bfafdf")) - -(defun dt/org-colors-solarized-dark () - "Enable Solarized Dark colors for Org headers." - (interactive) - (dolist - (face - '((org-level-1 1.7 "#268bd2" ultra-bold) - (org-level-2 1.6 "#d33682" extra-bold) - (org-level-3 1.5 "#859900" bold) - (org-level-4 1.4 "#b58900" semi-bold) - (org-level-5 1.3 "#cb4b16" normal) - (org-level-6 1.2 "#6c71c4" normal) - (org-level-7 1.1 "#2aa198" normal) - (org-level-8 1.0 "#657b83" normal))) - (set-face-attribute (nth 0 face) nil :font doom-variable-pitch-font :weight (nth 3 face) :height (nth 1 face) :foreground (nth 2 face))) - (set-face-attribute 'org-table nil :font doom-font :weight 'normal :height 1.0 :foreground "#bfafdf")) - -(defun dt/org-colors-solarized-light () - "Enable Solarized Light colors for Org headers." - (interactive) - (dolist - (face - '((org-level-1 1.7 "#268bd2" ultra-bold) - (org-level-2 1.6 "#d33682" extra-bold) - (org-level-3 1.5 "#859900" bold) - (org-level-4 1.4 "#b58900" semi-bold) - (org-level-5 1.3 "#cb4b16" normal) - (org-level-6 1.2 "#6c71c4" normal) - (org-level-7 1.1 "#2aa198" normal) - (org-level-8 1.0 "#657b83" normal))) - (set-face-attribute (nth 0 face) nil :font doom-variable-pitch-font :weight (nth 3 face) :height (nth 1 face) :foreground (nth 2 face))) - (set-face-attribute 'org-table nil :font doom-font :weight 'normal :height 1.0 :foreground "#bfafdf")) - -(defun dt/org-colors-tomorrow-night () - "Enable Tomorrow Night colors for Org headers." - (interactive) - (dolist - (face - '((org-level-1 1.7 "#81a2be" ultra-bold) - (org-level-2 1.6 "#b294bb" extra-bold) - (org-level-3 1.5 "#b5bd68" bold) - (org-level-4 1.4 "#e6c547" semi-bold) - (org-level-5 1.3 "#cc6666" normal) - (org-level-6 1.2 "#70c0ba" normal) - (org-level-7 1.1 "#b77ee0" normal) - (org-level-8 1.0 "#9ec400" normal))) - (set-face-attribute (nth 0 face) nil :font doom-variable-pitch-font :weight (nth 3 face) :height (nth 1 face) :foreground (nth 2 face))) - (set-face-attribute 'org-table nil :font doom-font :weight 'normal :height 1.0 :foreground "#bfafdf")) - -;; Load our desired dt/org-colors-* theme on startup -(dt/org-colors-doom-one) -#+end_src - -** Org-export -We need ox-man for "Org eXporting" to manpage format and ox-gemini for exporting to gemtext (for the gemini protocol). - -=NOTE=: I also enable ox-publish for converting an Org site into an HTML site, but that is done in init.el (org +publish). - -#+BEGIN_SRC emacs-lisp -(use-package ox-man) -(use-package ox-gemini) -#+END_SRC - -** Org-journal -#+begin_src emacs-lisp -(setq org-journal-dir "~/nc/Org/journal/" - org-journal-date-prefix "* " - org-journal-time-prefix "** " - org-journal-date-format "%B %d, %Y (%A) " - org-journal-file-format "%Y-%m-%d.org") -#+end_src - -** Org-publish -#+begin_src emacs-lisp -(setq org-publish-use-timestamps-flag nil) -(setq org-export-with-broken-links t) -(setq org-publish-project-alist - '(("distro.tube without manpages" - :base-directory "~/nc/gitlab-repos/distro.tube/" - :base-extension "org" - :publishing-directory "~/nc/gitlab-repos/distro.tube/html/" - :recursive t - :exclude "org-html-themes/.*\\|man-org/man*" - :publishing-function org-html-publish-to-html - :headline-levels 4 ; Just the default for this project. - :auto-preamble t) - ("man0p" - :base-directory "~/nc/gitlab-repos/distro.tube/man-org/man0p/" - :base-extension "org" - :publishing-directory "~/nc/gitlab-repos/distro.tube/html/man-org/man0p/" - :recursive t - :publishing-function org-html-publish-to-html - :headline-levels 4 ; Just the default for this project. - :auto-preamble t) - ("man1" - :base-directory "~/nc/gitlab-repos/distro.tube/man-org/man1/" - :base-extension "org" - :publishing-directory "~/nc/gitlab-repos/distro.tube/html/man-org/man1/" - :recursive t - :publishing-function org-html-publish-to-html - :headline-levels 4 ; Just the default for this project. - :auto-preamble t) - ("man1p" - :base-directory "~/nc/gitlab-repos/distro.tube/man-org/man1p/" - :base-extension "org" - :publishing-directory "~/nc/gitlab-repos/distro.tube/html/man-org/man1p/" - :recursive t - :publishing-function org-html-publish-to-html - :headline-levels 4 ; Just the default for this project. - :auto-preamble t) - ("man2" - :base-directory "~/nc/gitlab-repos/distro.tube/man-org/man2/" - :base-extension "org" - :publishing-directory "~/nc/gitlab-repos/distro.tube/html/man-org/man2/" - :recursive t - :publishing-function org-html-publish-to-html - :headline-levels 4 ; Just the default for this project. - :auto-preamble t) - ("man3" - :base-directory "~/nc/gitlab-repos/distro.tube/man-org/man3/" - :base-extension "org" - :publishing-directory "~/nc/gitlab-repos/distro.tube/html/man-org/man3/" - :recursive t - :publishing-function org-html-publish-to-html - :headline-levels 4 ; Just the default for this project. - :auto-preamble t) - ("man3p" - :base-directory "~/nc/gitlab-repos/distro.tube/man-org/man3p/" - :base-extension "org" - :publishing-directory "~/nc/gitlab-repos/distro.tube/html/man-org/man3p/" - :recursive t - :publishing-function org-html-publish-to-html - :headline-levels 4 ; Just the default for this project. - :auto-preamble t) - ("man4" - :base-directory "~/nc/gitlab-repos/distro.tube/man-org/man4/" - :base-extension "org" - :publishing-directory "~/nc/gitlab-repos/distro.tube/html/man-org/man4/" - :recursive t - :publishing-function org-html-publish-to-html - :headline-levels 4 ; Just the default for this project. - :auto-preamble t) - ("man5" - :base-directory "~/nc/gitlab-repos/distro.tube/man-org/man5/" - :base-extension "org" - :publishing-directory "~/nc/gitlab-repos/distro.tube/html/man-org/man5/" - :recursive t - :publishing-function org-html-publish-to-html - :headline-levels 4 ; Just the default for this project. - :auto-preamble t) - ("man6" - :base-directory "~/nc/gitlab-repos/distro.tube/man-org/man6/" - :base-extension "org" - :publishing-directory "~/nc/gitlab-repos/distro.tube/html/man-org/man6/" - :recursive t - :publishing-function org-html-publish-to-html - :headline-levels 4 ; Just the default for this project. - :auto-preamble t) - ("man7" - :base-directory "~/nc/gitlab-repos/distro.tube/man-org/man7/" - :base-extension "org" - :publishing-directory "~/nc/gitlab-repos/distro.tube/html/man-org/man7/" - :recursive t - :publishing-function org-html-publish-to-html - :headline-levels 4 ; Just the default for this project. - :auto-preamble t) - ("man8" - :base-directory "~/nc/gitlab-repos/distro.tube/man-org/man8/" - :base-extension "org" - :publishing-directory "~/nc/gitlab-repos/distro.tube/html/man-org/man8/" - :recursive t - :publishing-function org-html-publish-to-html - :headline-levels 4 ; Just the default for this project. - :auto-preamble t) - ("org-static" - :base-directory "~/Org/website" - :base-extension "css\\|js\\|png\\|jpg\\|gif\\|pdf\\|mp3\\|ogg\\|swf" - :publishing-directory "~/public_html/" - :recursive t - :exclude ".*/org-html-themes/.*" - :publishing-function org-publish-attachment) - ("dtos.dev" - :base-directory "~/nc/gitlab-repos/dtos.dev/" - :base-extension "org" - :publishing-directory "~/nc/gitlab-repos/dtos.dev/html/" - :recursive t - :publishing-function org-html-publish-to-html - :headline-levels 4 ; Just the default for this project. - :auto-preamble t) - - )) -#+end_src - -** Org-roam -[[https://github.com/org-roam/org-roam][Org-roam]] is a plain-text knowledge management system. Org-roam borrows principles from the =Zettelkasten= method, providing a solution for non-hierarchical note-taking. It should also work as a plug-and-play solution for anyone already using Org-mode for their personal wiki. - -| COMMAND | DESCRIPTION | KEYBINDING | -|------------------------+------------------------------------+------------| -| completion-at-point | /Completion of node-insert at point/ | SPC n r c | -| org-roam-node-find | /Find node or create a new one/ | SPC n r f | -| org-roam-graph | /Show graph of all nodes/ | SPC n r g | -| org-roam-node-insert | /Insert link to a node/ | SPC n r i | -| org-roam-capture | /Capture to node/ | SPC n r n | -| org-roam-buffer-toggle | /Toggle roam buffer/ | SPC n r r | - -#+begin_src emacs-lisp -(after! org - (setq org-roam-directory "~/nc/Org/roam/" - org-roam-graph-viewer "/usr/bin/brave")) - -(map! :leader - (:prefix ("n r" . "org-roam") - :desc "Completion at point" "c" #'completion-at-point - :desc "Find node" "f" #'org-roam-node-find - :desc "Show graph" "g" #'org-roam-graph - :desc "Insert node" "i" #'org-roam-node-insert - :desc "Capture to node" "n" #'org-roam-capture - :desc "Toggle roam buffer" "r" #'org-roam-buffer-toggle)) -#+end_src - -* PASSWORD STORE -Uses the standard Unix password store "pass". - -#+begin_src emacs-lisp -(use-package! password-store) -#+end_src - -* PERSPECTIVE -Perspective provides multiple named workspaces (or "perspectives") in Emacs, similar to having multiple desktops in window managers like Awesome and XMonad. Each perspective has its own buffer list and its own window layout, making it easy to work on many separate projects without getting lost in all the buffers. Switching to a perspective activates its window configuration, and when in a perspective, only its buffers are available (by default). Doom Emacs uses 'SPC some_key' for binding some of the perspective commands, so I used this binging format for the perspective bindings that I created.. - -| COMMAND | DESCRIPTION | KEYBINDING | -|----------------------------+-------------------------------------+------------| -| persp-switch | /Switch to perspective NAME/ | SPC DEL | -| persp-switch-to-buffer | /Switch to buffer in perspective/ | SPC , | -| persp-next | /Switch to next perspective/ | SPC ] | -| persp-prev | /Switch to previous perspective/ | SPC [ | -| persp-add-buffer | /Add a buffer to current perspective/ | SPC + | -| persp-remove-by-name | /Remove perspective by name/ | SPC - | -| +workspace/switch-to-{0-9} | /Switch to workspace n/ | SPC 0-9 | - -#+begin_src emacs-lisp -(map! :leader - :desc "Switch to perspective NAME" "DEL" #'persp-switch - :desc "Switch to buffer in perspective" "," #'persp-switch-to-buffer - :desc "Switch to next perspective" "]" #'persp-next - :desc "Switch to previous perspective" "[" #'persp-prev - :desc "Add a buffer current perspective" "+" #'persp-add-buffer - :desc "Remove perspective by name" "-" #'persp-remove-by-name) -#+end_src - -* RAINBOW MODE -Rainbox mode displays the actual color for any hex value color. It's such a nice feature that I wanted it turned on all the time, regardless of what mode I am in. The following creates a global minor mode for rainbow-mode and enables it (exception: org-agenda-mode since rainbow-mode destroys all highlighting in org-agenda). - -#+begin_src emacs-lisp -(define-globalized-minor-mode global-rainbow-mode rainbow-mode - (lambda () - (when (not (memq major-mode - (list 'org-agenda-mode))) - (rainbow-mode 1)))) -(global-rainbow-mode 1 ) -#+end_src - -* REGISTERS -Emacs registers are compartments where you can save text, rectangles and positions for later use. Once you save text or a rectangle in a register, you can copy it into the buffer once or many times; once you save a position in a register, you can jump back to that position once or many times. The default GNU Emacs keybindings for these commands (with the exception of counsel-register) involves 'C-x r' followed by one or more other keys. I wanted to make this a little more user friendly, and since I am using Doom Emacs, I choose to replace the 'C-x r' part of the key chords with 'SPC r'. - -| COMMAND | DESCRIPTION | KEYBINDING | -|----------------------------------+----------------------------------+------------| -| copy-to-register | /Copy to register/ | SPC r c | -| frameset-to-register | /Frameset to register/ | SPC r f | -| insert-register | /Insert contents of register/ | SPC r i | -| jump-to-register | /Jump to register/ | SPC r j | -| list-registers | /List registers/ | SPC r l | -| number-to-register | /Number to register/ | SPC r n | -| counsel-register | /Interactively choose a register/ | SPC r r | -| view-register | /View a register/ | SPC r v | -| window-configuration-to-register | /Window configuration to register/ | SPC r w | -| increment-register | /Increment register/ | SPC r + | -| point-to-register | /Point to register/ | SPC r SPC | - -#+BEGIN_SRC emacs-lisp -(map! :leader - (:prefix ("r" . "registers") - :desc "Copy to register" "c" #'copy-to-register - :desc "Frameset to register" "f" #'frameset-to-register - :desc "Insert contents of register" "i" #'insert-register - :desc "Jump to register" "j" #'jump-to-register - :desc "List registers" "l" #'list-registers - :desc "Number to register" "n" #'number-to-register - :desc "Interactively choose a register" "r" #'counsel-register - :desc "View a register" "v" #'view-register - :desc "Window configuration to register" "w" #'window-configuration-to-register - :desc "Increment register" "+" #'increment-register - :desc "Point to register" "SPC" #'point-to-register)) -#+END_SRC - -* SHELLS -Settings for the various shells and terminal emulators within Emacs. - -| COMMAND | DESCRIPTION | KEYBINDING | -|---------------------+----------------------------+------------| -| eshell | /Launch the eshell/ | SPC e s | -| +eshell/toggle | /Toggle eshell popup window/ | SPC e t | -| counsel-esh-history | /Browse the eshell history/ | SPC e h | -| +vterm/toggle | /Toggle vterm popup window/ | SPC v t | - -#+BEGIN_SRC emacs-lisp -(setq shell-file-name "/bin/fish" - vterm-max-scrollback 5000) -(setq eshell-rc-script "~/.config/doom/eshell/profile" - eshell-aliases-file "~/.config/doom/eshell/aliases" - eshell-history-size 5000 - eshell-buffer-maximum-lines 5000 - eshell-hist-ignoredups t - eshell-scroll-to-bottom-on-input t - eshell-destroy-buffer-when-process-dies t - eshell-visual-commands'("bash" "fish" "htop" "ssh" "top" "zsh")) -(map! :leader - :desc "Eshell" "e s" #'eshell - :desc "Eshell popup toggle" "e t" #'+eshell/toggle - :desc "Counsel eshell history" "e h" #'counsel-esh-history - :desc "Vterm popup toggle" "v t" #'+vterm/toggle) -#+END_SRC - -* SPLITS -I set splits to default to opening on the right using 'prefer-horizontal-split'. I set a keybinding for 'clone-indirect-buffer-other-window' for when I want to have the same document in two splits. The text of the indirect buffer is always identical to the text of its base buffer; changes made by editing either one are visible immediately in the other. But in all other respects, the indirect buffer and its base buffer are completely separate. For example, I can fold one split but other will be unfolded. - -#+BEGIN_SRC emacs-lisp -(defun prefer-horizontal-split () - (set-variable 'split-height-threshold nil t) - (set-variable 'split-width-threshold 40 t)) ; make this as low as needed -(add-hook 'markdown-mode-hook 'prefer-horizontal-split) -(map! :leader - :desc "Clone indirect buffer other window" "b c" #'clone-indirect-buffer-other-window) -#+END_SRC - -* START PAGE -Instead of using Doom's Dashboard or the Emacs Dashboard program, I have decided to just set an custom start file as my "dashboard" since it allows me more customization options. I have added to the 'start-mode-hook' the argument 'read-only-mode'. This is to prevent accidental editing of the start file, and to prevent clashes with the 'start-mode' specific keybindings. You can toggle on/off read-only-mode with 'SPC t r'. - -#+begin_src emacs-lisp -(setq initial-buffer-choice "~/.config/doom/start.org") - -(define-minor-mode start-mode - "Provide functions for custom start page." - :lighter " start" - :keymap (let ((map (make-sparse-keymap))) - ;;(define-key map (kbd "M-z") 'eshell) - (evil-define-key 'normal start-mode-map - (kbd "1") '(lambda () (interactive) (find-file "~/.config/doom/config.org")) - (kbd "2") '(lambda () (interactive) (find-file "~/.config/doom/init.el")) - (kbd "3") '(lambda () (interactive) (find-file "~/.config/doom/packages.el")) - (kbd "4") '(lambda () (interactive) (find-file "~/.config/doom/eshell/aliases")) - (kbd "5") '(lambda () (interactive) (find-file "~/.config/doom/eshell/profile"))) - map)) - -(add-hook 'start-mode-hook 'read-only-mode) ;; make start.org read-only; use 'SPC t r' to toggle off read-only. -(provide 'start-mode) -#+end_src - -* WINNER MODE -Winner mode has been included with GNU Emacs since version 20. This is a global minor mode and, when activated, it allows you to “undo” (and “redo”) changes in the window configuration with the key commands 'SCP w ' and 'SPC w '. - -#+BEGIN_SRC emacs-lisp -(map! :leader - (:prefix ("w" . "window") - :desc "Winner redo" "" #'winner-redo - :desc "Winner undo" "" #'winner-undo)) -#+END_SRC - -* ZAP TO CHAR -Emacs provides a 'zap-to-char' command that kills from the current point to a character. It is bound to 'M-z' in standard GNU Emacs but since Doom Emacs uses 'SPC' as its leader key and does not have 'SPC z' binded to anything, it just makes since to use it for 'zap-to-char'. Note that 'zap-to-char' can be used with the universal argument 'SPC u' to modify its behavior. Examples of 'zap-to-char' usage are listed in the table below: - -| KEYBINDING | WHAT IS DOES | -|---------------------------+------------------------------------------------------------| -| SPC z e | /deletes all chars to the next occurrence of 'e'/ | -| SPC u 2 SPC z e | /deletes all chars to the second occurrence of 'e'/ | -| SPC u - SPC z e | /deletes all chars to the previous occurrence of 'e'/ | -| SPC u - 2 SPC z e | /deletes all chars to the second previous occurrence of 'e'/ | -| SPC u 1 0 0 SPC u SPC z e | /deletes all chars to the 100th occurrence of 'e'/ | - -=TIP=: The universal argument (SPC u) can only take a single integer by default. If you need to use a multi-digit number (like 100 in the last example in the table above), then you must terminate the universal argument with another 'SPC u' after typing the number. - -'zap-up-to-char' is an alternative command that does not zap the char specified. It is binded to 'SPC Z'. It can also be used in conjunction with the universal argument 'SPC u' in similar fashion to the the 'zap-to-char' examples above. - -=NOTE=: Vim (evil mode) has similar functionality builtin. You can delete to the next occurrence of 'e' by using 'dte' in normal. To delete to the next occurrence of 'e' including the 'e', then you would use 'dfe'. And you can modify 'dt' and 'df' by prefixing them with numbers, so '2dte' would delete to the second occurrence of 'e'. - -#+BEGIN_SRC emacs-lisp -(map! :leader - :desc "Zap to char" "z" #'zap-to-char - :desc "Zap up to char" "Z" #'zap-up-to-char) -#+END_SRC diff --git a/.config/doom/eshell/aliases b/.config/doom/eshell/aliases deleted file mode 100644 index ba389dc..0000000 --- a/.config/doom/eshell/aliases +++ /dev/null @@ -1,29 +0,0 @@ -# Aliases for emacs commands -alias ff find-file $1 - -# Aliasing standard shell commands to better emacs alternatives -alias less view-file $1 - -# Changing "ls" to "exa" -alias ls exa -al --color=always --group-directories-first $* # my preferred listing -alias la exa -a --color=always --group-directories-first $* # all files and dirs -alias ll exa -l --color=always --group-directories-first $* # long format -alias lt exa -aT --color=always --group-directories-first $* # tree listing -alias l. exa -a1 $* | grep "^\." # list hidden files - -# Merge Xresources -alias merge xrdb -merge ~/.Xresources - -# Aliases for doom emacs utilties -alias doomsync ~/.emacs.d/bin/doom sync -alias doomdoctor ~/.emacs.d/bin/doom doctor -alias doomupgrade ~/.emacs.d/bin/doom upgrade -alias doompurge ~/.emacs.d/bin/doom purge - -# Confirm before overwriting something -alias cp cp -i $1 -alias mv mv -i $1 -alias rm rm -i $1 - -# Bare git repo alias for dotfiles -alias config /usr/bin/git --git-dir=$HOME/dotfiles --work-tree=$HOME $* diff --git a/.config/doom/eshell/profile b/.config/doom/eshell/profile deleted file mode 100644 index 3c871d6..0000000 --- a/.config/doom/eshell/profile +++ /dev/null @@ -1 +0,0 @@ -colorscript random \ No newline at end of file diff --git a/.config/doom/images/doom-emacs-dash.png b/.config/doom/images/doom-emacs-dash.png deleted file mode 100644 index 53141ee..0000000 Binary files a/.config/doom/images/doom-emacs-dash.png and /dev/null differ diff --git a/.config/doom/images/emacs-dash.png b/.config/doom/images/emacs-dash.png deleted file mode 100644 index 931758f..0000000 Binary files a/.config/doom/images/emacs-dash.png and /dev/null differ diff --git a/.config/doom/images/emacs-start-page.png b/.config/doom/images/emacs-start-page.png deleted file mode 100644 index 8e6441e..0000000 Binary files a/.config/doom/images/emacs-start-page.png and /dev/null differ diff --git a/.config/doom/init.el b/.config/doom/init.el index 938818c..6110eb0 100644 --- a/.config/doom/init.el +++ b/.config/doom/init.el @@ -4,8 +4,8 @@ ;; in. Remember to run 'doom sync' after modifying it! ;; NOTE Press 'SPC h d h' (or 'C-h d h' for non-vim users) to access Doom's -;; documentation. There you'll find a "Module Index" link where you'll find -;; a comprehensive list of Doom's modules and what flags they support. +;; documentation. There you'll find a link to Doom's Module Index where all +;; of our modules are listed, including what flags they support. ;; NOTE Move your cursor over a module's name (or its flags) and press 'K' (or ;; 'C-c c k' for non-vim users) to view its documentation. This works on @@ -15,41 +15,43 @@ ;; directory (for easy access to its source code). (doom! :input + ;;bidi ; (tfel ot) thgir etirw uoy gnipleh ;;chinese ;;japanese ;;layout ; auie,ctsrnm is the superior home row :completion - company ; the ultimate code completion backend + ;;company ; the ultimate code completion backend + (corfu +orderless) ; complete with cap(f), cape and a flying feather! ;;helm ; the *other* search engine for love and life ;;ido ; the other *other* search engine... - (ivy +fonts +childframe) ; a search engine for love and life + ;;ivy ; a search engine for love and life + vertico ; the search engine of the future :ui ;;deft ; notational velocity for Emacs doom ; what makes DOOM look the way it does - ;;doom-dashboard ; a nifty splash screen for Emacs - doom-quit ; DOOM quit-message prompts when you quit Emacs - (emoji +unicode) ; 🙂 - ;;fill-column ; a `fill-column' indicator + doom-dashboard ; a nifty splash screen for Emacs + ;;doom-quit ; DOOM quit-message prompts when you quit Emacs + ;;(emoji +unicode) ; 🙂 hl-todo ; highlight TODO/FIXME/NOTE/DEPRECATED/HACK/REVIEW - ;;hydra ;;indent-guides ; highlighted indent columns - (ligatures +extras) ; ligatures and symbols to make your code pretty again + ;;ligatures ; ligatures and symbols to make your code pretty again ;;minimap ; show a map of the code on the side modeline ; snazzy, Atom-inspired modeline, plus API ;;nav-flash ; blink cursor line after big motions - neotree ; a project drawer, like NERDTree for vim + ;;neotree ; a project drawer, like NERDTree for vim ophints ; highlight the region an operation acts on (popup +defaults) ; tame sudden yet inevitable temporary windows + ;;smooth-scroll ; So smooth you won't believe it's not butter ;;tabs ; a tab bar for Emacs - ;;treemacs ; a project drawer, like neotree but cooler + treemacs ; a project drawer, like neotree but cooler ;;unicode ; extended unicode support for various languages - vc-gutter ; vcs diff in the fringe + (vc-gutter +pretty) ; vcs diff in the fringe vi-tilde-fringe ; fringe tildes to mark beyond EOB ;;window-select ; visually switch windows workspaces ; tab emulation, persistence & separate workspaces - zen ; distraction-free coding or writing + ;;zen ; distraction-free coding or writing :editor (evil +everywhere); come to the dark side, we have cookies @@ -66,52 +68,54 @@ ;;word-wrap ; soft wrapping with language-aware indent :emacs - (dired +icons) ; making dired pretty [functional] + dired ; making dired pretty [functional] electric ; smarter, keyword-based electric-indent - (ibuffer +icons) ; interactive buffer management + eww ; the internet is gross + ibuffer ; interactive buffer management undo ; persistent, smarter undo for your inevitable mistakes vc ; version-control and Emacs, sitting in a tree :term eshell ; the elisp shell that works everywhere - shell ; simple shell REPL for Emacs - term ; basic terminal emulator for Emacs + ;;shell ; simple shell REPL for Emacs + ;;term ; basic terminal emulator for Emacs vterm ; the best terminal emulation in Emacs :checkers syntax ; tasing you for every semicolon you forget - (spell +aspell) ; tasing you for misspelling mispelling + ;;(spell +flyspell) ; tasing you for misspelling mispelling ;;grammar ; tasing grammar mistake every you make :tools ;;ansible + ;;biblio ; Writes a PhD for you (citation needed) + ;;collab ; buffers with friends ;;debugger ; FIXME stepping through code, to help you add bugs ;;direnv ;;docker ;;editorconfig ; let someone else argue about tabs vs spaces ;;ein ; tame Jupyter notebooks with emacs (eval +overlay) ; run code, run (also, repls) - ;;gist ; interacting with github gists lookup ; navigate your code and its documentation - ;;lsp + ;;llm ; when I said you needed friends, I didn't mean... + ;;lsp ; M-x vscode magit ; a git porcelain for Emacs ;;make ; run make tasks from Emacs ;;pass ; password manager for nerds pdf ; pdf enhancements - ;;prodigy ; FIXME managing external services & code builders - ;;rgb ; creating color strings - ;;taskrunner ; taskrunner for all your projects ;;terraform ; infrastructure as code ;;tmux ; an API for interacting with tmux + ;;tree-sitter ; syntax and parsing, sitting in a tree... ;;upload ; map local to remote projects via ssh/ftp :os - ;;(:if IS-MAC macos) ; improve compatibility with macOS - tty ; improve the terminal Emacs experience + (:if (featurep :system 'macos) macos) ; improve compatibility with macOS + ;;tty ; improve the terminal Emacs experience :lang ;;agda ; types of types of types of types... - ;;cc ; C/C++/Obj-C madness + ;;beancount ; mind the GAAP + ;;(cc +lsp) ; C > C++ == 1 ;;clojure ; java with a lisp ;;common-lisp ; if you've seen one lisp, you've seen them all ;;coq ; proofs-as-programs @@ -119,62 +123,63 @@ ;;csharp ; unity, .NET, and mono shenanigans ;;data ; config/data formats ;;(dart +flutter) ; paint ui and not much else + ;;dhall ;;elixir ; erlang done right ;;elm ; care for a cup of TEA? emacs-lisp ; drown in parentheses ;;erlang ; an elegant language for a more civilized age ;;ess ; emacs speaks statistics + ;;factor ;;faust ; dsp, but you get to keep your soul + ;;fortran ; in FORTRAN, GOD is REAL (unless declared INTEGER) ;;fsharp ; ML stands for Microsoft's Language ;;fstar ; (dependent) types and (monadic) effects and Z3 ;;gdscript ; the language you waited for ;;(go +lsp) ; the hipster dialect - (haskell +dante) ; a language that's lazier than I am + ;;(graphql +lsp) ; Give queries a REST + (haskell +lsp) ; a language that's lazier than I am ;;hy ; readability of scheme w/ speed of python ;;idris ; a language you can depend on - json ; At least it ain't XML - ;;(java +meghanada) ; the poster child for carpal tunnel syndrome - javascript ; all(hope(abandon(ye(who(enter(here)))))) + ;;json ; At least it ain't XML + ;;janet ; Fun fact: Janet is me! + ;;(java +lsp) ; the poster child for carpal tunnel syndrome + ;;javascript ; all(hope(abandon(ye(who(enter(here)))))) ;;julia ; a better, faster MATLAB ;;kotlin ; a better, slicker Java(Script) - latex ; writing papers in Emacs has never been so fun - ;;lean - ;;factor - ;;ledger ; an accounting system in Emacs - lua ; one-based indices? one-based indices + ;;latex ; writing papers in Emacs has never been so fun + ;;lean ; for folks with too much to prove + ;;ledger ; be audit you can be + ;;lua ; one-based indices? one-based indices markdown ; writing docs for people to ignore ;;nim ; python + lisp at the speed of c ;;nix ; I hereby declare "nix geht mehr!" ;;ocaml ; an objective camel - (org - +journal ; enable org journal - +roam2 ; create a personal wiki - +pretty ; replace asterisks with pretty org bullets - +publish) ; create static websites with org - php ; perl's insecure younger brother + org ; organize your plain life in plain text + ;;php ; perl's insecure younger brother ;;plantuml ; diagrams for confusing people more + ;;graphviz ; diagrams for confusing yourself even more ;;purescript ; javascript, but functional - python ; beautiful is better than ugly + python ; beautiful is better than ugly ;;qt ; the 'cutest' gui framework ever ;;racket ; a DSL for DSLs ;;raku ; the artist formerly known as perl6 ;;rest ; Emacs as a REST client ;;rst ; ReST in peace ;;(ruby +rails) ; 1.step {|i| p "Ruby is #{i.even? ? 'love' : 'life'}"} - rust ; Fe2O3.unwrap().unwrap().unwrap().unwrap() + ;;(rust +lsp) ; Fe2O3.unwrap().unwrap().unwrap().unwrap() ;;scala ; java, but good - ;;scheme ; a fully conniving family of lisps - sh ; she sells {ba,z,fi}sh shells on the C xor + ;;(scheme +guile) ; a fully conniving family of lisps + sh ; she sells {ba,z,fi}sh shells on the C xor ;;sml ;;solidity ; do you need a blockchain? No. ;;swift ; who asked for emoji variables? ;;terra ; Earth and Moon in alignment for performance. - web ; the tubes - yaml ; JSON, but readable + ;;web ; the tubes + ;;yaml ; JSON, but readable + ;;zig ; C, but simpler :email - ;;mu4e - ;;smtpmail + ;;(mu4e +org +gmail) ;;notmuch ;;(wanderlust +gmail) @@ -183,9 +188,8 @@ emms ;;everywhere ; *leave* Emacs!? You must be joking ;;irc ; how neckbeards socialize - rss ; emacs as an RSS reader - ;;twitter ; twitter client https://twitter.com/vnought + (rss +org) ; emacs as an RSS reader :config - literate + ;;literate (default +bindings +smartparens)) diff --git a/.config/doom/packages.el b/.config/doom/packages.el index 9e00b28..b09ecb5 100644 --- a/.config/doom/packages.el +++ b/.config/doom/packages.el @@ -3,83 +3,49 @@ ;; To install a package with Doom you must declare them here and run 'doom sync' ;; on the command line, then restart Emacs for the changes to take effect -- or -;; use 'M-x doom/reload'. ;; To install SOME-PACKAGE from MELPA, ELPA or emacsmirror: -;(package! some-package) +;; (package! some-package) ;; To install a package directly from a remote git repo, you must specify a ;; `:recipe'. You'll find documentation on what `:recipe' accepts here: -;; https://github.com/raxod502/straight.el#the-recipe-format -;(package! another-package -; :recipe (:host github :repo "username/repo")) +;; https://github.com/radian-software/straight.el#the-recipe-format +;; (package! another-package +;; :recipe (:host github :repo "username/repo")) ;; If the package you are trying to install does not contain a PACKAGENAME.el ;; file, or is located in a subdirectory of the repo, you'll need to specify ;; `:files' in the `:recipe': -;(package! this-package -; :recipe (:host github :repo "username/repo" -; :files ("some-file.el" "src/lisp/*.el"))) +;; (package! this-package +;; :recipe (:host github :repo "username/repo" +;; :files ("some-file.el" "src/lisp/*.el"))) ;; If you'd like to disable a package included with Doom, you can do so here ;; with the `:disable' property: -;(package! builtin-package :disable t) +;; (package! builtin-package :disable t) ;; You can override the recipe of a built in package without having to specify ;; all the properties for `:recipe'. These will inherit the rest of its recipe ;; from Doom or MELPA/ELPA/Emacsmirror: -;(package! builtin-package :recipe (:nonrecursive t)) -;(package! builtin-package-2 :recipe (:repo "myfork/package")) +;; (package! builtin-package :recipe (:nonrecursive t)) +;; (package! builtin-package-2 :recipe (:repo "myfork/package")) ;; Specify a `:branch' to install a package from a particular branch or tag. ;; This is required for some packages whose default branch isn't 'master' (which -;; our package manager can't deal with; see raxod502/straight.el#279) -;(package! builtin-package :recipe (:branch "develop")) +;; our package manager can't deal with; see radian-software/straight.el#279) +;; (package! builtin-package :recipe (:branch "develop")) ;; Use `:pin' to specify a particular commit to install. -;(package! builtin-package :pin "1a2b3c4d5e") +;; (package! builtin-package :pin "1a2b3c4d5e") ;; Doom's packages are pinned to a specific commit and updated from release to ;; release. The `unpin!' macro allows you to unpin single packages... -;(unpin! pinned-package) +;; (unpin! pinned-package) ;; ...or multiple packages -;(unpin! pinned-package another-pinned-package) +;; (unpin! pinned-package another-pinned-package) ;; ...Or *all* packages (NOT RECOMMENDED; will likely break things) -;(unpin! t) +;; (unpin! t) -;; (package! gitconfig-mode -;; :recipe (:host github :repo "magit/git-modes" -;; :files ("gitconfig-mode.el"))) -;; (package! gitignore-mode -;; :recipe (:host github :repo "magit/git-modes" -;; :files ("gitignore-mode.el"))) -(package! flycheck-aspell) -(package! calfw) -(package! calfw-org) -;;(package! dashboard) -(package! dired-open) -(package! dired-subtree) -(package! dirvish) -(package! dmenu) -(package! ednc) -(package! emojify) -(package! evil-tutor) -(package! exwm) -(package! imenu-list) -(package! ivy-posframe) -(package! mw-thesaurus) -(package! org-auto-tangle) -(package! org-web-tools) -(package! ox-gemini) -(package! peep-dired) -(package! password-store) -(package! rainbow-mode) -(package! resize-window) (package! tldr) -(package! wc-mode) -(package! beacon) -(package! clippy) -(package! minimap) -(package! olivetti) diff --git a/.config/doom/start.org b/.config/doom/start.org deleted file mode 100644 index be79fb1..0000000 --- a/.config/doom/start.org +++ /dev/null @@ -1,45 +0,0 @@ -#+STARTUP: inlineimages - -[[file:./images/emacs-start-page.png]] - -⦿ *IMPORTANT KEYBINDINGS* -|------------+---------------------+------------------------------------| -| M-x | [[elisp:(counsel-M-x)][counsel-M-x]] | Prompt for Emacs programs | -| SPC . | [[elisp:(counsel-find-file)][counsel-find-file]] | Find a file | -| SPC f r | [[elisp:(counsel-recentf)][counsel-recentf]] | Find a recent file | -| SPC d d | [[elisp:(dired (getenv "HOME"))][dired]] | Dired file manager | -| SPC h r r | [[elisp:(doom/reload)][doom/reload]] | Reload Doom Emacs | -| SPC f u | [[elisp:(doom/sudo-find-file nil)][doom/sudo-find-file]] | Find file and open as root | -| SPC f U | /doom/sudo-this-file/ | Open current file as root | -| SPC e t | [[elisp:(+eshell/toggle nil)][+eshell/toggle]] | Toggle the eshell | -| SPC v t | [[elisp:(+vterm/toggle nil)][+vterm/toggle]] | Toggle the vterm terminal emulator | -|------------+---------------------+------------------------------------| - -⦿ *BUFFERS AND SPLITS* -|------------------------------+------------------------------+-----------------------------| -| (SPC b i) [[elisp:(ibuffer)][ibuffer]] | (SPC b p) [[elisp:(previous-buffer)][previous-buffer]] | (SPC b n) [[elisp:(next-buffer)][next-buffer]] | -| (SPC b k) [[elisp:(kill-buffer)][kill-buffer]] | (SPC b s) [[elisp:(save-buffer)][save-buffer]] | (SPC b u) /sudo-save-buffer/ | -| (SPC w s) [[elisp:(evil-window-split)][evil-window-split]] | (SPC w v) [[elisp:(evil-window-vsplit)][evil-window-vsplit]] | (SPC w w) [[elisp:(evil-window-next)][evil-window-next]] | -| (SPC w c) [[elisp:(evil-window-delete)][evil-window-delete]] | (SPC w l) [[elisp:(evil-window-left 1)][evil-window-left]] | (SPC w h) [[elisp:(evil-window-right 1)][evil-window-right]] | -|------------------------------+------------------------------+-----------------------------| - -⦿ *HELP INFORMATION* -|-----------------------------+-----------------------------+-------------------------------| -| (SPC h d h) [[elisp:(doom/help)][doom/help]] | (SPC h d f) [[elisp:(doom/help-faq)][doom/help-faq]] | (SPC h i) [[elisp:(info)][info]] | -| (SPC h f) [[elisp:(counsel-describe-function)][describe-function]] | (SPC h v) [[elisp:(counsel-describe-variable)][describe-variable]] | (SPC h b b) [[elisp:(counsel-descbinds)][describe-bindings]] | -|-----------------------------+-----------------------------+-------------------------------| - -⦿ *DOOM EMACS CONFIGS* (Press =1-5= to immediately open a file) -|---+----------------+------------------------------------------------------------| -| =1= | [[elisp:(find-file (concat (getenv "HOME") "/.config/doom/config.org"))][config.org]] | This is the main user configuration file for Doom Emacs. | -| =2= | [[elisp:(find-file (concat (getenv "HOME") "/.config/doom/init.el"))][init.el]] | Allows you to turn on/off the standard Doom modules. | -| =3= | [[elisp:(find-file (concat (getenv "HOME") "/.config/doom/packages.el"))][packages.el]] | Easily install extra packages by adding them to this file. | -| =4= | [[elisp:(find-file (concat (getenv "HOME") "/.config/doom/eshell/aliases"))][eshell/aliases]] | Aliases file for the eshell. | -| =5= | [[elisp:(find-file (concat (getenv "HOME") "/.config/doom/eshell/profile"))][eshell/profile]] | Profile for the eshell. | -|---+----------------+------------------------------------------------------------| - -=NOTE=: 'SPC f p' [[elisp:(doom/find-file-in-private-config)][doom/find-file-in-private-config]]) - -;; Local Variables: -;; eval: (start-mode) -;; End: diff --git a/.config/emacs/agenda.org b/.config/emacs/agenda.org deleted file mode 100644 index e69de29..0000000 diff --git a/.config/emacs/config.el b/.config/emacs/config.el deleted file mode 100644 index c5e59b0..0000000 --- a/.config/emacs/config.el +++ /dev/null @@ -1,821 +0,0 @@ -(add-to-list 'load-path "~/.config/emacs/scripts/") - -(require 'elpaca-setup) ;; The Elpaca Package Manager -(require 'app-launchers) ;; Use emacs as a run launcher like dmenu (experimental) -(require 'buffer-move) ;; Buffer-move for better window management -(require 'eshell-prompt) ;; A fancy prompt for eshell - -(use-package all-the-icons - :ensure t - :if (display-graphic-p)) - -(use-package all-the-icons-dired - :hook (dired-mode . (lambda () (all-the-icons-dired-mode t)))) - -(setq backup-directory-alist '((".*" . "~/.local/share/Trash/files"))) - -(use-package company - :defer 2 - :diminish - :custom - (company-begin-commands '(self-insert-command)) - (company-idle-delay .1) - (company-minimum-prefix-length 2) - (company-show-numbers t) - (company-tooltip-align-annotations 't) - (global-company-mode t)) - -(use-package company-box - :after company - :diminish - :hook (company-mode . company-box-mode)) - -(use-package dashboard - :ensure t - :init - (setq initial-buffer-choice 'dashboard-open) - (setq dashboard-set-heading-icons t) - (setq dashboard-set-file-icons t) - (setq dashboard-banner-logo-title "Emacs Is More Than A Text Editor!") - ;;(setq dashboard-startup-banner 'logo) ;; use standard emacs logo as banner - (setq dashboard-startup-banner "~/.config/emacs/images/dtmacs-logo.png") ;; use custom image as banner - (setq dashboard-center-content nil) ;; set to 't' for centered content - (setq dashboard-items '((recents . 5) - (agenda . 5 ) - (bookmarks . 3) - (projects . 3))) - :custom - (dashboard-modify-heading-icons '((recents . "file-text") - (bookmarks . "book"))) - :config - (dashboard-setup-startup-hook)) - -(use-package diminish) - -(use-package dired-open - :config - (setq dired-open-extensions '(("gif" . "sxiv") - ("jpg" . "sxiv") - ("png" . "sxiv") - ("mkv" . "mpv") - ("mp4" . "mpv")))) - -(use-package peep-dired - :after dired - :hook (evil-normalize-keymaps . peep-dired-hook) - :config - (evil-define-key 'normal dired-mode-map (kbd "h") 'dired-up-directory) - (evil-define-key 'normal dired-mode-map (kbd "l") 'dired-open-file) ; use dired-find-file instead if not using dired-open package - (evil-define-key 'normal peep-dired-mode-map (kbd "j") 'peep-dired-next-file) - (evil-define-key 'normal peep-dired-mode-map (kbd "k") 'peep-dired-prev-file) -) - -(use-package drag-stuff - :init - (drag-stuff-global-mode 1) - (drag-stuff-define-keys)) - -(setq ediff-split-window-function 'split-window-horizontally - ediff-window-setup-function 'ediff-setup-windows-plain) - -(defun dt-ediff-hook () - (ediff-setup-keymap) - (define-key ediff-mode-map "j" 'ediff-next-difference) - (define-key ediff-mode-map "k" 'ediff-previous-difference)) - -(add-hook 'ediff-mode-hook 'dt-ediff-hook) - -(use-package elfeed - :config - (setq elfeed-search-feed-face ":foreground #ffffff :weight bold" - elfeed-feeds (quote - (("https://www.reddit.com/r/linux.rss" reddit linux) - ("https://www.reddit.com/r/commandline.rss" reddit commandline) - ("https://www.reddit.com/r/distrotube.rss" reddit distrotube) - ("https://www.reddit.com/r/emacs.rss" reddit emacs) - ("https://www.gamingonlinux.com/article_rss.php" gaming linux) - ("https://hackaday.com/blog/feed/" hackaday linux) - ("https://opensource.com/feed" opensource linux) - ("https://linux.softpedia.com/backend.xml" softpedia linux) - ("https://itsfoss.com/feed/" itsfoss linux) - ("https://www.zdnet.com/topic/linux/rss.xml" zdnet linux) - ("https://www.phoronix.com/rss.php" phoronix linux) - ("http://feeds.feedburner.com/d0od" omgubuntu linux) - ("https://www.computerworld.com/index.rss" computerworld linux) - ("https://www.networkworld.com/category/linux/index.rss" networkworld linux) - ("https://www.techrepublic.com/rssfeeds/topic/open-source/" techrepublic linux) - ("https://betanews.com/feed" betanews linux) - ("http://lxer.com/module/newswire/headlines.rss" lxer linux) - ("https://distrowatch.com/news/dwd.xml" distrowatch linux))))) - - -(use-package elfeed-goodies - :init - (elfeed-goodies/setup) - :config - (setq elfeed-goodies/entry-pane-size 0.5)) - -(use-package ellama - :init - (setopt ellama-keymap-prefix "C-c e") ;; keymap for all ellama functions - (setopt ellama-language "English") ;; language ellama should translate to - (require 'llm-ollama) - (setopt ellama-provider - (make-llm-ollama - ;; this model should be pulled to use it - ;; value should be the same as you print in terminal during pull - :chat-model "llama3.1" - :embedding-model "nomic-embed-text" - :default-chat-non-standard-params '(("num_ctx" . 8192)))) - ;; Predefined llm providers for interactive switching. - (setopt ellama-providers - '(("zephyr" . (make-llm-ollama - :chat-model "zephyr" - :embedding-model "zephyr")) - - ("llama3.1" . (make-llm-ollama - :chat-model "llama3.1" - :embedding-model "llama3.1")) - ("mixtral" . (make-llm-ollama - :chat-model "mixtral" - :embedding-model "mixtral")))) - (setopt ellama-naming-scheme 'ellama-generate-name-by-llm) - ;; Translation llm provider - (setopt ellama-translation-provider (make-llm-ollama - :chat-model "mixtral" - :embedding-model "nomic-embed-text")) - :config - (setq ellama-sessions-directory "~/.config/emacs/ellama-sessions/" - ellama-sessions-auto-save t)) - -(use-package eradio - :init - (setq eradio-player '("mpv" "--no-video" "--no-terminal")) - :config - (setq eradio-channels '(("Totally 80s FM" . "https://zeno.fm/radio/totally-80s-fm/") - ("Oldies Radio 50s-60s" . "https://zeno.fm/radio/oldies-radio-50s-60s/") - ("Oldies Radio 70s" . "https://zeno.fm/radio/oldies-radio-70s/") - ("Unlimited 80s" . "https://zeno.fm/radio/unlimited80s/") - ("80s Hits" . "https://zeno.fm/radio/80shits/") - ("90s Hits" . "https://zeno.fm/radio/90s_HITS/") - ("2000s Pop" . "https://zeno.fm/radio/2000s-pop/") - ("The 2000s" . "https://zeno.fm/radio/the-2000s/") - ("Hits 2010s" . "https://zeno.fm/radio/helia-hits-2010/") - ("Classical Radio" . "https://zeno.fm/radio/classical-radio/") - ("Classical Relaxation" . "https://zeno.fm/radio/radio-christmas-non-stop-classical/") - ("Classic Rock" . "https://zeno.fm/radio/classic-rockdnb2sav8qs8uv/") - ("Gangsta49" . "https://zeno.fm/radio/gangsta49/") - ("HipHop49" . "https://zeno.fm/radio/hiphop49/") - ("Madhouse Country Radio" . "https://zeno.fm/radio/madhouse-country-radio/") - ("PopMusic" . "https://zeno.fm/radio/popmusic74vyurvmug0uv/") - ("PopStars" . "https://zeno.fm/radio/popstars/") - ("RadioMetal" . "https://zeno.fm/radio/radio-metal/") - ("RocknRoll Radio" . "https://zeno.fm/radio/rocknroll-radio994c7517qs8uv/")))) - -;; Expands to: (elpaca evil (use-package evil :demand t)) -(use-package evil - :init ;; tweak evil's configuration before loading it - (setq evil-want-integration t ;; This is optional since it's already set to t by default. - evil-want-keybinding nil - evil-vsplit-window-right t - evil-split-window-below t - evil-undo-system 'undo-redo) ;; Adds vim-like C-r redo functionality - (evil-mode)) - -(use-package evil-collection - :after evil - :config - ;; Do not uncomment this unless you want to specify each and every mode - ;; that evil-collection should works with. The following line is here - ;; for documentation purposes in case you need it. - ;; (setq evil-collection-mode-list '(calendar dashboard dired ediff info magit ibuffer)) - (add-to-list 'evil-collection-mode-list 'help) ;; evilify help mode - (evil-collection-init)) - -(use-package evil-tutor) - -;; Using RETURN to follow links in Org/Evil -;; Unmap keys in 'evil-maps if not done, (setq org-return-follows-link t) will not work -(with-eval-after-load 'evil-maps - (define-key evil-motion-state-map (kbd "SPC") nil) - (define-key evil-motion-state-map (kbd "RET") nil) - (define-key evil-motion-state-map (kbd "TAB") nil)) -;; Setting RETURN key in org-mode to follow links - (setq org-return-follows-link t) - -(use-package flycheck - :ensure t - :defer t - :diminish - :init (global-flycheck-mode)) - -(set-face-attribute 'default nil - :font "JetBrains Mono" - :height 110 - :weight 'medium) -(set-face-attribute 'variable-pitch nil - :font "Ubuntu" - :height 120 - :weight 'medium) -(set-face-attribute 'fixed-pitch nil - :font "JetBrains Mono" - :height 110 - :weight 'medium) -;; Makes commented text and keywords italics. -;; This is working in emacsclient but not emacs. -;; Your font must have an italic face available. -(set-face-attribute 'font-lock-comment-face nil - :slant 'italic) -(set-face-attribute 'font-lock-keyword-face nil - :slant 'italic) - -;; This sets the default font on all graphical frames created after restarting Emacs. -;; Does the same thing as 'set-face-attribute default' above, but emacsclient fonts -;; are not right unless I also add this method of setting the default font. -(add-to-list 'default-frame-alist '(font . "JetBrains Mono-11")) - -;; Uncomment the following line if line spacing needs adjusting. -(setq-default line-spacing 0.12) -(set-face-background 'mouse "#ffffff") - -(global-set-key (kbd "C-=") 'text-scale-increase) -(global-set-key (kbd "C--") 'text-scale-decrease) -(global-set-key (kbd "") 'text-scale-increase) -(global-set-key (kbd "") 'text-scale-decrease) - -(use-package nerd-icons - ;; :custom - ;; The Nerd Font you want to use in GUI - ;; "Symbols Nerd Font Mono" is the default and is recommended - ;; but you can use any other Nerd Font if you want - ;; (nerd-icons-font-family "Symbols Nerd Font Mono") - ) - -(use-package general - :config - (general-evil-setup) - - ;; set up 'SPC' as the global leader key - (general-create-definer dt/leader-keys - :states '(normal insert visual emacs) - :keymaps 'override - :prefix "SPC" ;; set leader - :global-prefix "M-SPC") ;; access leader in insert mode - - (dt/leader-keys - "SPC" '(counsel-M-x :wk "Counsel M-x") - "." '(find-file :wk "Find file") - "=" '(perspective-map :wk "Perspective") ;; Lists all the perspective keybindings - "TAB TAB" '(comment-line :wk "Comment lines") - "u" '(universal-argument :wk "Universal argument")) - - (dt/leader-keys - "a" '(:ignore t :wk "A.I.") - "a a" '(ellama-ask-about :wk "Ask ellama about region") - "a e" '(:ignore t :wk "Ellama enhance") - "a e g" '(ellama-improve-grammar :wk "Ellama enhance wording") - "a e w" '(ellama-improve-wording :wk "Ellama enhance grammar") - "a i" '(ellama-chat :wk "Ask ellama") - "a p" '(ellama-provider-select :wk "Ellama provider select") - "a s" '(ellama-summarize :wk "Ellama summarize region") - "a t" '(ellama-translate :wk "Ellama translate region")) - - (dt/leader-keys - "b" '(:ignore t :wk "Bookmarks/Buffers") - "b b" '(switch-to-buffer :wk "Switch to buffer") - "b c" '(clone-indirect-buffer :wk "Create indirect buffer copy in a split") - "b C" '(clone-indirect-buffer-other-window :wk "Clone indirect buffer in new window") - "b d" '(bookmark-delete :wk "Delete bookmark") - "b i" '(ibuffer :wk "Ibuffer") - "b k" '(kill-current-buffer :wk "Kill current buffer") - "b K" '(kill-some-buffers :wk "Kill multiple buffers") - "b l" '(list-bookmarks :wk "List bookmarks") - "b m" '(bookmark-set :wk "Set bookmark") - "b n" '(next-buffer :wk "Next buffer") - "b p" '(previous-buffer :wk "Previous buffer") - "b r" '(revert-buffer :wk "Reload buffer") - "b R" '(rename-buffer :wk "Rename buffer") - "b s" '(basic-save-buffer :wk "Save buffer") - "b S" '(save-some-buffers :wk "Save multiple buffers") - "b w" '(bookmark-save :wk "Save current bookmarks to bookmark file")) - - (dt/leader-keys - "d" '(:ignore t :wk "Dired") - "d d" '(dired :wk "Open dired") - "d f" '(wdired-finish-edit :wk "Writable dired finish edit") - "d j" '(dired-jump :wk "Dired jump to current") - "d n" '(neotree-dir :wk "Open directory in neotree") - "d p" '(peep-dired :wk "Peep-dired") - "d w" '(wdired-change-to-wdired-mode :wk "Writable dired")) - - (dt/leader-keys - "e" '(:ignore t :wk "Ediff/Eshell/Eval/EWW") - "e b" '(eval-buffer :wk "Evaluate elisp in buffer") - "e d" '(eval-defun :wk "Evaluate defun containing or after point") - "e e" '(eval-expression :wk "Evaluate and elisp expression") - "e f" '(ediff-files :wk "Run ediff on a pair of files") - "e F" '(ediff-files3 :wk "Run ediff on three files") - "e h" '(counsel-esh-history :which-key "Eshell history") - "e l" '(eval-last-sexp :wk "Evaluate elisp expression before point") - "e n" '(eshell-new :wk "Create new eshell buffer") - "e r" '(eval-region :wk "Evaluate elisp in region") - "e R" '(eww-reload :which-key "Reload current page in EWW") - "e s" '(eshell :which-key "Eshell") - "e w" '(eww :which-key "EWW emacs web wowser")) - - (dt/leader-keys - "f" '(:ignore t :wk "Files") - "f c" '((lambda () (interactive) - (find-file "~/.config/emacs/config.org")) - :wk "Open emacs config.org") - "f e" '((lambda () (interactive) - (dired "~/.config/emacs/")) - :wk "Open user-emacs-directory in dired") - "f d" '(find-grep-dired :wk "Search for string in files in DIR") - "f g" '(counsel-grep-or-swiper :wk "Search for string current file") - "f i" '((lambda () (interactive) - (find-file "~/.config/emacs/init.el")) - :wk "Open emacs init.el") - "f j" '(counsel-file-jump :wk "Jump to a file below current directory") - "f l" '(counsel-locate :wk "Locate a file") - "f r" '(counsel-recentf :wk "Find recent files") - "f u" '(sudo-edit-find-file :wk "Sudo find file") - "f U" '(sudo-edit :wk "Sudo edit file")) - - (dt/leader-keys - "g" '(:ignore t :wk "Git") - "g /" '(magit-displatch :wk "Magit dispatch") - "g ." '(magit-file-displatch :wk "Magit file dispatch") - "g b" '(magit-branch-checkout :wk "Switch branch") - "g c" '(:ignore t :wk "Create") - "g c b" '(magit-branch-and-checkout :wk "Create branch and checkout") - "g c c" '(magit-commit-create :wk "Create commit") - "g c f" '(magit-commit-fixup :wk "Create fixup commit") - "g C" '(magit-clone :wk "Clone repo") - "g f" '(:ignore t :wk "Find") - "g f c" '(magit-show-commit :wk "Show commit") - "g f f" '(magit-find-file :wk "Magit find file") - "g f g" '(magit-find-git-config-file :wk "Find gitconfig file") - "g F" '(magit-fetch :wk "Git fetch") - "g g" '(magit-status :wk "Magit status") - "g i" '(magit-init :wk "Initialize git repo") - "g l" '(magit-log-buffer-file :wk "Magit buffer log") - "g r" '(vc-revert :wk "Git revert file") - "g s" '(magit-stage-file :wk "Git stage file") - "g t" '(git-timemachine :wk "Git time machine") - "g u" '(magit-stage-file :wk "Git unstage file")) - - (dt/leader-keys - "h" '(:ignore t :wk "Help") - "h a" '(counsel-apropos :wk "Apropos") - "h b" '(describe-bindings :wk "Describe bindings") - "h c" '(describe-char :wk "Describe character under cursor") - "h d" '(:ignore t :wk "Emacs documentation") - "h d a" '(about-emacs :wk "About Emacs") - "h d d" '(view-emacs-debugging :wk "View Emacs debugging") - "h d f" '(view-emacs-FAQ :wk "View Emacs FAQ") - "h d m" '(info-emacs-manual :wk "The Emacs manual") - "h d n" '(view-emacs-news :wk "View Emacs news") - "h d o" '(describe-distribution :wk "How to obtain Emacs") - "h d p" '(view-emacs-problems :wk "View Emacs problems") - "h d t" '(view-emacs-todo :wk "View Emacs todo") - "h d w" '(describe-no-warranty :wk "Describe no warranty") - "h e" '(view-echo-area-messages :wk "View echo area messages") - "h f" '(describe-function :wk "Describe function") - "h F" '(describe-face :wk "Describe face") - "h g" '(describe-gnu-project :wk "Describe GNU Project") - "h i" '(info :wk "Info") - "h I" '(describe-input-method :wk "Describe input method") - "h k" '(describe-key :wk "Describe key") - "h l" '(view-lossage :wk "Display recent keystrokes and the commands run") - "h L" '(describe-language-environment :wk "Describe language environment") - "h m" '(describe-mode :wk "Describe mode") - "h r" '(:ignore t :wk "Reload") - "h r r" '((lambda () (interactive) - (load-file "~/.config/emacs/init.el") - (ignore (elpaca-process-queues))) - :wk "Reload emacs config") - "h t" '(load-theme :wk "Load theme") - "h v" '(describe-variable :wk "Describe variable") - "h w" '(where-is :wk "Prints keybinding for command if set") - "h x" '(describe-command :wk "Display full documentation for command")) - - (dt/leader-keys - "m" '(:ignore t :wk "Org") - "m a" '(org-agenda :wk "Org agenda") - "m e" '(org-export-dispatch :wk "Org export dispatch") - "m i" '(org-toggle-item :wk "Org toggle item") - "m t" '(org-todo :wk "Org todo") - "m B" '(org-babel-tangle :wk "Org babel tangle") - "m T" '(org-todo-list :wk "Org todo list")) - - (dt/leader-keys - "m b" '(:ignore t :wk "Tables") - "m b -" '(org-table-insert-hline :wk "Insert hline in table")) - - (dt/leader-keys - "m d" '(:ignore t :wk "Date/deadline") - "m d t" '(org-time-stamp :wk "Org time stamp")) - - (dt/leader-keys - "o" '(:ignore t :wk "Open") - "o d" '(dashboard-open :wk "Dashboard") - "o e" '(elfeed :wk "Elfeed RSS") - "o f" '(make-frame :wk "Open buffer in new frame") - "o F" '(select-frame-by-name :wk "Select frame by name")) - - ;; projectile-command-map already has a ton of bindings - ;; set for us, so no need to specify each individually. - (dt/leader-keys - "p" '(projectile-command-map :wk "Projectile")) - - (dt/leader-keys - "r" '(:ignore t :wk "Radio") - "r p" '(eradio-play :wk "Eradio play") - "r s" '(eradio-stop :wk "Eradio stop") - "r t" '(eradio-toggle :wk "Eradio toggle")) - - - (dt/leader-keys - "s" '(:ignore t :wk "Search") - "s d" '(dictionary-search :wk "Search dictionary") - "s m" '(man :wk "Man pages") - "s o" '(pdf-occur :wk "Pdf search lines matching STRING") - "s t" '(tldr :wk "Lookup TLDR docs for a command") - "s w" '(woman :wk "Similar to man but doesn't require man")) - - (dt/leader-keys - "t" '(:ignore t :wk "Toggle") - "t e" '(eshell-toggle :wk "Toggle eshell") - "t f" '(flycheck-mode :wk "Toggle flycheck") - "t l" '(display-line-numbers-mode :wk "Toggle line numbers") - "t n" '(neotree-toggle :wk "Toggle neotree file viewer") - "t o" '(org-mode :wk "Toggle org mode") - "t r" '(rainbow-mode :wk "Toggle rainbow mode") - "t t" '(visual-line-mode :wk "Toggle truncated lines") - "t v" '(vterm-toggle :wk "Toggle vterm")) - - (dt/leader-keys - "w" '(:ignore t :wk "Windows/Words") - ;; Window splits - "w c" '(evil-window-delete :wk "Close window") - "w n" '(evil-window-new :wk "New window") - "w s" '(evil-window-split :wk "Horizontal split window") - "w v" '(evil-window-vsplit :wk "Vertical split window") - ;; Window motions - "w h" '(evil-window-left :wk "Window left") - "w j" '(evil-window-down :wk "Window down") - "w k" '(evil-window-up :wk "Window up") - "w l" '(evil-window-right :wk "Window right") - "w w" '(evil-window-next :wk "Goto next window") - ;; Move Windows - "w H" '(buf-move-left :wk "Buffer move left") - "w J" '(buf-move-down :wk "Buffer move down") - "w K" '(buf-move-up :wk "Buffer move up") - "w L" '(buf-move-right :wk "Buffer move right") - ;; Words - "w d" '(downcase-word :wk "Downcase word") - "w u" '(upcase-word :wk "Upcase word") - "w =" '(count-words :wk "Count words/lines for buffer")) -) - -(use-package git-timemachine - :after git-timemachine - :hook (evil-normalize-keymaps . git-timemachine-hook) - :config - (evil-define-key 'normal git-timemachine-mode-map (kbd "C-j") 'git-timemachine-show-previous-revision) - (evil-define-key 'normal git-timemachine-mode-map (kbd "C-k") 'git-timemachine-show-next-revision) -) - -(use-package hl-todo - :hook ((org-mode . hl-todo-mode) - (prog-mode . hl-todo-mode)) - :config - (setq hl-todo-highlight-punctuation ":" - hl-todo-keyword-faces - `(("TODO" warning bold) - ("FIXME" error bold) - ("HACK" font-lock-constant-face bold) - ("REVIEW" font-lock-keyword-face bold) - ("NOTE" success bold) - ("DEPRECATED" font-lock-doc-face bold)))) - -(use-package counsel - :after ivy - :diminish - :config - (counsel-mode) - (setq ivy-initial-inputs-alist nil)) ;; removes starting ^ regex in M-x - -(use-package ivy - :bind - ;; ivy-resume resumes the last Ivy-based completion. - (("C-c C-r" . ivy-resume) - ("C-x B" . ivy-switch-buffer-other-window)) - :diminish - :custom - (setq ivy-use-virtual-buffers t) - (setq ivy-count-format "(%d/%d) ") - (setq enable-recursive-minibuffers t) - :config - (ivy-mode)) - -(use-package all-the-icons-ivy-rich - :ensure t - :init (all-the-icons-ivy-rich-mode 1)) - -(use-package ivy-rich - :after ivy - :ensure t - :init (ivy-rich-mode 1) ;; this gets us descriptions in M-x. - :custom - (ivy-virtual-abbreviate 'full - ivy-rich-switch-buffer-align-virtual-buffer t - ivy-rich-path-style 'abbrev) - :config - (ivy-set-display-transformer 'ivy-switch-buffer - 'ivy-rich-switch-buffer-transformer)) - -(use-package dart-mode) -(use-package haskell-mode) -(use-package lua-mode) -(use-package php-mode) - -(global-set-key [escape] 'keyboard-escape-quit) - -(use-package doom-modeline - :ensure t - :init (doom-modeline-mode 1) - :config - (setq doom-modeline-height 35 ;; sets modeline height - doom-modeline-bar-width 5 ;; sets right bar width - doom-modeline-persp-name t ;; adds perspective name to modeline - doom-modeline-persp-icon t)) ;; adds folder icon next to persp name - -(use-package neotree - :config - (setq neo-smart-open t - neo-show-hidden-files t - neo-window-width 55 - neo-window-fixed-size nil - inhibit-compacting-font-caches t - projectile-switch-project-action 'neotree-projectile-action) - ;; truncate long file names in neotree - (add-hook 'neo-after-create-hook - #'(lambda (_) - (with-current-buffer (get-buffer neo-buffer-name) - (setq truncate-lines t) - (setq word-wrap nil) - (make-local-variable 'auto-hscroll-mode) - (setq auto-hscroll-mode nil))))) - -(setq org-agenda-files '("~/.config/emacs/agenda.org")) - -(add-hook 'org-mode-hook 'org-indent-mode) -(use-package org-bullets) -(add-hook 'org-mode-hook (lambda () (org-bullets-mode 1))) - -(eval-after-load 'org-indent '(diminish 'org-indent-mode)) - - (custom-set-faces - '(org-level-1 ((t (:inherit outline-1 :height 1.7)))) - '(org-level-2 ((t (:inherit outline-2 :height 1.6)))) - '(org-level-3 ((t (:inherit outline-3 :height 1.5)))) - '(org-level-4 ((t (:inherit outline-4 :height 1.4)))) - '(org-level-5 ((t (:inherit outline-5 :height 1.3)))) - '(org-level-6 ((t (:inherit outline-5 :height 1.2)))) - '(org-level-7 ((t (:inherit outline-5 :height 1.1))))) - -(require 'org-tempo) - -(setq org-src-preserve-indentation t) - -(use-package toc-org - :commands toc-org-enable - :init (add-hook 'org-mode-hook 'toc-org-enable)) - -(use-package ox-hugo - :ensure t ;Auto-install the package from Melpa - :after ox) - -(use-package pdf-tools - :defer t - :commands (pdf-loader-install) - :mode "\\.pdf\\'" - :bind (:map pdf-view-mode-map - ("j" . pdf-view-next-line-or-next-page) - ("k" . pdf-view-previous-line-or-previous-page) - ("C-=" . pdf-view-enlarge) - ("C--" . pdf-view-shrink)) - :init (pdf-loader-install) - :config (add-to-list 'revert-without-query ".pdf")) - -(add-hook 'pdf-view-mode-hook #'(lambda () (interactive) (display-line-numbers-mode -1) - (blink-cursor-mode -1) - (doom-modeline-mode -1))) - -(use-package perspective - :custom - ;; NOTE! I have also set 'SCP =' to open the perspective menu. - ;; I'm only setting the additional binding because setting it - ;; helps suppress an annoying warning message. - (persp-mode-prefix-key (kbd "C-c M-p")) - :init - (persp-mode) - :config - ;; Sets a file to write to when we save states - (setq persp-state-default-file "~/.config/emacs/sessions")) - -;; This will group buffers by persp-name in ibuffer. -(add-hook 'ibuffer-hook - (lambda () - (persp-ibuffer-set-filter-groups) - (unless (eq ibuffer-sorting-mode 'alphabetic) - (ibuffer-do-sort-by-alphabetic)))) - -;; Automatically save perspective states to file when Emacs exits. -(add-hook 'kill-emacs-hook #'persp-state-save) - -(use-package projectile - :config - (projectile-mode 1)) - -(use-package rainbow-delimiters - :hook ((emacs-lisp-mode . rainbow-delimiters-mode) - (clojure-mode . rainbow-delimiters-mode))) - -(use-package rainbow-mode - :diminish - :hook org-mode prog-mode) - -(delete-selection-mode 1) ;; You can select text and delete it by typing. -(electric-indent-mode -1) ;; Turn off the weird indenting that Emacs does by default. -(electric-pair-mode 1) ;; Turns on automatic parens pairing -;; The following prevents <> from auto-pairing when electric-pair-mode is on. -;; Otherwise, org-tempo is broken when you try to ") #'pcomplete-list))) - -;; A function for easily creating multiple buffers of 'eshell'. -;; NOTE: `C-u M-x eshell` would also create new 'eshell' buffers. -(defun eshell-new (name) - "Create new eshell buffer named NAME." - (interactive "sName: ") - (setq name (concat "$" name)) - (eshell) - (rename-buffer name)) - -(use-package eshell-toggle - :custom - (eshell-toggle-size-fraction 3) - (eshell-toggle-use-projectile-root t) - (eshell-toggle-run-command nil) - (eshell-toggle-init-function #'eshell-toggle-init-ansi-term)) - - (use-package eshell-syntax-highlighting - :after esh-mode - :config - (eshell-syntax-highlighting-global-mode +1)) - - ;; eshell-syntax-highlighting -- adds fish/zsh-like syntax highlighting. - ;; eshell-rc-script -- your profile for eshell; like a bashrc for eshell. - ;; eshell-aliases-file -- sets an aliases file for the eshell. - - (setq eshell-rc-script (concat user-emacs-directory "eshell/profile") - eshell-aliases-file (concat user-emacs-directory "eshell/aliases") - eshell-history-size 5000 - eshell-buffer-maximum-lines 5000 - eshell-hist-ignoredups t - eshell-scroll-to-bottom-on-input t - eshell-destroy-buffer-when-process-dies t - eshell-visual-commands'("bash" "fish" "htop" "ssh" "top" "zsh")) - -(use-package vterm - :ensure t - :config - (setq shell-file-name "/bin/sh" - vterm-max-scrollback 5000)) - -(use-package vterm-toggle - :ensure t - :after vterm - :config - ;; When running programs in Vterm and in 'normal' mode, make sure that ESC - ;; kills the program as it would in most standard terminal programs. - (evil-define-key 'normal vterm-mode-map (kbd "") 'vterm--self-insert) - (setq vterm-toggle-fullscreen-p nil) - (setq vterm-toggle-scope 'project) - (add-to-list 'display-buffer-alist - '((lambda (buffer-or-name _) - (let ((buffer (get-buffer buffer-or-name))) - (with-current-buffer buffer - (or (equal major-mode 'vterm-mode) - (string-prefix-p vterm-buffer-name (buffer-name buffer)))))) - (display-buffer-reuse-window display-buffer-at-bottom) - ;;(display-buffer-reuse-window display-buffer-in-direction) - ;;display-buffer-in-direction/direction/dedicated is added in emacs27 - ;;(direction . bottom) - ;;(dedicated . t) ;dedicated is supported in emacs27 - (reusable-frames . visible) - (window-height . 0.4)))) - -(use-package sudo-edit) - -(add-to-list 'custom-theme-load-path "~/.config/emacs/themes/") - -(use-package doom-themes - :config - (setq doom-themes-enable-bold t ; if nil, bold is universally disabled - doom-themes-enable-italic t) ; if nil, italics is universally disabled - ;; Sets the default theme to load!!! - (load-theme 'doom-one t) - ;; Enable custom neotree theme (all-the-icons must be installed!) - (doom-themes-neotree-config) - ;; Corrects (and improves) org-mode's native fontification. - (doom-themes-org-config)) - -(use-package tldr) - -(add-to-list 'default-frame-alist '(alpha-background . 100)) ; For all new frames henceforth - -(use-package which-key - :init - (which-key-mode 1) - :diminish - :config - (setq which-key-side-window-location 'bottom - which-key-sort-order #'which-key-key-order-alpha - which-key-allow-imprecise-window-fit nil - which-key-sort-uppercase-first nil - which-key-add-column-padding 1 - which-key-max-display-columns nil - which-key-min-display-lines 6 - which-key-side-window-slot -10 - which-key-side-window-max-height 0.25 - which-key-idle-delay 0.8 - which-key-max-description-length 25 - which-key-allow-imprecise-window-fit nil - which-key-separator " → " )) - -(defun reader () - (interactive) - (let ((choices '(("First" . "Hi!") - ("Second" . 'second-choice) - ("Third" . 'third-choice)))) - (alist-get - (completing-read "Choose: " choices) - choices nil nil 'message))) - -(defun github-code-search () - "Search code on github for a given language." - (interactive) - (let ((language (completing-read - "Language: " - '("Emacs Lisp" "Python" "Clojure" "R"))) - (code (read-string "Code: "))) - (browse-url - (concat "https://github.com/search?l=" language - "&type=code&q=" code)))) - -(defun dm-search () - "Search various search engines." - (interactive) - (let ((engine (completing-read - "Search Engine: " - '("Arch Wiki" - "Bing" - "Google" - "Wikipedia"))) - (query (read-string "Query: "))) - (if (equal engine "Google") - (browse-url - (concat "https://www.google.com/search?q=" query))))) - -(defun dt/key-value-completing (choice) - (interactive - (list - (let ((completions '(("1" "One") - ("2" "Two") - ("3" "Three")))) - (cadr (assoc (completing-read "Choose: " completions) completions))))) - (message "You choose `%s'" choice)) diff --git a/.config/emacs/config.org b/.config/emacs/config.org deleted file mode 100644 index aafc1bd..0000000 --- a/.config/emacs/config.org +++ /dev/null @@ -1,1164 +0,0 @@ -#+TITLE: DT's GNU Emacs Config -#+AUTHOR: Derek Taylor (DT) -#+DESCRIPTION: DT's personal Emacs config. -#+STARTUP: showeverything -#+OPTIONS: toc:2 - -* TABLE OF CONTENTS :toc: -- [[#important-programs-to-load-first][IMPORTANT PROGRAMS TO LOAD FIRST]] - - [[#adding-the-scripts-directory-to-path][Adding the scripts directory to path]] - - [[#sourcing-the-scripts][Sourcing the scripts]] -- [[#all-the-icons][ALL THE ICONS]] -- [[#backup][BACKUP]] -- [[#company][COMPANY]] -- [[#dashboard][DASHBOARD]] -- [[#diminish][DIMINISH]] -- [[#dired][DIRED]] -- [[#drag-stuff][DRAG-STUFF]] -- [[#ediff][EDIFF]] -- [[#elfeed][ELFEED]] -- [[#ellama][ELLAMA]] -- [[#eradio][ERADIO]] -- [[#evil][EVIL]] -- [[#flycheck][FLYCHECK]] -- [[#fonts][FONTS]] - - [[#setting-the-font-face][Setting the Font Face]] - - [[#zooming-inout][Zooming In/Out]] - - [[#nerd-fonts-for-modeline][Nerd Fonts For Modeline]] -- [[#general-keybindings][GENERAL KEYBINDINGS]] -- [[#git-programs][GIT PROGRAMS]] - - [[#git-time-machine][Git Time Machine]] -- [[#highlight-todo][HIGHLIGHT TODO]] -- [[#ivy-counsel][IVY (COUNSEL)]] -- [[#language-support][LANGUAGE SUPPORT]] -- [[#minibuffer-escape][MINIBUFFER ESCAPE]] -- [[#modeline][MODELINE]] -- [[#neotree][NEOTREE]] -- [[#org-mode][ORG MODE]] - - [[#agenda][Agenda]] - - [[#bullets][Bullets]] - - [[#diminish-org-indent-mode][Diminish Org Indent Mode]] - - [[#org-level-headers][Org Level Headers]] - - [[#org-tempo][Org-Tempo]] - - [[#preserve-indentation-on-org-babel-tangle][Preserve Indentation On Org-Babel-Tangle]] - - [[#toc-org][Toc-Org]] - - [[#ox-hugo][Ox-Hugo]] -- [[#pdfs][PDFs]] -- [[#perspective][PERSPECTIVE]] -- [[#projectile][PROJECTILE]] -- [[#rainbow-delimiters][RAINBOW DELIMITERS]] -- [[#rainbow-mode][RAINBOW MODE]] -- [[#sane-defaults][SANE DEFAULTS]] -- [[#shells-and-terminals][SHELLS AND TERMINALS]] - - [[#eshell][Eshell]] - - [[#vterm][Vterm]] - - [[#vterm-toggle][Vterm-Toggle]] -- [[#sudo-edit][SUDO EDIT]] -- [[#theme][THEME]] -- [[#tldr][TLDR]] -- [[#transparency][TRANSPARENCY]] -- [[#which-key][WHICH-KEY]] -- [[#test][TEST]] - -* IMPORTANT PROGRAMS TO LOAD FIRST -To keep this =config.org= a reasonable length, I have moved a lot of code to individual scripts that will be sourced by this config. These scripts are found in "~/.config/emacs/scripts" and do not contain any code that most people are likely to need to edit. - -** Adding the scripts directory to path -#+begin_src emacs-lisp -(add-to-list 'load-path "~/.config/emacs/scripts/") -#+end_src - -** Sourcing the scripts -#+begin_src emacs-lisp -(require 'elpaca-setup) ;; The Elpaca Package Manager -(require 'app-launchers) ;; Use emacs as a run launcher like dmenu (experimental) -(require 'buffer-move) ;; Buffer-move for better window management -(require 'eshell-prompt) ;; A fancy prompt for eshell -#+end_src - -* ALL THE ICONS -This is an icon set that can be used with dashboard, dired, ibuffer and other Emacs programs. - -#+begin_src emacs-lisp -(use-package all-the-icons - :ensure t - :if (display-graphic-p)) - -(use-package all-the-icons-dired - :hook (dired-mode . (lambda () (all-the-icons-dired-mode t)))) -#+end_src - -* BACKUP -By default, Emacs creates automatic backups of files in their original directories, such "file.el" and the backup "file.el~". This leads to a lot of clutter, so let's tell Emacs to put all backups that it creates in the =TRASH= directory. - -#+begin_src emacs-lisp -(setq backup-directory-alist '((".*" . "~/.local/share/Trash/files"))) - -#+end_src - -* COMPANY -[[https://company-mode.github.io/][Company]] is a text completion framework for Emacs. The name stands for "complete anything". Completion will start automatically after you type a few letters. Use M-n and M-p to select, to complete or to complete the common part. - -#+begin_src emacs-lisp -(use-package company - :defer 2 - :diminish - :custom - (company-begin-commands '(self-insert-command)) - (company-idle-delay .1) - (company-minimum-prefix-length 2) - (company-show-numbers t) - (company-tooltip-align-annotations 't) - (global-company-mode t)) - -(use-package company-box - :after company - :diminish - :hook (company-mode . company-box-mode)) -#+end_src - -* DASHBOARD -Emacs Dashboard is an extensible startup screen showing you recent files, bookmarks, agenda items and an Emacs banner. - -#+begin_src emacs-lisp -(use-package dashboard - :ensure t - :init - (setq initial-buffer-choice 'dashboard-open) - (setq dashboard-set-heading-icons t) - (setq dashboard-set-file-icons t) - (setq dashboard-banner-logo-title "Emacs Is More Than A Text Editor!") - ;;(setq dashboard-startup-banner 'logo) ;; use standard emacs logo as banner - (setq dashboard-startup-banner "~/.config/emacs/images/dtmacs-logo.png") ;; use custom image as banner - (setq dashboard-center-content nil) ;; set to 't' for centered content - (setq dashboard-items '((recents . 5) - (agenda . 5 ) - (bookmarks . 3) - (projects . 3))) - :custom - (dashboard-modify-heading-icons '((recents . "file-text") - (bookmarks . "book"))) - :config - (dashboard-setup-startup-hook)) - -#+end_src - -* DIMINISH -This package implements hiding or abbreviation of the modeline displays (lighters) of minor-modes. With this package installed, you can add ':diminish' to any use-package block to hide that particular mode in the modeline. - -#+begin_src emacs-lisp -(use-package diminish) - -#+end_src - -* DIRED -#+begin_src emacs-lisp -(use-package dired-open - :config - (setq dired-open-extensions '(("gif" . "sxiv") - ("jpg" . "sxiv") - ("png" . "sxiv") - ("mkv" . "mpv") - ("mp4" . "mpv")))) - -(use-package peep-dired - :after dired - :hook (evil-normalize-keymaps . peep-dired-hook) - :config - (evil-define-key 'normal dired-mode-map (kbd "h") 'dired-up-directory) - (evil-define-key 'normal dired-mode-map (kbd "l") 'dired-open-file) ; use dired-find-file instead if not using dired-open package - (evil-define-key 'normal peep-dired-mode-map (kbd "j") 'peep-dired-next-file) - (evil-define-key 'normal peep-dired-mode-map (kbd "k") 'peep-dired-prev-file) -) - -#+end_src - -* DRAG-STUFF -[[https://github.com/rejeep/drag-stuff.el][Drag Stuff]] is a minor mode for Emacs that makes it possible to drag stuff (words, region, lines) around in Emacs. When 'drag-stuff-define-keys' is enabled, then the following keybindings are set: M-up, M-down, M-left, and M-right. - -#+begin_src emacs-lisp -(use-package drag-stuff - :init - (drag-stuff-global-mode 1) - (drag-stuff-define-keys)) - -#+end_src - -* EDIFF -'ediff' is a diff program that is built into Emacs. By default, 'ediff' splits files vertically and places the 'help' frame in its own window. I have changed this so the two files are split horizontally and the 'help' frame appears as a lower split within the existing window. Also, I create my own 'dt-ediff-hook' where I add 'j/k' for moving to next/prev diffs. By default, this is set to 'n/p'. - -#+begin_src emacs-lisp -(setq ediff-split-window-function 'split-window-horizontally - ediff-window-setup-function 'ediff-setup-windows-plain) - -(defun dt-ediff-hook () - (ediff-setup-keymap) - (define-key ediff-mode-map "j" 'ediff-next-difference) - (define-key ediff-mode-map "k" 'ediff-previous-difference)) - -(add-hook 'ediff-mode-hook 'dt-ediff-hook) -#+end_src - -* ELFEED -An RSS newsfeed reader for Emacs. Move through the articles with 'j/k'. Move through the stories with 'CTRL j/k' when in other frame. - -#+begin_src emacs-lisp -(use-package elfeed - :config - (setq elfeed-search-feed-face ":foreground #ffffff :weight bold" - elfeed-feeds (quote - (("https://www.reddit.com/r/linux.rss" reddit linux) - ("https://www.reddit.com/r/commandline.rss" reddit commandline) - ("https://www.reddit.com/r/distrotube.rss" reddit distrotube) - ("https://www.reddit.com/r/emacs.rss" reddit emacs) - ("https://www.gamingonlinux.com/article_rss.php" gaming linux) - ("https://hackaday.com/blog/feed/" hackaday linux) - ("https://opensource.com/feed" opensource linux) - ("https://linux.softpedia.com/backend.xml" softpedia linux) - ("https://itsfoss.com/feed/" itsfoss linux) - ("https://www.zdnet.com/topic/linux/rss.xml" zdnet linux) - ("https://www.phoronix.com/rss.php" phoronix linux) - ("http://feeds.feedburner.com/d0od" omgubuntu linux) - ("https://www.computerworld.com/index.rss" computerworld linux) - ("https://www.networkworld.com/category/linux/index.rss" networkworld linux) - ("https://www.techrepublic.com/rssfeeds/topic/open-source/" techrepublic linux) - ("https://betanews.com/feed" betanews linux) - ("http://lxer.com/module/newswire/headlines.rss" lxer linux) - ("https://distrowatch.com/news/dwd.xml" distrowatch linux))))) - - -(use-package elfeed-goodies - :init - (elfeed-goodies/setup) - :config - (setq elfeed-goodies/entry-pane-size 0.5)) - -#+end_src - -* ELLAMA -[[https://github.com/s-kostyaev/ellama][Ellama]] is a tool for interacting with large language models from Emacs. You need to have 'ollama' installed on your computer to use 'ellama' in Emacs. You need to pull in any LLMs that you want to have available for use. For example, if you want to be able to use Llama 3.1, then you need to run 'ollama pull llama3.1'. - -#+begin_src emacs-lisp -(use-package ellama - :init - (setopt ellama-keymap-prefix "C-c e") ;; keymap for all ellama functions - (setopt ellama-language "English") ;; language ellama should translate to - (require 'llm-ollama) - (setopt ellama-provider - (make-llm-ollama - ;; this model should be pulled to use it - ;; value should be the same as you print in terminal during pull - :chat-model "llama3.1" - :embedding-model "nomic-embed-text" - :default-chat-non-standard-params '(("num_ctx" . 8192)))) - ;; Predefined llm providers for interactive switching. - (setopt ellama-providers - '(("zephyr" . (make-llm-ollama - :chat-model "zephyr" - :embedding-model "zephyr")) - - ("llama3.1" . (make-llm-ollama - :chat-model "llama3.1" - :embedding-model "llama3.1")) - ("mixtral" . (make-llm-ollama - :chat-model "mixtral" - :embedding-model "mixtral")))) - (setopt ellama-naming-scheme 'ellama-generate-name-by-llm) - ;; Translation llm provider - (setopt ellama-translation-provider (make-llm-ollama - :chat-model "mixtral" - :embedding-model "nomic-embed-text")) - :config - (setq ellama-sessions-directory "~/.config/emacs/ellama-sessions/" - ellama-sessions-auto-save t)) - -#+end_src - -* ERADIO -[[https://github.com/olavfosse/eradio][eradio]] is a simple Internet radio player for Emacs. It uses 'vlc as its backend by default, but you can change the =eradio-player= variable to use another multimedia player. I have set eradio to use 'mpv' instead of 'vlc' because it supports more types of Internet radio streams. - -#+begin_src emacs-lisp -(use-package eradio - :init - (setq eradio-player '("mpv" "--no-video" "--no-terminal")) - :config - (setq eradio-channels '(("Totally 80s FM" . "https://zeno.fm/radio/totally-80s-fm/") - ("Oldies Radio 50s-60s" . "https://zeno.fm/radio/oldies-radio-50s-60s/") - ("Oldies Radio 70s" . "https://zeno.fm/radio/oldies-radio-70s/") - ("Unlimited 80s" . "https://zeno.fm/radio/unlimited80s/") - ("80s Hits" . "https://zeno.fm/radio/80shits/") - ("90s Hits" . "https://zeno.fm/radio/90s_HITS/") - ("2000s Pop" . "https://zeno.fm/radio/2000s-pop/") - ("The 2000s" . "https://zeno.fm/radio/the-2000s/") - ("Hits 2010s" . "https://zeno.fm/radio/helia-hits-2010/") - ("Classical Radio" . "https://zeno.fm/radio/classical-radio/") - ("Classical Relaxation" . "https://zeno.fm/radio/radio-christmas-non-stop-classical/") - ("Classic Rock" . "https://zeno.fm/radio/classic-rockdnb2sav8qs8uv/") - ("Gangsta49" . "https://zeno.fm/radio/gangsta49/") - ("HipHop49" . "https://zeno.fm/radio/hiphop49/") - ("Madhouse Country Radio" . "https://zeno.fm/radio/madhouse-country-radio/") - ("PopMusic" . "https://zeno.fm/radio/popmusic74vyurvmug0uv/") - ("PopStars" . "https://zeno.fm/radio/popstars/") - ("RadioMetal" . "https://zeno.fm/radio/radio-metal/") - ("RocknRoll Radio" . "https://zeno.fm/radio/rocknroll-radio994c7517qs8uv/")))) -#+end_src - -* EVIL -[[https://github.com/emacs-evil/evil][Evil]] is an extensible vi/vim layer for Emacs. Because...let's face it. The Vim keybindings are just plain better. - -#+begin_src emacs-lisp -;; Expands to: (elpaca evil (use-package evil :demand t)) -(use-package evil - :init ;; tweak evil's configuration before loading it - (setq evil-want-integration t ;; This is optional since it's already set to t by default. - evil-want-keybinding nil - evil-vsplit-window-right t - evil-split-window-below t - evil-undo-system 'undo-redo) ;; Adds vim-like C-r redo functionality - (evil-mode)) - -(use-package evil-collection - :after evil - :config - ;; Do not uncomment this unless you want to specify each and every mode - ;; that evil-collection should works with. The following line is here - ;; for documentation purposes in case you need it. - ;; (setq evil-collection-mode-list '(calendar dashboard dired ediff info magit ibuffer)) - (add-to-list 'evil-collection-mode-list 'help) ;; evilify help mode - (evil-collection-init)) - -(use-package evil-tutor) - -;; Using RETURN to follow links in Org/Evil -;; Unmap keys in 'evil-maps if not done, (setq org-return-follows-link t) will not work -(with-eval-after-load 'evil-maps - (define-key evil-motion-state-map (kbd "SPC") nil) - (define-key evil-motion-state-map (kbd "RET") nil) - (define-key evil-motion-state-map (kbd "TAB") nil)) -;; Setting RETURN key in org-mode to follow links - (setq org-return-follows-link t) - -#+end_src - -* FLYCHECK -Install =luacheck= from your Linux distro's repositories for flycheck to work correctly with lua files. Install =python-pylint= for flycheck to work with python files. Haskell works with flycheck as long as =haskell-ghc= or =haskell-stack-ghc= is installed. For more information on language support for flycheck, [[https://www.flycheck.org/en/latest/languages.html][read this]]. - -#+begin_src emacs-lisp -(use-package flycheck - :ensure t - :defer t - :diminish - :init (global-flycheck-mode)) - -#+end_src - -* FONTS -Defining the various fonts that Emacs will use. - -** Setting the Font Face -#+begin_src emacs-lisp -(set-face-attribute 'default nil - :font "JetBrains Mono" - :height 110 - :weight 'medium) -(set-face-attribute 'variable-pitch nil - :font "Ubuntu" - :height 120 - :weight 'medium) -(set-face-attribute 'fixed-pitch nil - :font "JetBrains Mono" - :height 110 - :weight 'medium) -;; Makes commented text and keywords italics. -;; This is working in emacsclient but not emacs. -;; Your font must have an italic face available. -(set-face-attribute 'font-lock-comment-face nil - :slant 'italic) -(set-face-attribute 'font-lock-keyword-face nil - :slant 'italic) - -;; This sets the default font on all graphical frames created after restarting Emacs. -;; Does the same thing as 'set-face-attribute default' above, but emacsclient fonts -;; are not right unless I also add this method of setting the default font. -(add-to-list 'default-frame-alist '(font . "JetBrains Mono-11")) - -;; Uncomment the following line if line spacing needs adjusting. -(setq-default line-spacing 0.12) -(set-face-background 'mouse "#ffffff") - -#+end_src - -** Zooming In/Out -You can use the bindings CTRL plus =/- for zooming in/out. You can also use CTRL plus the -mouse wheel for zooming in/out. - -#+begin_src emacs-lisp -(global-set-key (kbd "C-=") 'text-scale-increase) -(global-set-key (kbd "C--") 'text-scale-decrease) -(global-set-key (kbd "") 'text-scale-increase) -(global-set-key (kbd "") 'text-scale-decrease) -#+end_src - -** Nerd Fonts For Modeline -#+begin_src emacs-lisp -(use-package nerd-icons - ;; :custom - ;; The Nerd Font you want to use in GUI - ;; "Symbols Nerd Font Mono" is the default and is recommended - ;; but you can use any other Nerd Font if you want - ;; (nerd-icons-font-family "Symbols Nerd Font Mono") - ) -#+end_src - -* GENERAL KEYBINDINGS -#+begin_src emacs-lisp -(use-package general - :config - (general-evil-setup) - - ;; set up 'SPC' as the global leader key - (general-create-definer dt/leader-keys - :states '(normal insert visual emacs) - :keymaps 'override - :prefix "SPC" ;; set leader - :global-prefix "M-SPC") ;; access leader in insert mode - - (dt/leader-keys - "SPC" '(counsel-M-x :wk "Counsel M-x") - "." '(find-file :wk "Find file") - "=" '(perspective-map :wk "Perspective") ;; Lists all the perspective keybindings - "TAB TAB" '(comment-line :wk "Comment lines") - "u" '(universal-argument :wk "Universal argument")) - - (dt/leader-keys - "a" '(:ignore t :wk "A.I.") - "a a" '(ellama-ask-about :wk "Ask ellama about region") - "a e" '(:ignore t :wk "Ellama enhance") - "a e g" '(ellama-improve-grammar :wk "Ellama enhance wording") - "a e w" '(ellama-improve-wording :wk "Ellama enhance grammar") - "a i" '(ellama-chat :wk "Ask ellama") - "a p" '(ellama-provider-select :wk "Ellama provider select") - "a s" '(ellama-summarize :wk "Ellama summarize region") - "a t" '(ellama-translate :wk "Ellama translate region")) - - (dt/leader-keys - "b" '(:ignore t :wk "Bookmarks/Buffers") - "b b" '(switch-to-buffer :wk "Switch to buffer") - "b c" '(clone-indirect-buffer :wk "Create indirect buffer copy in a split") - "b C" '(clone-indirect-buffer-other-window :wk "Clone indirect buffer in new window") - "b d" '(bookmark-delete :wk "Delete bookmark") - "b i" '(ibuffer :wk "Ibuffer") - "b k" '(kill-current-buffer :wk "Kill current buffer") - "b K" '(kill-some-buffers :wk "Kill multiple buffers") - "b l" '(list-bookmarks :wk "List bookmarks") - "b m" '(bookmark-set :wk "Set bookmark") - "b n" '(next-buffer :wk "Next buffer") - "b p" '(previous-buffer :wk "Previous buffer") - "b r" '(revert-buffer :wk "Reload buffer") - "b R" '(rename-buffer :wk "Rename buffer") - "b s" '(basic-save-buffer :wk "Save buffer") - "b S" '(save-some-buffers :wk "Save multiple buffers") - "b w" '(bookmark-save :wk "Save current bookmarks to bookmark file")) - - (dt/leader-keys - "d" '(:ignore t :wk "Dired") - "d d" '(dired :wk "Open dired") - "d f" '(wdired-finish-edit :wk "Writable dired finish edit") - "d j" '(dired-jump :wk "Dired jump to current") - "d n" '(neotree-dir :wk "Open directory in neotree") - "d p" '(peep-dired :wk "Peep-dired") - "d w" '(wdired-change-to-wdired-mode :wk "Writable dired")) - - (dt/leader-keys - "e" '(:ignore t :wk "Ediff/Eshell/Eval/EWW") - "e b" '(eval-buffer :wk "Evaluate elisp in buffer") - "e d" '(eval-defun :wk "Evaluate defun containing or after point") - "e e" '(eval-expression :wk "Evaluate and elisp expression") - "e f" '(ediff-files :wk "Run ediff on a pair of files") - "e F" '(ediff-files3 :wk "Run ediff on three files") - "e h" '(counsel-esh-history :which-key "Eshell history") - "e l" '(eval-last-sexp :wk "Evaluate elisp expression before point") - "e n" '(eshell-new :wk "Create new eshell buffer") - "e r" '(eval-region :wk "Evaluate elisp in region") - "e R" '(eww-reload :which-key "Reload current page in EWW") - "e s" '(eshell :which-key "Eshell") - "e w" '(eww :which-key "EWW emacs web wowser")) - - (dt/leader-keys - "f" '(:ignore t :wk "Files") - "f c" '((lambda () (interactive) - (find-file "~/.config/emacs/config.org")) - :wk "Open emacs config.org") - "f e" '((lambda () (interactive) - (dired "~/.config/emacs/")) - :wk "Open user-emacs-directory in dired") - "f d" '(find-grep-dired :wk "Search for string in files in DIR") - "f g" '(counsel-grep-or-swiper :wk "Search for string current file") - "f i" '((lambda () (interactive) - (find-file "~/.config/emacs/init.el")) - :wk "Open emacs init.el") - "f j" '(counsel-file-jump :wk "Jump to a file below current directory") - "f l" '(counsel-locate :wk "Locate a file") - "f r" '(counsel-recentf :wk "Find recent files") - "f u" '(sudo-edit-find-file :wk "Sudo find file") - "f U" '(sudo-edit :wk "Sudo edit file")) - - (dt/leader-keys - "g" '(:ignore t :wk "Git") - "g /" '(magit-displatch :wk "Magit dispatch") - "g ." '(magit-file-displatch :wk "Magit file dispatch") - "g b" '(magit-branch-checkout :wk "Switch branch") - "g c" '(:ignore t :wk "Create") - "g c b" '(magit-branch-and-checkout :wk "Create branch and checkout") - "g c c" '(magit-commit-create :wk "Create commit") - "g c f" '(magit-commit-fixup :wk "Create fixup commit") - "g C" '(magit-clone :wk "Clone repo") - "g f" '(:ignore t :wk "Find") - "g f c" '(magit-show-commit :wk "Show commit") - "g f f" '(magit-find-file :wk "Magit find file") - "g f g" '(magit-find-git-config-file :wk "Find gitconfig file") - "g F" '(magit-fetch :wk "Git fetch") - "g g" '(magit-status :wk "Magit status") - "g i" '(magit-init :wk "Initialize git repo") - "g l" '(magit-log-buffer-file :wk "Magit buffer log") - "g r" '(vc-revert :wk "Git revert file") - "g s" '(magit-stage-file :wk "Git stage file") - "g t" '(git-timemachine :wk "Git time machine") - "g u" '(magit-stage-file :wk "Git unstage file")) - - (dt/leader-keys - "h" '(:ignore t :wk "Help") - "h a" '(counsel-apropos :wk "Apropos") - "h b" '(describe-bindings :wk "Describe bindings") - "h c" '(describe-char :wk "Describe character under cursor") - "h d" '(:ignore t :wk "Emacs documentation") - "h d a" '(about-emacs :wk "About Emacs") - "h d d" '(view-emacs-debugging :wk "View Emacs debugging") - "h d f" '(view-emacs-FAQ :wk "View Emacs FAQ") - "h d m" '(info-emacs-manual :wk "The Emacs manual") - "h d n" '(view-emacs-news :wk "View Emacs news") - "h d o" '(describe-distribution :wk "How to obtain Emacs") - "h d p" '(view-emacs-problems :wk "View Emacs problems") - "h d t" '(view-emacs-todo :wk "View Emacs todo") - "h d w" '(describe-no-warranty :wk "Describe no warranty") - "h e" '(view-echo-area-messages :wk "View echo area messages") - "h f" '(describe-function :wk "Describe function") - "h F" '(describe-face :wk "Describe face") - "h g" '(describe-gnu-project :wk "Describe GNU Project") - "h i" '(info :wk "Info") - "h I" '(describe-input-method :wk "Describe input method") - "h k" '(describe-key :wk "Describe key") - "h l" '(view-lossage :wk "Display recent keystrokes and the commands run") - "h L" '(describe-language-environment :wk "Describe language environment") - "h m" '(describe-mode :wk "Describe mode") - "h r" '(:ignore t :wk "Reload") - "h r r" '((lambda () (interactive) - (load-file "~/.config/emacs/init.el") - (ignore (elpaca-process-queues))) - :wk "Reload emacs config") - "h t" '(load-theme :wk "Load theme") - "h v" '(describe-variable :wk "Describe variable") - "h w" '(where-is :wk "Prints keybinding for command if set") - "h x" '(describe-command :wk "Display full documentation for command")) - - (dt/leader-keys - "m" '(:ignore t :wk "Org") - "m a" '(org-agenda :wk "Org agenda") - "m e" '(org-export-dispatch :wk "Org export dispatch") - "m i" '(org-toggle-item :wk "Org toggle item") - "m t" '(org-todo :wk "Org todo") - "m B" '(org-babel-tangle :wk "Org babel tangle") - "m T" '(org-todo-list :wk "Org todo list")) - - (dt/leader-keys - "m b" '(:ignore t :wk "Tables") - "m b -" '(org-table-insert-hline :wk "Insert hline in table")) - - (dt/leader-keys - "m d" '(:ignore t :wk "Date/deadline") - "m d t" '(org-time-stamp :wk "Org time stamp")) - - (dt/leader-keys - "o" '(:ignore t :wk "Open") - "o d" '(dashboard-open :wk "Dashboard") - "o e" '(elfeed :wk "Elfeed RSS") - "o f" '(make-frame :wk "Open buffer in new frame") - "o F" '(select-frame-by-name :wk "Select frame by name")) - - ;; projectile-command-map already has a ton of bindings - ;; set for us, so no need to specify each individually. - (dt/leader-keys - "p" '(projectile-command-map :wk "Projectile")) - - (dt/leader-keys - "r" '(:ignore t :wk "Radio") - "r p" '(eradio-play :wk "Eradio play") - "r s" '(eradio-stop :wk "Eradio stop") - "r t" '(eradio-toggle :wk "Eradio toggle")) - - - (dt/leader-keys - "s" '(:ignore t :wk "Search") - "s d" '(dictionary-search :wk "Search dictionary") - "s m" '(man :wk "Man pages") - "s o" '(pdf-occur :wk "Pdf search lines matching STRING") - "s t" '(tldr :wk "Lookup TLDR docs for a command") - "s w" '(woman :wk "Similar to man but doesn't require man")) - - (dt/leader-keys - "t" '(:ignore t :wk "Toggle") - "t e" '(eshell-toggle :wk "Toggle eshell") - "t f" '(flycheck-mode :wk "Toggle flycheck") - "t l" '(display-line-numbers-mode :wk "Toggle line numbers") - "t n" '(neotree-toggle :wk "Toggle neotree file viewer") - "t o" '(org-mode :wk "Toggle org mode") - "t r" '(rainbow-mode :wk "Toggle rainbow mode") - "t t" '(visual-line-mode :wk "Toggle truncated lines") - "t v" '(vterm-toggle :wk "Toggle vterm")) - - (dt/leader-keys - "w" '(:ignore t :wk "Windows/Words") - ;; Window splits - "w c" '(evil-window-delete :wk "Close window") - "w n" '(evil-window-new :wk "New window") - "w s" '(evil-window-split :wk "Horizontal split window") - "w v" '(evil-window-vsplit :wk "Vertical split window") - ;; Window motions - "w h" '(evil-window-left :wk "Window left") - "w j" '(evil-window-down :wk "Window down") - "w k" '(evil-window-up :wk "Window up") - "w l" '(evil-window-right :wk "Window right") - "w w" '(evil-window-next :wk "Goto next window") - ;; Move Windows - "w H" '(buf-move-left :wk "Buffer move left") - "w J" '(buf-move-down :wk "Buffer move down") - "w K" '(buf-move-up :wk "Buffer move up") - "w L" '(buf-move-right :wk "Buffer move right") - ;; Words - "w d" '(downcase-word :wk "Downcase word") - "w u" '(upcase-word :wk "Upcase word") - "w =" '(count-words :wk "Count words/lines for buffer")) -) - -#+end_src - -* GIT PROGRAMS -** Git Time Machine -[[https://github.com/emacsmirror/git-timemachine][git-timemachine]] is a program that allows you to move backwards and forwards through a file's commits. 'SPC g t' will open the time machine on a file if it is in a git repo. Then, while in normal mode, you can use 'CTRL-j' and 'CTRL-k' to move backwards and forwards through the commits. - - -#+begin_src emacs-lisp -(use-package git-timemachine - :after git-timemachine - :hook (evil-normalize-keymaps . git-timemachine-hook) - :config - (evil-define-key 'normal git-timemachine-mode-map (kbd "C-j") 'git-timemachine-show-previous-revision) - (evil-define-key 'normal git-timemachine-mode-map (kbd "C-k") 'git-timemachine-show-next-revision) -) -#+end_src - -* HIGHLIGHT TODO -Adding highlights to TODO and related words. - -#+begin_src emacs-lisp -(use-package hl-todo - :hook ((org-mode . hl-todo-mode) - (prog-mode . hl-todo-mode)) - :config - (setq hl-todo-highlight-punctuation ":" - hl-todo-keyword-faces - `(("TODO" warning bold) - ("FIXME" error bold) - ("HACK" font-lock-constant-face bold) - ("REVIEW" font-lock-keyword-face bold) - ("NOTE" success bold) - ("DEPRECATED" font-lock-doc-face bold)))) - -#+end_src - -* IVY (COUNSEL) -+ Ivy, a generic completion mechanism for Emacs. -+ Counsel, a collection of Ivy-enhanced versions of common Emacs commands. -+ Ivy-rich allows us to add descriptions alongside the commands in M-x. - -#+begin_src emacs-lisp -(use-package counsel - :after ivy - :diminish - :config - (counsel-mode) - (setq ivy-initial-inputs-alist nil)) ;; removes starting ^ regex in M-x - -(use-package ivy - :bind - ;; ivy-resume resumes the last Ivy-based completion. - (("C-c C-r" . ivy-resume) - ("C-x B" . ivy-switch-buffer-other-window)) - :diminish - :custom - (setq ivy-use-virtual-buffers t) - (setq ivy-count-format "(%d/%d) ") - (setq enable-recursive-minibuffers t) - :config - (ivy-mode)) - -(use-package all-the-icons-ivy-rich - :ensure t - :init (all-the-icons-ivy-rich-mode 1)) - -(use-package ivy-rich - :after ivy - :ensure t - :init (ivy-rich-mode 1) ;; this gets us descriptions in M-x. - :custom - (ivy-virtual-abbreviate 'full - ivy-rich-switch-buffer-align-virtual-buffer t - ivy-rich-path-style 'abbrev) - :config - (ivy-set-display-transformer 'ivy-switch-buffer - 'ivy-rich-switch-buffer-transformer)) - -#+end_src - -* LANGUAGE SUPPORT -Emacs has built-in programming language modes for Lisp, Scheme, DSSSL, Ada, ASM, AWK, C, C++, Fortran, Icon, IDL (CORBA), IDLWAVE, Java, Javascript, M4, Makefiles, Metafont, Modula2, Object Pascal, Objective-C, Octave, Pascal, Perl, Pike, PostScript, Prolog, Python, Ruby, Simula, SQL, Tcl, Verilog, and VHDL. Other languages will require you to install additional modes. - -#+begin_src emacs-lisp -(use-package dart-mode) -(use-package haskell-mode) -(use-package lua-mode) -(use-package php-mode) - -#+end_src - -* MINIBUFFER ESCAPE -By default, Emacs requires you to hit ESC three times to escape quit the minibuffer. - -#+begin_src emacs-lisp -(global-set-key [escape] 'keyboard-escape-quit) -#+end_src - -* MODELINE -The modeline is the bottom status bar that appears in Emacs windows. While you can create your own custom modeline, why go to the trouble when Doom Emacs already has a nice modeline package available. For more information on what is available to configure in the Doom modeline, check out: [[https://github.com/seagle0128/doom-modeline][Doom Modeline]] - -#+begin_src emacs-lisp -(use-package doom-modeline - :ensure t - :init (doom-modeline-mode 1) - :config - (setq doom-modeline-height 35 ;; sets modeline height - doom-modeline-bar-width 5 ;; sets right bar width - doom-modeline-persp-name t ;; adds perspective name to modeline - doom-modeline-persp-icon t)) ;; adds folder icon next to persp name - -#+end_src - -* NEOTREE -Neotree is a file tree viewer. When you open neotree, it jumps to the current file thanks to neo-smart-open. The neo-window-fixed-size setting makes the neotree width be adjustable. NeoTree provides following themes: classic, ascii, arrow, icons, and nerd. Theme can be config'd by setting "two" themes for neo-theme: one for the GUI and one for the terminal. I like to use 'SPC t' for 'toggle' keybindings, so I have used 'SPC t n' for toggle-neotree. - -| COMMAND | DESCRIPTION | KEYBINDING | -|----------------+---------------------------+------------| -| neotree-toggle | /Toggle neotree/ | SPC t n | -| neotree- dir | /Open directory in neotree/ | SPC d n | - -#+BEGIN_SRC emacs-lisp -(use-package neotree - :config - (setq neo-smart-open t - neo-show-hidden-files t - neo-window-width 55 - neo-window-fixed-size nil - inhibit-compacting-font-caches t - projectile-switch-project-action 'neotree-projectile-action) - ;; truncate long file names in neotree - (add-hook 'neo-after-create-hook - #'(lambda (_) - (with-current-buffer (get-buffer neo-buffer-name) - (setq truncate-lines t) - (setq word-wrap nil) - (make-local-variable 'auto-hscroll-mode) - (setq auto-hscroll-mode nil))))) - -#+end_src - -* ORG MODE -** Agenda -#+begin_src emacs-lisp -(setq org-agenda-files '("~/.config/emacs/agenda.org")) -#+end_src - -** Bullets -=Org-bullets= gives us attractive bullets rather than asterisks. - -#+begin_src emacs-lisp -(add-hook 'org-mode-hook 'org-indent-mode) -(use-package org-bullets) -(add-hook 'org-mode-hook (lambda () (org-bullets-mode 1))) -#+end_src - -** Diminish Org Indent Mode -Removes "Ind" from showing in the modeline. - -#+begin_src emacs-lisp -(eval-after-load 'org-indent '(diminish 'org-indent-mode)) -#+end_src - -** Org Level Headers -#+begin_src emacs-lisp - (custom-set-faces - '(org-level-1 ((t (:inherit outline-1 :height 1.7)))) - '(org-level-2 ((t (:inherit outline-2 :height 1.6)))) - '(org-level-3 ((t (:inherit outline-3 :height 1.5)))) - '(org-level-4 ((t (:inherit outline-4 :height 1.4)))) - '(org-level-5 ((t (:inherit outline-5 :height 1.3)))) - '(org-level-6 ((t (:inherit outline-5 :height 1.2)))) - '(org-level-7 ((t (:inherit outline-5 :height 1.1))))) -#+end_src - -** Org-Tempo -Org-tempo is not a separate package but a module within org that can be enabled. Org-tempo allows for ' from auto-pairing when electric-pair-mode is on. -;; Otherwise, org-tempo is broken when you try to ") #'pcomplete-list))) - -;; A function for easily creating multiple buffers of 'eshell'. -;; NOTE: `C-u M-x eshell` would also create new 'eshell' buffers. -(defun eshell-new (name) - "Create new eshell buffer named NAME." - (interactive "sName: ") - (setq name (concat "$" name)) - (eshell) - (rename-buffer name)) - -(use-package eshell-toggle - :custom - (eshell-toggle-size-fraction 3) - (eshell-toggle-use-projectile-root t) - (eshell-toggle-run-command nil) - (eshell-toggle-init-function #'eshell-toggle-init-ansi-term)) - - (use-package eshell-syntax-highlighting - :after esh-mode - :config - (eshell-syntax-highlighting-global-mode +1)) - - ;; eshell-syntax-highlighting -- adds fish/zsh-like syntax highlighting. - ;; eshell-rc-script -- your profile for eshell; like a bashrc for eshell. - ;; eshell-aliases-file -- sets an aliases file for the eshell. - - (setq eshell-rc-script (concat user-emacs-directory "eshell/profile") - eshell-aliases-file (concat user-emacs-directory "eshell/aliases") - eshell-history-size 5000 - eshell-buffer-maximum-lines 5000 - eshell-hist-ignoredups t - eshell-scroll-to-bottom-on-input t - eshell-destroy-buffer-when-process-dies t - eshell-visual-commands'("bash" "fish" "htop" "ssh" "top" "zsh")) -#+end_src - -** Vterm -Vterm is a terminal emulator within Emacs. The 'shell-file-name' setting sets the shell to be used in M-x shell, M-x term, M-x ansi-term and M-x vterm. By default, the shell is set to 'fish' but could change it to 'bash' or 'zsh' if you prefer. - -#+begin_src emacs-lisp -(use-package vterm - :ensure t - :config - (setq shell-file-name "/bin/sh" - vterm-max-scrollback 5000)) -#+end_src - -** Vterm-Toggle -[[https://github.com/jixiuf/vterm-toggle][vterm-toggle]] toggles between the vterm buffer and whatever buffer you are editing. - -#+begin_src emacs-lisp -(use-package vterm-toggle - :ensure t - :after vterm - :config - ;; When running programs in Vterm and in 'normal' mode, make sure that ESC - ;; kills the program as it would in most standard terminal programs. - (evil-define-key 'normal vterm-mode-map (kbd "") 'vterm--self-insert) - (setq vterm-toggle-fullscreen-p nil) - (setq vterm-toggle-scope 'project) - (add-to-list 'display-buffer-alist - '((lambda (buffer-or-name _) - (let ((buffer (get-buffer buffer-or-name))) - (with-current-buffer buffer - (or (equal major-mode 'vterm-mode) - (string-prefix-p vterm-buffer-name (buffer-name buffer)))))) - (display-buffer-reuse-window display-buffer-at-bottom) - ;;(display-buffer-reuse-window display-buffer-in-direction) - ;;display-buffer-in-direction/direction/dedicated is added in emacs27 - ;;(direction . bottom) - ;;(dedicated . t) ;dedicated is supported in emacs27 - (reusable-frames . visible) - (window-height . 0.4)))) - -#+end_src - -* SUDO EDIT -[[https://github.com/nflath/sudo-edit][sudo-edit]] gives us the ability to open files with sudo privileges or switch over to editing with sudo privileges if we initially opened the file without such privileges. - -#+begin_src emacs-lisp -(use-package sudo-edit) -#+end_src - -* THEME -The first line below designates the directory where will place all of our custom-made themes, which I have created only one (dtmacs). You can create your own Emacs themes with the help of the [[https://emacsfodder.github.io/emacs-theme-editor/][Emacs Theme Editor]]. I am also installing =doom-themes= because it contains a huge collection of themes. M-x load-theme will list all of the themes available. - -#+begin_src emacs-lisp -(add-to-list 'custom-theme-load-path "~/.config/emacs/themes/") - -(use-package doom-themes - :config - (setq doom-themes-enable-bold t ; if nil, bold is universally disabled - doom-themes-enable-italic t) ; if nil, italics is universally disabled - ;; Sets the default theme to load!!! - (load-theme 'doom-one t) - ;; Enable custom neotree theme (all-the-icons must be installed!) - (doom-themes-neotree-config) - ;; Corrects (and improves) org-mode's native fontification. - (doom-themes-org-config)) -#+end_src - -* TLDR - -#+begin_src emacs-lisp -(use-package tldr) - -#+end_src - -* TRANSPARENCY -With Emacs version 29, true transparency has been added. I have turned transparency off by setting the alpha to '100'. If you want some slight transparency, try setting alpha to '90'. Of course, if you set alpha to '0', the background of Emacs would completely transparent. - -#+begin_src emacs-lisp -(add-to-list 'default-frame-alist '(alpha-background . 100)) ; For all new frames henceforth - -#+end_src - -* WHICH-KEY -#+begin_src emacs-lisp -(use-package which-key - :init - (which-key-mode 1) - :diminish - :config - (setq which-key-side-window-location 'bottom - which-key-sort-order #'which-key-key-order-alpha - which-key-allow-imprecise-window-fit nil - which-key-sort-uppercase-first nil - which-key-add-column-padding 1 - which-key-max-display-columns nil - which-key-min-display-lines 6 - which-key-side-window-slot -10 - which-key-side-window-max-height 0.25 - which-key-idle-delay 0.8 - which-key-max-description-length 25 - which-key-allow-imprecise-window-fit nil - which-key-separator " → " )) -#+end_src - -* TEST -#+begin_src emacs-lisp -(defun reader () - (interactive) - (let ((choices '(("First" . "Hi!") - ("Second" . 'second-choice) - ("Third" . 'third-choice)))) - (alist-get - (completing-read "Choose: " choices) - choices nil nil 'message))) - -(defun github-code-search () - "Search code on github for a given language." - (interactive) - (let ((language (completing-read - "Language: " - '("Emacs Lisp" "Python" "Clojure" "R"))) - (code (read-string "Code: "))) - (browse-url - (concat "https://github.com/search?l=" language - "&type=code&q=" code)))) - -(defun dm-search () - "Search various search engines." - (interactive) - (let ((engine (completing-read - "Search Engine: " - '("Arch Wiki" - "Bing" - "Google" - "Wikipedia"))) - (query (read-string "Query: "))) - (if (equal engine "Google") - (browse-url - (concat "https://www.google.com/search?q=" query))))) - -(defun dt/key-value-completing (choice) - (interactive - (list - (let ((completions '(("1" "One") - ("2" "Two") - ("3" "Three")))) - (cadr (assoc (completing-read "Choose: " completions) completions))))) - (message "You choose `%s'" choice)) - -#+end_src diff --git a/.config/emacs/early-init.el b/.config/emacs/early-init.el index 512068a..4859fe2 100644 --- a/.config/emacs/early-init.el +++ b/.config/emacs/early-init.el @@ -1 +1,150 @@ -(setq package-enable-at-startup nil) +;;; early-init.el --- Doom's universal bootstrapper -*- lexical-binding: t -*- +;;; Commentary: +;; +;; This file, in summary: +;; - Determines where `user-emacs-directory' is by: +;; - Processing `--init-directory DIR' (backported from Emacs 29), +;; - Processing `--profile NAME' (see +;; `https://docs.doomemacs.org/-/developers' or docs/developers.org), +;; - Or assume that it's the directory this file lives in. +;; - Loads Doom as efficiently as possible, with only the essential startup +;; optimizations, and prepares it for interactive or non-interactive sessions. +;; - If Doom isn't present, then we assume that Doom is being used as a +;; bootloader and the user wants to load a non-Doom config, so we undo all our +;; global side-effects, load `user-emacs-directory'/early-init.el, and carry +;; on as normal (without Doom). +;; - Do all this without breaking compatibility with Chemacs. +;; +;; early-init.el was introduced in Emacs 27.1. It is loaded before init.el, +;; before Emacs initializes its UI or package.el, and before site files are +;; loaded. This is great place for startup optimizing, because only here can you +;; *prevent* things from loading, rather than turn them off after-the-fact. +;; +;; Doom uses this file as its "universal bootstrapper" for both interactive and +;; non-interactive sessions. That means: no matter what environment you want +;; Doom in, load this file first. +;; +;;; Code: + +(let (file-name-handler-alist) + ;; PERF: Garbage collection is a big contributor to startup times in both + ;; interactive and CLI sessions, so I defer it. + (if noninteractive ; in CLI sessions + ;; PERF: GC deferral is less important in the CLI, but still helps script + ;; startup times. Just don't set it too high to avoid runaway memory + ;; usage in long-running elisp shell scripts. + (setq gc-cons-threshold 134217728 ; 128mb + ;; Backported from 29 (see emacs-mirror/emacs@73a384a98698) + gc-cons-percentage 1.0) + ;; PERF: Doom relies on `gcmh-mode' to reset this while the user is idle, so + ;; I effectively disable GC during startup. DON'T COPY THIS BLINDLY! If + ;; it's not reset later there will be stuttering, freezes, and crashes. + (setq gc-cons-threshold most-positive-fixnum)) + + ;; PERF: Don't use precious startup time to check mtimes on elisp bytecode. + ;; Ensuring correctness is 'doom sync's job. Although stale byte-code will + ;; heavily impact startup times, performance is unimportant when Emacs is in + ;; an error state. + (setq load-prefer-newer noninteractive) + + ;; UX: Respect DEBUG envvar as an alternative to --debug-init, and to make + ;; startup more verbose sooner. + (let ((debug (getenv-internal "DEBUG"))) + (when (stringp debug) + (if (string-empty-p debug) + (setenv "DEBUG" nil) + (setq init-file-debug t + debug-on-error t)))) + + (let (;; FIX: Unset `command-line-args' in noninteractive sessions, to + ;; ensure upstream switches aren't misinterpreted. + (command-line-args (unless noninteractive command-line-args)) + ;; I avoid using `command-switch-alist' to process --profile (and + ;; --init-directory) because it is processed too late to change + ;; `user-emacs-directory' in time. + (profile (or (cadr (member "--profile" command-line-args)) + (getenv-internal "DOOMPROFILE")))) + (if (null profile) + ;; REVIEW: Backported from Emacs 29. Remove when 28 support is dropped. + (let ((init-dir (or (cadr (member "--init-directory" command-line-args)) + (getenv-internal "EMACSDIR")))) + (if (null init-dir) + ;; FIX: If we've been loaded directly (via 'emacs -batch -l + ;; early-init.el') or by a doomscript (like bin/doom), and Doom + ;; is in a non-standard location (and/or Chemacs is used), then + ;; `user-emacs-directory' will be wrong. + (when noninteractive + (setq user-emacs-directory + (file-name-directory (file-truename load-file-name)))) + ;; FIX: To prevent "invalid option" errors later. + (push (cons "--init-directory" (lambda (_) (pop argv))) command-switch-alist) + (setq user-emacs-directory (expand-file-name init-dir)))) + ;; FIX: Discard the switch to prevent "invalid option" errors later. + (push (cons "--profile" (lambda (_) (pop argv))) command-switch-alist) + ;; Running 'doom sync' or 'doom profile sync --all' (re)generates a light + ;; profile loader in $XDG_DATA_HOME/doom/profiles.X.el (or + ;; $DOOMPROFILELOADFILE), after reading `doom-profile-load-path'. This + ;; loader requires `$DOOMPROFILE' be set to function. + (setenv "DOOMPROFILE" profile) + (or (load (let ((windows? (memq system-type '(ms-dos windows-nt cygwin)))) + (expand-file-name + (format (or (getenv-internal "DOOMPROFILELOADFILE") + (file-name-concat (if windows? "doomemacs/data" "doom") + "profiles.%d")) + emacs-major-version) + (or (if windows? (getenv-internal "LOCALAPPDATA")) + (getenv-internal "XDG_DATA_HOME") + "~/.local/share"))) + 'noerror (not init-file-debug)) + (user-error "Profiles not initialized yet; run 'doom sync' first")))) + + ;; PERF: When `load'ing or `require'ing files, each permutation of + ;; `load-suffixes' and `load-file-rep-suffixes' (then `load-suffixes' + + ;; `load-file-rep-suffixes') is used to locate the file. Each permutation + ;; amounts to at least one file op, which is normally very fast, but can add + ;; up over the hundreds/thousands of files Emacs loads. + ;; + ;; To reduce that burden -- and since Doom doesn't load any dynamic modules + ;; this early -- I remove `.so' from `load-suffixes' and pass the + ;; `must-suffix' arg to `load'. See the docs of `load' for details. + (if (let ((load-suffixes '(".elc" ".el")) + (doom (expand-file-name "lisp/doom" user-emacs-directory))) + ;; I avoid `load's NOERROR argument because it suppresses other, + ;; legitimate errors (like permission or IO errors), which gets + ;; incorrectly interpreted as "this is not a Doom config". + (if (file-exists-p (concat doom ".el")) + ;; Load the heart of Doom Emacs. + (load doom nil (not init-file-debug) nil 'must-suffix) + ;; Failing that, assume we're loading a non-Doom config... + ;; HACK: `startup--load-user-init-file' resolves $EMACSDIR from a + ;; lexical (and so, not-trivially-modifiable) + ;; `startup-init-directory', so Emacs will fail to locate the + ;; correct $EMACSDIR/init.el without help. + (define-advice startup--load-user-init-file (:filter-args (args) reroute-to-profile) + (list (lambda () (expand-file-name "init.el" user-emacs-directory)) + nil (nth 2 args))) + ;; (Re)set `user-init-file' for the `load' call further below, and do + ;; so here while our `file-name-handler-alist' optimization is still + ;; effective (benefits `expand-file-name'). BTW: Emacs resets + ;; `user-init-file' and `early-init-file' after this file is loaded. + (setq user-init-file (expand-file-name "early-init" user-emacs-directory)) + ;; COMPAT: I make no assumptions about the config we're going to load, + ;; so undo this file's global side-effects. + (setq load-prefer-newer t) + ;; PERF: But make an exception for `gc-cons-threshold', which I think + ;; all Emacs users and configs will benefit from. Still, setting it + ;; to `most-positive-fixnum' is dangerous if downstream does not + ;; reset it later to something reasonable, so I use 16mb as a best + ;; fit guess. It's better than Emacs' 80kb default. + (setq gc-cons-threshold (* 16 1024 1024)) + nil)) + ;; Sets up Doom (particularly `doom-profile') for the session ahead. This + ;; loads the profile's init file, if it's available. In interactive + ;; session, a missing profile is an error state, in a non-interactive one, + ;; it's not (and left to the consumer to deal with). + (doom-initialize (not noninteractive)) + ;; If we're here, the user wants to load another config/profile (that may or + ;; may not be a Doom config). + (load user-init-file 'noerror (not init-file-debug) nil 'must-suffix))) + +;;; early-init.el ends here diff --git a/.config/emacs/eshell/aliases b/.config/emacs/eshell/aliases deleted file mode 100644 index 2dac14d..0000000 --- a/.config/emacs/eshell/aliases +++ /dev/null @@ -1,23 +0,0 @@ -# Aliases for emacs commands -alias ff find-file $1 - -# Aliasing standard shell commands to better emacs alternatives -alias less view-file $1 - -# Changing "ls" to "exa" -alias ls eza -al --color=always --group-directories-first $* # my preferred listing -alias la eza -a --color=always --group-directories-first $* # all files and dirs -alias ll eza -l --color=always --group-directories-first $* # long format -alias lt eza -aT --color=always --group-directories-first $* # tree listing -alias l. eza -a1 $* | grep "^\." # list hidden files - -# Merge Xresources -alias merge xrdb -merge ~/.Xresources - -# Confirm before overwriting something -alias cp cp -i $1 -alias mv mv -i $1 -alias rm rm -i $1 - -# Bare git repo alias for dotfiles -alias config /usr/bin/git --git-dir=$HOME/dotfiles --work-tree=$HOME $* diff --git a/.config/emacs/eshell/profile b/.config/emacs/eshell/profile deleted file mode 100644 index 3c871d6..0000000 --- a/.config/emacs/eshell/profile +++ /dev/null @@ -1 +0,0 @@ -colorscript random \ No newline at end of file diff --git a/.config/emacs/images/dtmacs-logo.png b/.config/emacs/images/dtmacs-logo.png deleted file mode 100644 index 388f793..0000000 Binary files a/.config/emacs/images/dtmacs-logo.png and /dev/null differ diff --git a/.config/emacs/images/emacs-dash.png b/.config/emacs/images/emacs-dash.png deleted file mode 100644 index 931758f..0000000 Binary files a/.config/emacs/images/emacs-dash.png and /dev/null differ diff --git a/.config/emacs/init.el b/.config/emacs/init.el deleted file mode 100644 index 2eda1c6..0000000 --- a/.config/emacs/init.el +++ /dev/null @@ -1,33 +0,0 @@ -(org-babel-load-file - (expand-file-name - "config.org" - user-emacs-directory)) -(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. - '(custom-safe-themes - '("02f57ef0a20b7f61adce51445b68b2a7e832648ce2e7efb19d217b6454c1b644" - "6945dadc749ac5cbd47012cad836f92aea9ebec9f504d32fe89a956260773ca4" - "944d52450c57b7cbba08f9b3d08095eb7a5541b0ecfb3a0a9ecd4a18f3c28948" - "636b135e4b7c86ac41375da39ade929e2bd6439de8901f53f88fde7dd5ac3561" - "1f669e8abe4dc2855268c9a607b5e350e2811b3c5afd09af5939ff0c01a89c5a" - default)) - '(package-selected-packages '(magit taxy-magit-section)) - '(send-mail-function 'smtpmail-send-it) - '(smtpmail-smtp-server "smtp.1and1.com") - '(smtpmail-smtp-service 587)) -(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. - '(org-level-1 ((t (:inherit outline-1 :height 1.7)))) - '(org-level-2 ((t (:inherit outline-2 :height 1.6)))) - '(org-level-3 ((t (:inherit outline-3 :height 1.5)))) - '(org-level-4 ((t (:inherit outline-4 :height 1.4)))) - '(org-level-5 ((t (:inherit outline-5 :height 1.3)))) - '(org-level-6 ((t (:inherit outline-5 :height 1.2)))) - '(org-level-7 ((t (:inherit outline-5 :height 1.1))))) -(put 'downcase-region 'disabled nil) diff --git a/.config/emacs/scripts/app-launchers.el b/.config/emacs/scripts/app-launchers.el deleted file mode 100644 index 7536a87..0000000 --- a/.config/emacs/scripts/app-launchers.el +++ /dev/null @@ -1,56 +0,0 @@ -;;; app-launchers.el --- Possible alternatives to dmenu/rofi - -;;; Code: - -;; Counsel-Linux-App -;; Since we have counsel installed, we can use 'counsel-linux-app' to launch our Linux apps. It list the apps by their executable command, so it's kind of tricky to use. - -(defun dt/emacs-counsel-launcher () - "Create and select a frame called emacs-counsel-launcher which consists only of a minibuffer and has specific dimensions. Runs counsel-linux-app on that frame, which is an emacs command that prompts you to select an app and open it in a dmenu like behaviour. Delete the frame after that command has exited" - (interactive) - (with-selected-frame - (make-frame '((name . "emacs-run-launcher") - (minibuffer . only) - (fullscreen . 0) ; no fullscreen - (undecorated . t) ; remove title bar - ;;(auto-raise . t) ; focus on this frame - ;;(tool-bar-lines . 0) - ;;(menu-bar-lines . 0) - (internal-border-width . 10) - (width . 80) - (height . 11))) - (unwind-protect - (counsel-linux-app) - (delete-frame)))) - - -;; App-Launcher -;; The 'app-launcher' is a better run launcher since it reads the desktop applications on your system and you can search them by their names as defined in their desktop file. This means that sometimes you have to search for a generic term rather than the actual binary command of the program. - -(use-package app-launcher - :ensure '(app-launcher :host github :repo "SebastienWae/app-launcher")) -;; create a global keyboard shortcut with the following code -;; emacsclient -cF "((visibility . nil))" -e "(emacs-run-launcher)" - -(defun dt/emacs-run-launcher () - "Create and select a frame called emacs-run-launcher which consists only of a minibuffer and has specific dimensions. Runs app-launcher-run-app on that frame, which is an emacs command that prompts you to select an app and open it in a dmenu like behaviour. Delete the frame after that command has exited" - (interactive) - (with-selected-frame - (make-frame '((name . "emacs-run-launcher") - (minibuffer . only) - (fullscreen . 0) ; no fullscreen - (undecorated . t) ; remove title bar - ;;(auto-raise . t) ; focus on this frame - ;;(tool-bar-lines . 0) - ;;(menu-bar-lines . 0) - (internal-border-width . 10) - (width . 80) - (height . 11))) - (unwind-protect - (app-launcher-run-app) - (delete-frame)))) - - -(provide 'app-launchers) -;;; app-launchers.el ends here - diff --git a/.config/emacs/scripts/buffer-move.el b/.config/emacs/scripts/buffer-move.el deleted file mode 100644 index 5dcde11..0000000 --- a/.config/emacs/scripts/buffer-move.el +++ /dev/null @@ -1,101 +0,0 @@ -;;; buffer-move.el --- Buffer move allows for better window controls. - -;; Copyright (C) 2004-2014 Lucas Bonnet - -;; Author: Lucas Bonnet -;; Keywords: lisp,convenience -;; Version: 0.5 -;; URL : https://github.com/lukhas/buffer-move - -;; 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 2 -;; 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, write to the Free Software -;; Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -;; 02111-1307, USA. - -;;; Commentary: - -;; This file is for lazy people wanting to swap buffers without -;; typing C-x b on each window. - -;;; Code: -(require 'windmove) - -;;;###autoload -(defun buf-move-up () - "Swap the current buffer and the buffer above the split. -If there is no split, ie now window above the current one, an -error is signaled." -;; "Switches between the current buffer, and the buffer above the -;; split, if possible." - (interactive) - (let* ((other-win (windmove-find-other-window 'up)) - (buf-this-buf (window-buffer (selected-window)))) - (if (null other-win) - (error "No window above this one") - ;; swap top with this one - (set-window-buffer (selected-window) (window-buffer other-win)) - ;; move this one to top - (set-window-buffer other-win buf-this-buf) - (select-window other-win)))) - -;;;###autoload -(defun buf-move-down () -"Swap the current buffer and the buffer under the split. -If there is no split, ie now window under the current one, an -error is signaled." - (interactive) - (let* ((other-win (windmove-find-other-window 'down)) - (buf-this-buf (window-buffer (selected-window)))) - (if (or (null other-win) - (string-match "^ \\*Minibuf" (buffer-name (window-buffer other-win)))) - (error "No window under this one") - ;; swap top with this one - (set-window-buffer (selected-window) (window-buffer other-win)) - ;; move this one to top - (set-window-buffer other-win buf-this-buf) - (select-window other-win)))) - -;;;###autoload -(defun buf-move-left () -"Swap the current buffer and the buffer on the left of the split. -If there is no split, ie now window on the left of the current -one, an error is signaled." - (interactive) - (let* ((other-win (windmove-find-other-window 'left)) - (buf-this-buf (window-buffer (selected-window)))) - (if (null other-win) - (error "No left split") - ;; swap top with this one - (set-window-buffer (selected-window) (window-buffer other-win)) - ;; move this one to top - (set-window-buffer other-win buf-this-buf) - (select-window other-win)))) - -;;;###autoload -(defun buf-move-right () -"Swap the current buffer and the buffer on the right of the split. -If there is no split, ie now window on the right of the current -one, an error is signaled." - (interactive) - (let* ((other-win (windmove-find-other-window 'right)) - (buf-this-buf (window-buffer (selected-window)))) - (if (null other-win) - (error "No right split") - ;; swap top with this one - (set-window-buffer (selected-window) (window-buffer other-win)) - ;; move this one to top - (set-window-buffer other-win buf-this-buf) - (select-window other-win)))) - -(provide 'buffer-move) -;;; buffer-move.el ends here diff --git a/.config/emacs/scripts/elpaca-setup.el b/.config/emacs/scripts/elpaca-setup.el deleted file mode 100644 index 6c5e8af..0000000 --- a/.config/emacs/scripts/elpaca-setup.el +++ /dev/null @@ -1,73 +0,0 @@ - -;;; Code: - -(defvar elpaca-installer-version 0.11) -(defvar elpaca-directory (expand-file-name "elpaca/" user-emacs-directory)) -(defvar elpaca-builds-directory (expand-file-name "builds/" elpaca-directory)) -(defvar elpaca-repos-directory (expand-file-name "repos/" elpaca-directory)) -(defvar elpaca-order '(elpaca :repo "https://github.com/progfolio/elpaca.git" - :ref nil - :files (:defaults (:exclude "extensions")) - :build (:not elpaca--activate-package))) -(let* ((repo (expand-file-name "elpaca/" elpaca-repos-directory)) - (build (expand-file-name "elpaca/" elpaca-builds-directory)) - (order (cdr elpaca-order)) - (default-directory repo)) - (add-to-list 'load-path (if (file-exists-p build) build repo)) - (unless (file-exists-p repo) - (make-directory repo t) - (when (< emacs-major-version 28) (require 'subr-x)) - (condition-case-unless-debug err - (if-let ((buffer (pop-to-buffer-same-window "*elpaca-bootstrap*")) - ((zerop (call-process "git" nil buffer t "clone" - (plist-get order :repo) repo))) - ((zerop (call-process "git" nil buffer t "checkout" - (or (plist-get order :ref) "--")))) - (emacs (concat invocation-directory invocation-name)) - ((zerop (call-process emacs nil buffer nil "-Q" "-L" "." "--batch" - "--eval" "(byte-recompile-directory \".\" 0 'force)"))) - ((require 'elpaca)) - ((elpaca-generate-autoloads "elpaca" repo))) - (progn (message "%s" (buffer-string)) (kill-buffer buffer)) - (error "%s" (with-current-buffer buffer (buffer-string)))) -((error) (warn "%s" err) (delete-directory repo 'recursive)))) - (unless (require 'elpaca-autoloads nil t) - (require 'elpaca) - (elpaca-generate-autoloads "elpaca" repo) - (load "./elpaca-autoloads"))) -(add-hook 'after-init-hook #'elpaca-process-queues) -(elpaca `(,@elpaca-order)) - -;; Install use-package support -(elpaca elpaca-use-package - ;; Enable :elpaca use-package keyword. - (elpaca-use-package-mode) - ;; Assume :elpaca t unless otherwise specified. - (setq elpaca-use-package-by-default t)) - -;; Block until current queue processed. -(elpaca-wait) - -;;When installing a package which modifies a form used at the top-level -;;(e.g. a package which adds a use-package key word), -;;use `elpaca-wait' to block until that package has been installed/configured. -;;For example: -;;(use-package general :demand t) -;;(elpaca-wait) - -;;Turns off elpaca-use-package-mode current declartion -;;Note this will cause the declaration to be interpreted immediately (not deferred). -;;Useful for configuring built-in emacs features. -;;(use-package emacs :elpaca nil :config (setq ring-bell-function #'ignore)) - -;; Don't install anything. Defer execution of BODY -;;(elpaca nil (message "deferred")) -(elpaca (magit :branch "main" :pre-build ("make" "info"))) -(elpaca (forge :branch "main")) -(elpaca (ghub :branch "main")) -(elpaca (transient :branch "main")) -(elpaca (with-editor :branch "main")) - -(provide 'elpaca-setup) - -;;; elpaca-setup.el ends here diff --git a/.config/emacs/scripts/eshell-prompt.el b/.config/emacs/scripts/eshell-prompt.el deleted file mode 100644 index 7485ec4..0000000 --- a/.config/emacs/scripts/eshell-prompt.el +++ /dev/null @@ -1,33 +0,0 @@ -;;; eshell-prompt.el --- a fancy shell prompt for eshell - -;;; Code: - -;; fancy-shell -;; A fancy shell prompt for eshell. - -(defun fancy-shell () - "A pretty shell with git status" - (let* ((cwd (abbreviate-file-name (eshell/pwd))) - (ref (magit-get-shortname "HEAD")) - (stat (magit-file-status)) - (x-stat eshell-last-command-status) - (git-chunk - (if ref - (format "%s%s%s " - (propertize (if stat "[" "(") 'font-lock-face (list :foreground (if stat "#e81050" "#9bee8b"))) - (propertize ref 'font-lock-face '(:foreground "#c897ff")) - (propertize (if stat "]" ")") 'font-lock-face (list :foreground (if stat "#e81050" "#9bee8b")))) - ""))) - (propertize - (format "\n%s %s %s$ " - (if (< 0 x-stat) (format (propertize "!%s" 'font-lock-face '(:foreground "#e81050")) x-stat) - (propertize "➤" 'font-lock-face (list :foreground (if (< 0 x-stat) "#e81050" "#9bee8b")))) - (propertize cwd 'font-lock-face '(:foreground "#45babf")) - git-chunk) - 'read-only t - 'front-sticky '(font-lock-face read-only) - 'rear-nonsticky '(font-lock-face read-only)))) - - -(provide 'eshell-prompt) -;;; eshell-prompt.el ends here diff --git a/.config/emacs/themes/dtmacs-theme.el b/.config/emacs/themes/dtmacs-theme.el deleted file mode 100644 index b03dc56..0000000 --- a/.config/emacs/themes/dtmacs-theme.el +++ /dev/null @@ -1,317 +0,0 @@ -;;; dtmacs-theme.el --- Theme - -;; Copyright (C) 2023 , - -;; Author: Derek Taylor (DT) -;; Version: 0.1 -;; Package-Requires: ((emacs "24.1")) -;; Created with ThemeCreator, https://github.com/mswift42/themecreator. - -;; 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 . - -;; This file is not part of Emacs. - -;;; Commentary: -;;; dtmacs-theme was created by Derek Taylor in 2023 - -;;; Code: - -(deftheme dtmacs) -(let ((class '((class color) (min-colors 89))) - (fg1 "#d3eaf4") - (fg2 "#cadae2") - (fg3 "#748895") - (fg4 "#4f545a") - (fg6 "#c4c4c4") - (bg1 "#192428") - (bg2 "#24343e") - (bg3 "#0c191d") - (bg4 "#0d6f9f") - (builtin "#41b2ea") - (keyword "#9bee8b") - (const "#96defa") - (comment "#7a95a0") - (func "#a094fb") - (str "#89e14b") - (type "#68cee8") - (var "#ff6ba9") - (bufid "#ffffff") - (selection "#e81050") - (warning "#e81050") - (warning2 "#e86310") - (todo "#c897ff") - (done "#d6ff97") - (unspec (when (>= emacs-major-version 29) 'unspecified))) - (custom-theme-set-faces - 'dtmacs - `(default ((,class (:background ,bg1 :foreground ,fg1)))) - `(dashboard-footer ((,class (:foreground ,var :italic t)))) - `(dashboard-heading ((,class (:foreground ,const :weight bold)))) - `(dashboard-text-banner ((,class (:foreground ,fg1 :weight bold)))) - `(dashboard-banner-logo-title ((,class (:foreground ,str :weight bold)))) - `(font-lock-builtin-face ((,class (:foreground ,builtin)))) - `(font-lock-comment-face ((,class (:italic t :foreground ,comment)))) - `(font-lock-negation-char-face ((,class (:foreground ,const)))) - `(font-lock-reference-face ((,class (:foreground ,const)))) - `(font-lock-constant-face ((,class (:foreground ,const)))) - `(font-lock-doc-face ((,class (:foreground ,comment)))) - `(font-lock-function-name-face ((,class (:foreground ,func )))) - `(font-lock-keyword-face ((,class (:bold ,class :foreground ,keyword)))) - `(font-lock-string-face ((,class (:foreground ,str)))) - `(font-lock-type-face ((,class (:foreground ,type )))) - `(font-lock-variable-name-face ((,class (:foreground ,var)))) - `(font-lock-warning-face ((,class (:foreground ,warning :background ,bg2)))) - `(term-color-black ((,class (:foreground ,fg2 :background ,unspec)))) - ;; `(region ((,class (:background ,fg1 :foreground ,bg1)))) - `(region ((,class (:background ,selection)))) - `(highlight ((,class (:foreground ,fg3 :background ,bg3)))) - `(hl-line ((,class (:background ,bg2)))) - `(fringe ((,class (:background ,bg1 :foreground ,fg4)))) - `(cursor ((,class (:background ,fg4)))) - `(isearch ((,class (:bold t :foreground ,warning :background ,bg3)))) - `(mode-line ((,class (:box (:line-width 4 :color ,bg2) :bold t :foreground ,fg3 :background ,bg2)))) - `(mode-line-inactive ((,class (:box (:line-width 4 :color ,bg3) :foreground ,fg3 :background ,bg3 :weight bold)))) - `(mode-line-buffer-id ((,class (:box nil :bold t :foreground ,bufid :background ,unspec)))) - `(mode-line-highlight ((,class (:box nil :foreground ,selection :weight bold)))) - `(mode-line-emphasis ((,class (:foreground ,fg1)))) - `(vertical-border ((,class (:foreground ,fg3)))) - `(minibuffer-prompt ((,class (:bold t :foreground ,builtin)))) - `(default-italic ((,class (:italic t)))) - `(link ((,class (:foreground ,const :underline t)))) - `(org-code ((,class (:foreground ,fg2)))) - `(org-hide ((,class (:foreground ,fg4)))) - `(org-level-1 ((,class (:bold t :foreground ,builtin :height 1.7)))) - `(org-level-2 ((,class (:bold t :foreground ,str :height 1.6)))) - `(org-level-3 ((,class (:bold t :foreground ,var :height 1.5)))) - `(org-level-4 ((,class (:bold t :foreground ,func :height 1.4)))) - `(org-level-5 ((,class (:bold t :foreground ,const :height 1.3)))) - `(org-level-6 ((,class (:bold t :foreground ,keyword :height 1.2)))) - `(org-level-7 ((,class (:bold t :foreground ,builtin :height 1.1)))) - `(org-level-8 ((,class (:bold t :foreground ,str :height 1.0)))) - `(org-date ((,class (:underline t :foreground ,var) ))) - `(org-footnote ((,class (:underline t :foreground ,fg4)))) - `(org-link ((,class (:underline t :foreground ,type )))) - `(org-special-keyword ((,class (:foreground ,func)))) - `(org-block ((,class (:foreground ,fg2)))) - `(org-quote ((,class (:inherit org-block :slant italic)))) - `(org-verse ((,class (:inherit org-block :slant italic)))) - `(org-todo ((,class (:foreground ,todo :bold t :italic t)))) - `(org-done ((,class (:foreground ,done :bold t :italic t)))) - `(org-warning ((,class (:underline t :foreground ,warning)))) - `(org-agenda-structure ((,class (:weight bold :foreground ,fg3 :box (:color ,fg4) :background ,bg3)))) - `(org-agenda-date ((,class (:foreground ,var :height 1.1 )))) - `(org-agenda-date-weekend ((,class (:weight normal :foreground ,fg4)))) - `(org-agenda-date-today ((,class (:weight bold :foreground ,keyword :height 1.4)))) - `(org-agenda-done ((,class (:foreground ,bg4)))) - `(org-scheduled ((,class (:foreground ,type)))) - `(org-scheduled-today ((,class (:foreground ,func :weight bold :height 1.2)))) - `(org-ellipsis ((,class (:foreground ,builtin)))) - `(org-verbatim ((,class (:foreground ,str)))) - `(org-document-info-keyword ((,class (:foreground ,func)))) - `(font-latex-bold-face ((,class (:foreground ,type)))) - `(font-latex-italic-face ((,class (:foreground ,var :italic t)))) - `(font-latex-string-face ((,class (:foreground ,str)))) - `(font-latex-match-reference-keywords ((,class (:foreground ,const)))) - `(font-latex-match-variable-keywords ((,class (:foreground ,var)))) - `(ido-only-match ((,class (:foreground ,warning)))) - `(org-sexp-date ((,class (:foreground ,fg4)))) - `(ido-first-match ((,class (:foreground ,keyword :bold t)))) - `(ivy-current-match ((,class (:foreground ,fg3 :inherit highlight :underline t)))) - `(gnus-header-content ((,class (:foreground ,keyword)))) - `(gnus-header-from ((,class (:foreground ,var)))) - `(gnus-header-name ((,class (:foreground ,type)))) - `(gnus-header-subject ((,class (:foreground ,func :bold t)))) - `(mu4e-view-url-number-face ((,class (:foreground ,type)))) - `(mu4e-cited-1-face ((,class (:foreground ,fg2)))) - `(mu4e-cited-7-face ((,class (:foreground ,fg3)))) - `(mu4e-header-marks-face ((,class (:foreground ,type)))) - `(ffap ((,class (:foreground ,fg4)))) - `(js2-private-function-call ((,class (:foreground ,const)))) - `(js2-jsdoc-html-tag-delimiter ((,class (:foreground ,str)))) - `(js2-jsdoc-html-tag-name ((,class (:foreground ,var)))) - `(js2-external-variable ((,class (:foreground ,type )))) - `(js2-function-param ((,class (:foreground ,const)))) - `(js2-jsdoc-value ((,class (:foreground ,str)))) - `(js2-private-member ((,class (:foreground ,fg3)))) - `(js3-warning-face ((,class (:underline ,keyword)))) - `(js3-error-face ((,class (:underline ,warning)))) - `(js3-external-variable-face ((,class (:foreground ,var)))) - `(js3-function-param-face ((,class (:foreground ,fg2)))) - `(js3-jsdoc-tag-face ((,class (:foreground ,keyword)))) - `(js3-instance-member-face ((,class (:foreground ,const)))) - `(warning ((,class (:foreground ,warning)))) - `(ac-completion-face ((,class (:underline t :foreground ,keyword)))) - `(info-quoted-name ((,class (:foreground ,builtin)))) - `(info-string ((,class (:foreground ,str)))) - `(icompletep-determined ((,class :foreground ,builtin))) - `(undo-tree-visualizer-current-face ((,class :foreground ,builtin))) - `(undo-tree-visualizer-default-face ((,class :foreground ,fg2))) - `(undo-tree-visualizer-unmodified-face ((,class :foreground ,var))) - `(undo-tree-visualizer-register-face ((,class :foreground ,type))) - `(slime-repl-inputed-output-face ((,class (:foreground ,type)))) - `(trailing-whitespace ((,class :foreground ,unspec :background ,warning))) - `(rainbow-delimiters-depth-1-face ((,class :foreground ,fg1))) - `(rainbow-delimiters-depth-2-face ((,class :foreground ,type))) - `(rainbow-delimiters-depth-3-face ((,class :foreground ,var))) - `(rainbow-delimiters-depth-4-face ((,class :foreground ,const))) - `(rainbow-delimiters-depth-5-face ((,class :foreground ,keyword))) - `(rainbow-delimiters-depth-6-face ((,class :foreground ,fg1))) - `(rainbow-delimiters-depth-7-face ((,class :foreground ,type))) - `(rainbow-delimiters-depth-8-face ((,class :foreground ,var))) - `(magit-item-highlight ((,class :background ,bg3))) - `(magit-section-heading ((,class (:foreground ,keyword :weight bold)))) - `(magit-hunk-heading ((,class (:background ,bg3)))) - `(magit-section-highlight ((,class (:background ,bg2)))) - `(magit-hunk-heading-highlight ((,class (:background ,bg3)))) - `(magit-diff-context-highlight ((,class (:background ,bg3 :foreground ,fg3)))) - `(magit-diffstat-added ((,class (:foreground ,type)))) - `(magit-diffstat-removed ((,class (:foreground ,var)))) - `(magit-process-ok ((,class (:foreground ,func :weight bold)))) - `(magit-process-ng ((,class (:foreground ,warning :weight bold)))) - `(magit-branch ((,class (:foreground ,const :weight bold)))) - `(magit-log-author ((,class (:foreground ,fg3)))) - `(magit-hash ((,class (:foreground ,fg2)))) - `(magit-diff-file-header ((,class (:foreground ,fg2 :background ,bg3)))) - `(lazy-highlight ((,class (:foreground ,fg2 :background ,bg3)))) - `(term ((,class (:foreground ,fg1 :background ,bg1)))) - `(term-color-black ((,class (:foreground ,bg3 :background ,bg3)))) - `(term-color-blue ((,class (:foreground ,func :background ,func)))) - `(term-color-red ((,class (:foreground ,keyword :background ,bg3)))) - `(term-color-green ((,class (:foreground ,type :background ,bg3)))) - `(term-color-yellow ((,class (:foreground ,var :background ,var)))) - `(term-color-magenta ((,class (:foreground ,builtin :background ,builtin)))) - `(term-color-cyan ((,class (:foreground ,str :background ,str)))) - `(term-color-white ((,class (:foreground ,fg2 :background ,fg2)))) - `(rainbow-delimiters-unmatched-face ((,class :foreground ,warning))) - `(helm-header ((,class (:foreground ,fg2 :background ,bg1 :underline nil :box nil)))) - `(helm-source-header ((,class (:foreground ,keyword :background ,bg1 :underline nil :weight bold)))) - `(helm-selection ((,class (:background ,bg2 :underline nil)))) - `(helm-selection-line ((,class (:background ,bg2)))) - `(helm-visible-mark ((,class (:foreground ,bg1 :background ,bg3)))) - `(helm-candidate-number ((,class (:foreground ,bg1 :background ,fg1)))) - `(helm-separator ((,class (:foreground ,type :background ,bg1)))) - `(helm-time-zone-current ((,class (:foreground ,builtin :background ,bg1)))) - `(helm-time-zone-home ((,class (:foreground ,type :background ,bg1)))) - `(helm-buffer-not-saved ((,class (:foreground ,type :background ,bg1)))) - `(helm-buffer-process ((,class (:foreground ,builtin :background ,bg1)))) - `(helm-buffer-saved-out ((,class (:foreground ,fg1 :background ,bg1)))) - `(helm-buffer-size ((,class (:foreground ,fg1 :background ,bg1)))) - `(helm-ff-directory ((,class (:foreground ,func :background ,bg1 :weight bold)))) - `(helm-ff-file ((,class (:foreground ,fg1 :background ,bg1 :weight normal)))) - `(helm-ff-executable ((,class (:foreground ,var :background ,bg1 :weight normal)))) - `(helm-ff-invalid-symlink ((,class (:foreground ,warning2 :background ,bg1 :weight bold)))) - `(helm-ff-symlink ((,class (:foreground ,keyword :background ,bg1 :weight bold)))) - `(helm-ff-prefix ((,class (:foreground ,bg1 :background ,keyword :weight normal)))) - `(helm-grep-cmd-line ((,class (:foreground ,fg1 :background ,bg1)))) - `(helm-grep-file ((,class (:foreground ,fg1 :background ,bg1)))) - `(helm-grep-finish ((,class (:foreground ,fg2 :background ,bg1)))) - `(helm-grep-lineno ((,class (:foreground ,fg1 :background ,bg1)))) - `(helm-grep-match ((,class (:foreground ,unspec :background ,unspec :inherit helm-match)))) - `(helm-grep-running ((,class (:foreground ,func :background ,bg1)))) - `(helm-moccur-buffer ((,class (:foreground ,func :background ,bg1)))) - `(helm-source-go-package-godoc-description ((,class (:foreground ,str)))) - `(helm-bookmark-w3m ((,class (:foreground ,type)))) - `(company-echo-common ((,class (:foreground ,bg1 :background ,fg1)))) - `(company-preview ((,class (:background ,bg1 :foreground ,var)))) - `(company-preview-common ((,class (:foreground ,bg2 :foreground ,fg3)))) - `(company-preview-search ((,class (:foreground ,type :background ,bg1)))) - `(company-scrollbar-bg ((,class (:background ,bg3)))) - `(company-scrollbar-fg ((,class (:foreground ,keyword)))) - `(company-tooltip ((,class (:foreground ,fg2 :background ,bg2 :bold t)))) - `(company-tooltop-annotation ((,class (:foreground ,const)))) - `(company-tooltip-common ((,class ( :foreground ,fg3)))) - `(company-tooltip-common-selection ((,class (:foreground ,str)))) - `(company-tooltip-mouse ((,class (:inherit highlight)))) - `(company-tooltip-selection ((,class (:background ,bg3 :foreground ,fg3)))) - `(company-template-field ((,class (:inherit region)))) - `(web-mode-builtin-face ((,class (:inherit ,font-lock-builtin-face)))) - `(web-mode-comment-face ((,class (:inherit ,font-lock-comment-face)))) - `(web-mode-constant-face ((,class (:inherit ,font-lock-constant-face)))) - `(web-mode-keyword-face ((,class (:foreground ,keyword)))) - `(web-mode-doctype-face ((,class (:inherit ,font-lock-comment-face)))) - `(web-mode-function-name-face ((,class (:inherit ,font-lock-function-name-face)))) - `(web-mode-string-face ((,class (:foreground ,str)))) - `(web-mode-type-face ((,class (:inherit ,font-lock-type-face)))) - `(web-mode-html-attr-name-face ((,class (:foreground ,func)))) - `(web-mode-html-attr-value-face ((,class (:foreground ,keyword)))) - `(web-mode-warning-face ((,class (:inherit ,font-lock-warning-face)))) - `(web-mode-html-tag-face ((,class (:foreground ,builtin)))) - `(jde-java-font-lock-package-face ((t (:foreground ,var)))) - `(jde-java-font-lock-public-face ((t (:foreground ,keyword)))) - `(jde-java-font-lock-private-face ((t (:foreground ,keyword)))) - `(jde-java-font-lock-constant-face ((t (:foreground ,const)))) - `(jde-java-font-lock-modifier-face ((t (:foreground ,fg2)))) - `(jde-jave-font-lock-protected-face ((t (:foreground ,keyword)))) - `(jde-java-font-lock-number-face ((t (:foreground ,var)))) - `(yas-field-highlight-face ((t (:background ,selection))))) - ;; Legacy - (if (< emacs-major-version 22) - (custom-theme-set-faces - 'dtmacs - `(show-paren-match-face ((,class (:background ,warning))))) ;; obsoleted in 22.1, removed 2016 - (custom-theme-set-faces - 'dtmacs - `(show-paren-match ((,class (:foreground ,bg1 :background ,str)))) - `(show-paren-mismatch ((,class (:foreground ,bg1 :background ,warning)))))) - ;; emacs >= 26.1 - (when (>= emacs-major-version 26) - (custom-theme-set-faces - 'dtmacs - `(line-number ((t (:inherit fringe)))) - `(line-number-current-line ((t (:inherit fringe :foreground ,fg6 :weight bold)))))) - - ;; emacs >= 27.1 - (when (>= emacs-major-version 27) - (custom-theme-set-faces - 'dtmacs - `(tab-line ((,class (:background ,bg2 :foreground ,fg4)))) - `(tab-line-tab ((,class (:inherit tab-line)))) - `(tab-line-tab-inactive ((,class (:background ,bg2 :foreground ,fg4)))) - `(tab-line-tab-current ((,class (:background ,bg1 :foreground ,fg1)))) - `(tab-line-highlight ((,class (:background ,bg1 :foreground ,fg2)))))) - (when (>= emacs-major-version 28) - (custom-theme-set-faces - 'dtmacs - `(line-number ((t (:inherit fringe)))) - `(line-number-current-line ((t (:inherit fringe :foreground ,fg6 :weight bold)))))) -;; emacs >= 27.1 -(when (>= emacs-major-version 27) - (custom-theme-set-faces - 'dtmacs - `(tab-line ((,class (:background ,bg2 :foreground ,fg4)))) - `(tab-line-tab ((,class (:inherit tab-line)))) - `(tab-line-tab-inactive ((,class (:background ,bg2 :foreground ,fg4)))) - `(tab-line-tab-current ((,class (:background ,bg1 :foreground ,fg1)))) - `(tab-line-highlight ((,class (:background ,bg1 :foreground ,fg2)))))) - (when (>= emacs-major-version 28) - (custom-theme-set-faces - 'dtmacs - `(tab-line-tab-modified ((,class (:foreground ,warning2 :weight bold)))))) - (when (boundp 'font-lock-regexp-face) - (custom-theme-set-faces - 'dtmacs - `(font-lock-regexp-face ((,class (:inherit font-lock-string-face :underline t))))))) - -;;;###autoload -(when load-file-name - (add-to-list 'custom-theme-load-path - (file-name-as-directory (file-name-directory load-file-name)))) - -(provide-theme 'dtmacs) - -;; Local Variables: -;; no-byte-compile: t -;; End: - -;;; dtmacs-theme.el ends here