Initial commit
This commit is contained in:
commit
2a28d0b97a
21 changed files with 132395 additions and 0 deletions
58
userland/browser.el
Normal file
58
userland/browser.el
Normal file
|
@ -0,0 +1,58 @@
|
|||
;;; browser.el --- Web browser configuration and shortcuts -*- lexical-binding: t -*-
|
||||
|
||||
;; This file is not part of GNU Emacs
|
||||
|
||||
;; This program is free software: you can redistribute it and/or modify
|
||||
;; it under the terms of the GNU General Public License as published by
|
||||
;; the Free Software Foundation, either version 3 of the License, or
|
||||
;; (at your option) any later version.
|
||||
|
||||
;; This program is distributed in the hope that it will be useful,
|
||||
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
;; GNU General Public License for more details.
|
||||
|
||||
;; You should have received a copy of the GNU General Public License
|
||||
;; along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
;;; Commentary:
|
||||
|
||||
;; commentary
|
||||
|
||||
;;; Code:
|
||||
|
||||
(defcustom theurgy-city
|
||||
"Perth"
|
||||
"The city used for fetching weather from wttr.in."
|
||||
:type 'string
|
||||
:group 'theurgy
|
||||
:group 'theurgy-weather)
|
||||
|
||||
(defun theurgy-eww-rename-buffer ()
|
||||
"Rename the eww buffer intelligently."
|
||||
(when (eq major-mode 'eww-mode)
|
||||
(let ((url (plist-get eww-data :url)))
|
||||
(cond
|
||||
((string-match-p "wttr.in" url) "*weather*")
|
||||
(t "*eww*")))))
|
||||
|
||||
(setq eww-auto-rename-buffer #'theurgy-eww-rename-buffer)
|
||||
|
||||
(defun theurgy-show-weather ()
|
||||
"Show wttr.in in an eww buffer."
|
||||
(interactive)
|
||||
(if (get-buffer "*weather*")
|
||||
(switch-to-buffer "*weather*")
|
||||
(eww (concat "wttr.in/" theurgy-city "?0"))))
|
||||
|
||||
(add-to-list 'display-buffer-alist
|
||||
'("\\*weather\\*"
|
||||
(display-buffer-in-side-window)
|
||||
(side . left)
|
||||
(slot . 4)
|
||||
(window-width . 0.15)))
|
||||
|
||||
(provide 'browser)
|
||||
|
||||
;;; browser.el ends here
|
104
userland/dired-custom.el
Normal file
104
userland/dired-custom.el
Normal file
|
@ -0,0 +1,104 @@
|
|||
;;; dired-custom.el --- Custom dired config -*- lexical-binding: t -*-
|
||||
|
||||
;; This file is not part of GNU Emacs
|
||||
|
||||
;; This program is free software: you can redistribute it and/or modify
|
||||
;; it under the terms of the GNU General Public License as published by
|
||||
;; the Free Software Foundation, either version 3 of the License, or
|
||||
;; (at your option) any later version.
|
||||
|
||||
;; This program is distributed in the hope that it will be useful,
|
||||
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
;; GNU General Public License for more details.
|
||||
|
||||
;; You should have received a copy of the GNU General Public License
|
||||
;; along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
;;; Commentary:
|
||||
|
||||
;; commentary
|
||||
|
||||
;;; Code:
|
||||
|
||||
(require 'dired)
|
||||
|
||||
(setq dired-listing-switches "-lh")
|
||||
(setq dired-recursive-deletes t)
|
||||
(setq dired-recursive-copies t)
|
||||
|
||||
(defun dired-init ()
|
||||
"Theurgy Dired config."
|
||||
;; Hide file permissions
|
||||
(dired-hide-details-mode 1)
|
||||
;; Kill new buffers
|
||||
(when (>= emacs-major-version 28)
|
||||
(setq dired-kill-when-opening-new-dired-buffer t))
|
||||
(when (< emacs-major-version 28)
|
||||
(progn
|
||||
(define-key dired-mode-map (kbd "RET") 'dired-find-alternate-file)
|
||||
(define-key dired-mode-map (kbd "^") (lambda () (interactive) (find-alternate-file "..")))))
|
||||
;; Human readable file size
|
||||
(setq dired-listing-switches "-lh"))
|
||||
|
||||
(add-hook 'dired-mode-hook 'dired-init)
|
||||
(add-hook 'dired-mode-hook 'auto-revert-mode)
|
||||
|
||||
;; Icons in dired
|
||||
(use-package all-the-icons-dired
|
||||
:config
|
||||
(add-hook 'dired-mode-hook 'all-the-icons-dired-mode))
|
||||
|
||||
;; Multimedia and PDF viewing
|
||||
(when (not (equal system-type 'windows-nt))
|
||||
(use-package ready-player
|
||||
:ensure t
|
||||
:config
|
||||
(setq ready-player-autoplay nil)
|
||||
(ready-player-mode 1))
|
||||
|
||||
(use-package pdf-tools
|
||||
:config (pdf-loader-install)))
|
||||
|
||||
|
||||
;; Preview files
|
||||
(defun dired-preview-to-the-right ()
|
||||
"My preferred `dired-preview-display-action-alist-function'."
|
||||
'((display-buffer-in-side-window)
|
||||
(side . right)
|
||||
(slot . 0)
|
||||
(window-width . 0.3)))
|
||||
|
||||
(use-package dired-preview
|
||||
:after (ready-player)
|
||||
:config
|
||||
(setq dired-preview-display-action-alist #'dired-preview-to-the-right)
|
||||
(setq dired-preview-buffer-name-indicator "[Preview]")
|
||||
(setq dired-preview-ignored-extensions-regexp
|
||||
(concat "\\."
|
||||
"\\(gz\\|"
|
||||
"zst\\|"
|
||||
"tar\\|"
|
||||
"xz\\|"
|
||||
"rar\\|"
|
||||
"zip\\|"
|
||||
"iso\\|"
|
||||
"epub"
|
||||
"\\)"))
|
||||
(dired-preview-global-mode 1))
|
||||
|
||||
;; Automatically kill preview buffers when opening a file
|
||||
(add-hook 'find-file-hook (lambda ()
|
||||
(dolist (buf (buffer-list))
|
||||
(when (string-match-p "\\[Preview\\]" (buffer-name buf))
|
||||
(kill-buffer buf)))))
|
||||
|
||||
(use-package neotree
|
||||
:config
|
||||
(define-key global-map (kbd "<f8>") 'neotree-toggle)
|
||||
(setq neo-theme (if (display-graphic-p) 'icons 'arrow)))
|
||||
|
||||
(provide 'dired-custom)
|
||||
|
||||
;;; dired-custom.el ends here
|
104
userland/flycheck_dired-custom.el
Normal file
104
userland/flycheck_dired-custom.el
Normal file
|
@ -0,0 +1,104 @@
|
|||
;;; dired-custom.el --- Custom dired config -*- lexical-binding: t -*-
|
||||
|
||||
;; This file is not part of GNU Emacs
|
||||
|
||||
;; This program is free software: you can redistribute it and/or modify
|
||||
;; it under the terms of the GNU General Public License as published by
|
||||
;; the Free Software Foundation, either version 3 of the License, or
|
||||
;; (at your option) any later version.
|
||||
|
||||
;; This program is distributed in the hope that it will be useful,
|
||||
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
;; GNU General Public License for more details.
|
||||
|
||||
;; You should have received a copy of the GNU General Public License
|
||||
;; along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
;;; Commentary:
|
||||
|
||||
;; commentary
|
||||
|
||||
;;; Code:
|
||||
|
||||
(require 'dired)
|
||||
|
||||
(setq dired-listing-switches "-lh")
|
||||
(setq dired-recursive-deletes t)
|
||||
(setq dired-recursive-copies t)
|
||||
|
||||
(defun dired-init ()
|
||||
"Theurgy Dired config."
|
||||
;; Hide file permissions
|
||||
(dired-hide-details-mode 1)
|
||||
;; Kill new buffers
|
||||
(when (>= emacs-major-version 28)
|
||||
(setq dired-kill-when-opening-new-dired-buffer t))
|
||||
(when (< emacs-major-version 28)
|
||||
(progn
|
||||
(define-key dired-mode-map (kbd "RET") 'dired-find-alternate-file)
|
||||
(define-key dired-mode-map (kbd "^") (lambda () (interactive) (find-alternate-file "..")))))
|
||||
;; Human readable file size
|
||||
(setq dired-listing-switches "-lh"))
|
||||
|
||||
(add-hook 'dired-mode-hook 'dired-init)
|
||||
(add-hook 'dired-mode-hook 'auto-revert-mode)
|
||||
|
||||
;; Icons in dired
|
||||
(use-package all-the-icons-dired
|
||||
:config
|
||||
(add-hook 'dired-mode-hook 'all-the-icons-dired-mode))
|
||||
|
||||
;; Multimedia and PDF viewing
|
||||
(when (not (equal system-type 'windows-nt))
|
||||
(use-package ready-player
|
||||
:ensure t
|
||||
:config
|
||||
(setq ready-player-autoplay nil)
|
||||
(ready-player-mode 1))
|
||||
|
||||
(use-package pdf-tools
|
||||
:config (pdf-loader-install)))
|
||||
|
||||
|
||||
;; Preview files
|
||||
(defun dired-preview-to-the-right ()
|
||||
"My preferred `dired-preview-display-action-alist-function'."
|
||||
'((display-buffer-in-side-window)
|
||||
(side . right)
|
||||
(slot . 0)
|
||||
(window-width . 0.3)))
|
||||
|
||||
(use-package dired-preview
|
||||
:after (ready-player)
|
||||
:config
|
||||
(setq dired-preview-display-action-alist #'dired-preview-to-the-right)
|
||||
(setq dired-preview-buffer-name-indicator "[Preview]")
|
||||
(setq dired-preview-ignored-extensions-regexp
|
||||
(concat "\\."
|
||||
"\\(gz\\|"
|
||||
"zst\\|"
|
||||
"tar\\|"
|
||||
"xz\\|"
|
||||
"rar\\|"
|
||||
"zip\\|"
|
||||
"iso\\|"
|
||||
"epub"
|
||||
"\\)"))
|
||||
(dired-preview-global-mode 1))
|
||||
|
||||
;; Automatically kill preview buffers when opening a file
|
||||
(add-hook 'find-file-hook (lambda ()
|
||||
(dolist (buf (buffer-list))
|
||||
(when (string-match-p "\\[Preview\\]" (buffer-name buf))
|
||||
(kill-buffer buf)))))
|
||||
|
||||
(use-package neotree
|
||||
:config
|
||||
(define-key global-map (kbd "<f8>") 'neotree-toggle)
|
||||
(setq neo-theme (if (display-graphic-p) 'icons 'arrow)))
|
||||
|
||||
(provide 'dired-custom)
|
||||
|
||||
;;; dired-custom.el ends here
|
40
userland/git-interace.el
Normal file
40
userland/git-interace.el
Normal file
|
@ -0,0 +1,40 @@
|
|||
;;; git-interface.el --- Magit config -*- lexical-binding: t -*-
|
||||
|
||||
;; This file is not part of GNU Emacs
|
||||
|
||||
;; This program is free software: you can redistribute it and/or modify
|
||||
;; it under the terms of the GNU General Public License as published by
|
||||
;; the Free Software Foundation, either version 3 of the License, or
|
||||
;; (at your option) any later version.
|
||||
|
||||
;; This program is distributed in the hope that it will be useful,
|
||||
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
;; GNU General Public License for more details.
|
||||
|
||||
;; You should have received a copy of the GNU General Public License
|
||||
;; along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
;;; Commentary:
|
||||
|
||||
;; commentary
|
||||
|
||||
;;; Code:
|
||||
|
||||
(use-package magit)
|
||||
|
||||
(use-package magit-todos
|
||||
:after (magit)
|
||||
:config (magit-todos-mode 1))
|
||||
|
||||
(add-to-list 'display-buffer-alist
|
||||
'("magit:"
|
||||
(display-buffer-in-side-window)
|
||||
(side . right)
|
||||
(slot . 4)
|
||||
(window-width . 0.2)))
|
||||
|
||||
(provide 'git-interface)
|
||||
|
||||
;;; git-interface.el ends here
|
69
userland/rss.el
Normal file
69
userland/rss.el
Normal file
|
@ -0,0 +1,69 @@
|
|||
;;; rss.el --- RSS feed reading via elfeed -*- lexical-binding: t -*-
|
||||
|
||||
;; This file is not part of GNU Emacs
|
||||
|
||||
;; This program is free software: you can redistribute it and/or modify
|
||||
;; it under the terms of the GNU General Public License as published by
|
||||
;; the Free Software Foundation, either version 3 of the License, or
|
||||
;; (at your option) any later version.
|
||||
|
||||
;; This program is distributed in the hope that it will be useful,
|
||||
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
;; GNU General Public License for more details.
|
||||
|
||||
;; You should have received a copy of the GNU General Public License
|
||||
;; along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
;;; Commentary:
|
||||
|
||||
;; commentary
|
||||
|
||||
;;; Code:
|
||||
|
||||
;; Elfeed and aggregation setup
|
||||
(use-package elfeed
|
||||
:config
|
||||
(setq elfeed-feeds
|
||||
'(;; Planet aggregators
|
||||
("https://planet.emacslife.com/atom.xml" planet emacs))))
|
||||
|
||||
;; This fixes a bug
|
||||
(define-advice elfeed-search--header (:around (oldfun &rest args))
|
||||
(if elfeed-db
|
||||
(apply oldfun args)
|
||||
"No database loaded yet"))
|
||||
|
||||
;; Display the elfeed entry buffer in the main window
|
||||
(setq elfeed-show-entry-switch #'elfeed-display-buffer)
|
||||
|
||||
(defun elfeed-display-buffer (buf &optional act)
|
||||
(pop-to-buffer buf)
|
||||
(delete-other-main-windows))
|
||||
|
||||
;; Navigate elfeed entry from the search window
|
||||
(defun elfeed-search-show-entry-pre (&optional lines)
|
||||
"Returns a function to scroll forward or back in the Elfeed
|
||||
search results, displaying entries without switching to them."
|
||||
(lambda (times)
|
||||
(interactive "p")
|
||||
(forward-line (* times (or lines 0)))
|
||||
(recenter)
|
||||
(call-interactively #'elfeed-search-show-entry)
|
||||
(select-window (previous-window))
|
||||
(unless elfeed-search-remain-on-entry (forward-line -1))))
|
||||
|
||||
(define-key elfeed-search-mode-map (kbd "n") (elfeed-search-show-entry-pre +1))
|
||||
(define-key elfeed-search-mode-map (kbd "p") (elfeed-search-show-entry-pre -1))
|
||||
(define-key elfeed-search-mode-map (kbd "M-RET") (elfeed-search-show-entry-pre))
|
||||
|
||||
(add-to-list 'display-buffer-alist
|
||||
'("\\*elfeed-search\\*"
|
||||
(display-buffer-in-side-window)
|
||||
(side . top)
|
||||
(slot . 0)))
|
||||
|
||||
(provide 'rss)
|
||||
|
||||
;;; rss.el ends here
|
88
userland/scratch.el
Normal file
88
userland/scratch.el
Normal file
|
@ -0,0 +1,88 @@
|
|||
;;; scratch.el --- Custom scratchpads -*- lexical-binding: t -*-
|
||||
|
||||
;; This file is not part of GNU Emacs
|
||||
|
||||
;; This program is free software: you can redistribute it and/or modify
|
||||
;; it under the terms of the GNU General Public License as published by
|
||||
;; the Free Software Foundation, either version 3 of the License, or
|
||||
;; (at your option) any later version.
|
||||
|
||||
;; This program is distributed in the hope that it will be useful,
|
||||
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
;; GNU General Public License for more details.
|
||||
|
||||
;; You should have received a copy of the GNU General Public License
|
||||
;; along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
;;; Commentary:
|
||||
|
||||
;; commentary
|
||||
|
||||
;;; Code:
|
||||
|
||||
;; We have our own scratch buffers, don't need this
|
||||
(add-hook 'emacs-startup-hook (lambda ()
|
||||
(when (get-buffer "*scratch*")
|
||||
(kill-buffer "*scratch*"))))
|
||||
|
||||
(defcustom elisp-scratch-initial-contents
|
||||
";; Emacs lisp scratch buffer\n\n"
|
||||
"Initial text for *elisp scratch*."
|
||||
:type 'string
|
||||
:group 'theurgy
|
||||
:group 'theurgy-scratch)
|
||||
|
||||
(defcustom org-scratch-initial-contents
|
||||
"# Org scratch buffer\n\n"
|
||||
"Initial text for *org scratch*."
|
||||
:type 'string
|
||||
:group 'theurgy
|
||||
:group 'theurgy-scratch)
|
||||
|
||||
(with-current-buffer (generate-new-buffer "*elisp scratch*")
|
||||
(insert elisp-scratch-initial-contents)
|
||||
(emacs-lisp-mode))
|
||||
|
||||
(with-current-buffer (generate-new-buffer "*org scratch*")
|
||||
(insert org-scratch-initial-contents)
|
||||
(org-mode))
|
||||
|
||||
(defun open-elisp-scratch ()
|
||||
(interactive)
|
||||
(switch-to-buffer "*elisp scratch*"))
|
||||
|
||||
(defun open-org-scratch ()
|
||||
(interactive)
|
||||
(switch-to-buffer "*org scratch*"))
|
||||
|
||||
(defun toggle-elisp-scratch ()
|
||||
(interactive)
|
||||
(if (get-buffer-window "*elisp scratch*")
|
||||
(delete-window (get-buffer-window "*elisp scratch*"))
|
||||
(switch-to-buffer "*elisp scratch*")))
|
||||
|
||||
(defun toggle-org-scratch ()
|
||||
(interactive)
|
||||
(if (get-buffer-window "*org scratch*")
|
||||
(delete-window (get-buffer-window "org scratch"))
|
||||
(switch-to-buffer "*org scratch*")))
|
||||
|
||||
(add-to-list 'display-buffer-alist
|
||||
'("\\*elisp scratch\\*"
|
||||
(display-buffer-in-side-window)
|
||||
(side . right)
|
||||
(slot . 1)
|
||||
(window-width . 0.2)))
|
||||
|
||||
(add-to-list 'display-buffer-alist
|
||||
'("\\*org scratch\\*"
|
||||
(display-buffer-in-side-window)
|
||||
(side . right)
|
||||
(slot . 2)
|
||||
(window-width . 0.2)))
|
||||
|
||||
(provide 'scratch)
|
||||
|
||||
;;; scratch.el ends here
|
54
userland/terminal.el
Normal file
54
userland/terminal.el
Normal file
|
@ -0,0 +1,54 @@
|
|||
;;; terminal.el --- Userland terminal with vterm -*- lexical-binding: t -*-
|
||||
|
||||
;; This file is not part of GNU Emacs
|
||||
|
||||
;; This program is free software: you can redistribute it and/or modify
|
||||
;; it under the terms of the GNU General Public License as published by
|
||||
;; the Free Software Foundation, either version 3 of the License, or
|
||||
;; (at your option) any later version.
|
||||
|
||||
;; This program is distributed in the hope that it will be useful,
|
||||
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
;; GNU General Public License for more details.
|
||||
|
||||
;; You should have received a copy of the GNU General Public License
|
||||
;; along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
;;; Commentary:
|
||||
|
||||
;; commentary
|
||||
|
||||
;;; Code:
|
||||
|
||||
(when (not (equal system-type 'windows-nt))
|
||||
(use-package vterm
|
||||
:ensure t))
|
||||
|
||||
(defun theurgy-shell ()
|
||||
(interactive)
|
||||
(if (fboundp 'vterm)
|
||||
'vterm
|
||||
'shell))
|
||||
|
||||
(defun theurgy-bottom-shell ()
|
||||
(interactive)
|
||||
(let ((win (car (window-at-side-list nil 'bottom))))
|
||||
(if (and win (equal 'bottom (window-parameter win 'window-side)))
|
||||
(delete-window win)
|
||||
(funcall (theurgy-shell)))))
|
||||
|
||||
(global-set-key (kbd "M-RET") 'theurgy-bottom-shell)
|
||||
(define-key vterm-mode-map (kbd "M-RET") 'theurgy-bottom-shell)
|
||||
|
||||
(add-to-list 'display-buffer-alist
|
||||
'("\\*vterm\\*\\|\\*shell\\*"
|
||||
(display-buffer-in-side-window)
|
||||
(side . bottom)
|
||||
(slot . 0)
|
||||
(window-height . 0.2)))
|
||||
|
||||
(provide 'terminal)
|
||||
|
||||
;;; terminal.el ends here
|
Loading…
Add table
Add a link
Reference in a new issue