diff options
Diffstat (limited to '.config/emacs/bd-default.el')
-rw-r--r-- | .config/emacs/bd-default.el | 103 |
1 files changed, 103 insertions, 0 deletions
diff --git a/.config/emacs/bd-default.el b/.config/emacs/bd-default.el new file mode 100644 index 0000000..23fcf26 --- /dev/null +++ b/.config/emacs/bd-default.el @@ -0,0 +1,103 @@ +;; -*- lexical-binding: t; -*- + + +;;;; packages +(require 'package) +(add-to-list 'load-path "/home/bdunahu/.guix-profile/share/emacs/site-lisp") +(guix-emacs-autoload-packages) + +(require 'use-package-ensure) +(setopt use-package-always-ensure t) +;; (setq use-package-verbose t) ; for debugging + + +(setenv "PATH" (format "%s:%s" "/home/bdunahu/Personal/scripts/" (getenv "PATH"))) + + +;;;; do not store customized setting (automatic) here +(setq custom-file "/home/bdunahu/.config/emacs/custom.el") +(load custom-file t) + + +;;;; functions +(defun request-sudo () + "Uses TRAMP to edit currently opened file as root." + (interactive) + (when buffer-file-name + (find-alternate-file + (concat "/sudo:root@localhost:" + buffer-file-name)))) + +(defun rip-video () + "If region, open SEARCH with mpv in --full-screen. Else, +open URL at point." + (interactive) + (let ((URL-OR-SEARCH + (if (use-region-p) + (buffer-substring (mark) (point)) + (shr-url-at-point nil)))) + (message "Ludu %s" URL-OR-SEARCH) + (start-process-shell-command "rip-video" nil (concat "rip-video " URL-OR-SEARCH)))) + + +;;;; defaults +(global-unset-key (kbd "C-z")) +(global-unset-key (kbd "C-x C-z")) ; terrible binding + +(global-set-key (kbd "C-z =") 'text-scale-increase) +(global-set-key (kbd "C-z -") 'text-scale-decrease) + +(setopt inhibit-startup-message t) +(menu-bar-mode -1) +(tool-bar-mode -1) +(scroll-bar-mode -1) +(require 'display-line-numbers) + +(global-auto-revert-mode 1) +(winner-mode 1) + +;; prompts +(setopt use-short-answers t) +(setopt vc-follow-symlinks t) + +(setopt kill-whole-line t) + +;; allow one side window per side of frame +(setopt window-sides-slots '(1 1 1 1)) + +(setopt scroll-up-aggressively '0.0 + scroll-down-aggressively '0.0) + +;; move backups to tmp folder +(setopt backup-directory-alist `(("." . ,(expand-file-name "tmp/backups/" user-emacs-directory)))) +(make-directory (expand-file-name "tmp/auto_saves/" user-emacs-directory) t) +;; move auto-saves to tmp folder +(setopt auto-save-list-file-prefix (expand-file-name "tmp/auto_saves/sessions/" user-emacs-directory) + auto-save-file-transforms `((".*" ,(expand-file-name "tmp/auto_saves/" user-emacs-directory) t))) + + +;;;; built-in packages +(use-package newsticker + :demand t + :bind (("C-z C-n" . newsticker-show-news) + :map newsticker-treeview-item-mode-map + ("C-j" . rip-video)) + :custom + (newsticker-url-list-defaults nil) + (newsticker-automatically-mark-items-as-old nil) + (newsticker-url-list '(("Ambrose and Elsewhere" "https://jamesenge.com/engeblog/feed" nil nil nil) + ("James Enge Mastodon" "https://mastodon.sdf.org/@jamesenge.rss" nil nil nil) + ("Book Reviews | Tales From the Magician's Skull" "https://goodman-games.com/tftms/category/book-reviews/feed" nil nil nil) + ("Arch Linux: Recent news updates" "https://archlinux.org/feeds/news/" nil nil nil) + ("Parabola GNU/Linux-libre: Recent news updates" "https://www.parabola.nu/feeds/news/" nil nil nil) + ("suckless.org news" "https://suckless.org/atom.xml" nil nil nil) + ("Mental Outlaw" "https://vid.puffyan.us/feed/channel/UC7YOGHUfC1Tb6E4pudI9STA" nil nil nil) + ("Luke Smith" "https://vid.puffyan.us/feed/channel/UC2eYFnH61tmytImy1mTYvhA" nil nil nil) + ("Brent Westbrook" "https://yewtu.be/feed/channel/UC0PBefyEK7qQ7HN325nUamQ" nil nil nil) + ("Bugswriter" "https://yewtu.be/feed/channel/UCngn7SVujlvskHRvRKc1cTw" nil nil nil) + ("Protesilaos Stravrou" "https://yewtu.be/feed/playlist/PL8Bwba5vnQK14z96Gil86pLMDO2GnOhQ6" nil nil nil))) + ;; may require ./newsticker/groups to be cleared + (newsticker-groups '("Feeds" + ("READING" "Ambrose and Elsewhere" "James Enge Mastodon" "Book Reviews | Tales From the Magician's Skull") + ("TECH" ("GNU/Linux" "Arch Linux: Recent news updates" "Parabola GNU/Linux-libre: Recent news updates") "suckless.org news") + ("VIDEO" "Mental Outlaw" "Luke Smith" "Brent Westbrook" "Bugswriter" "Protesilaos Stravrou")))) |