diff --git a/README.org b/README.org index 563a724..55fcc5e 100644 --- a/README.org +++ b/README.org @@ -1,95 +1,9 @@ #+title: Theurgy -Theurgy is an [[https://www.gnu.org/software/emacs/][Emacs]] distribution or configuration base. More specifically, it is my day-to-day configuration. +Theurgy is an Emacs distribution. -Development is guided by these principles (but probably is not strictly adherent to them, feel free to submit PRs): +The focus is to make Emacs a complete, distributable, consistent toolbox. -1. *Keep it portable, keep it consistent:* this configuration must run on multiple systems with vastly different environments. I want to be able to use the same configuration on my Windows/Mac work laptops, as well as my own Linux devices. -2. *Don't reinvent the wheel:* if some functionality exists in vanilla Emacs, prefer it unless there's a good reason not to. This does not mean we are a minimal config - install packages when you need some functionality that is tedious to self-implement. -3. *UX first*: Theurgy should be an efficient tool first and foremost. +Additionally, good UI/UX should be provided on a per-workflow basis. Theurgy is tab oriented, with each tab intended to focus on a different workflow. -* Dependencies -Some packages or flows within Theurgy have external dependencies. Typically, in this case we check if the dependency exists (or we hope that the downstream package does that for us). The complete list of packages with external dependencies is here for your perusal. - -- [[https://github.com/vedang/pdf-tools][pdf-tools]]: requires epdfinfo. This is disabled on Windows systems by default, customize =theurgy-enable-pdf-tools-windows=. -- [[https://github.com/xenodium/ready-player][ready-player]]: requires mpv and ffmpeg. This is disabled on Windows systems by default, customize =theurgy-enable-ready-player-windows=. -- [[https://github.com/akermu/emacs-libvterm][vterm]]: requires libvterm. This is disabled on Windows systems by default, customize =theurgy-enable-vterm-windows=. If vterm is not available, theurgy will fall back to the standard Emacs shell for terminal emulation. - -Here is the complete list of other optional dependencies: -- [[https://github.com/hunspell/hunspell][Hunspell]]: if Hunspell is installed, Theurgy will use it and a dictionary file in the =user-emacs-directory= to provide completions with both flyspell and ispell. The =theurgy-hunspell-dict= variable can be customized to select a different dictionary than the =en_AU.dict= used by default. Additionally, the =ispell-dictionary= and =ispell-local-dictionary-alist= variables should be customised accordingly to get rid of the =en_AU= locale. -- =all-the-icons=: =all-the-icons= requires icons to be manually installed with =all-the-icons-install-fonts= at least once. -- [[https://git.cyan.sh/BirDt/ouroboros-emacs-themes][Ouroboros Emacs Themes]]: Ouroboros themes depend on [[https://git.cyan.sh/BirDt/ouroboros-emacs-themes#headline-6][3 fonts]] to properly display. These themes are not automatically loaded, so you may choose to load any other theme. - - -In addition, =git= is a _hard dependency_ that must be installed for Theurgy to work. - -* Running as a Server -I make no claims of startup speed, and I recommend running Emacs as a server and connecting to it with the client. You can do this by running =emacs --daemon= in any terminal. - -If using =bspwm= and =sxhkd=, I suggest the following keyinds to make use of everything Theurgy has to offer: - -#+begin_src fundamental - super + Return - emacsclient --create-frame --eval "(progn (set-frame-parameter nil 'tab-bar-lines 0) (theurgy-main-shell))" - - super + alt + e - bspc rule -a '*' -o state=floating; emacsclient --eval "(emacs-everywhere)" - - super + e - emacsclient --create-frame - - super + ctrl + e - bspc rule -a '*' -o state=floating; emacsclient --create-frame -e '(progn (select-frame-set-input-focus (selected-frame)) (org-capture))' - -#+end_src - -* Opinionated Stuff -This is a list of files/flows that are very opinionated and you may wish to delete from the configuration, or heavily modify. - -** Org-Mode -My =org-mode= workflow is _VERY_ opinionated, and at the time of writing a lot of values are hard-coded. - -The whole =workflows/org-custom.el= file assumes a directory tree like this in =~/.org=: - -#+begin_src fundamental - . - ├── documents - ├── latex-templates - ├── lore - │   ├── assets - │   ├── raw - │   └── refined - │   ├── essay - │   ├── journal - │   ├── lightning - │   └── wiki - └── tasks - ├── maintenance - └── projects - └── career -#+end_src - -You can read more about this configuration [[https://www.cyan.sh/blog/posts/architecting-a-better-org-workflow.html][here]], but you may wish to =M-% ~/.org= to your own org directory, or simply get rid of all irrelevant code. - -* Workflow - -** Working With Tabs -Theurgy is focused on a tab and project based workflow, with each tab generally corresponding to a single project. New tabs can be created with =C-t 2= and deleted with =C-t 0= (this prefix is different from vanilla to avoid conflicts with some modes). You can navigate between tabs with =C-= and =C-S-=. - -When creating a new tab, Theurgy will open the dashboard. Pressing =p= at the dashboard will allow you to select any [[github.com/SalOrak/whaler.el][whaler]] project, the list of which can be customized with =whaler-directories-alist= and =whaler-oneoff-directories-alist=. You can also customize the =theurgy-project-default-file-alist= to select which file should open by default when visiting a project. - -Each tab stores the directory of the current project in the tab group name, and this allows other buffers (such as neotree) to reliably get the project directory when the tab changes. If you want to add other functions to run on tab change, Theurgy provides a =tab-bar-select-tab-hook= to do so, and you can fetch the project directory with =theurgy-get-tab-project-dir=. - -** Navigation - -*** The Mouse -By default, Theurgy enforces mouse-less navigation by unbinding every mouse button. You can turn mouse clicking back on by customizing =theurgy-mouse-disabled=. - -*** Keybindings -Theurgy does not use Evil, but it doesn't strictly adhere to Emacs binding conventions either. You may not like this. - -*** Line Number Jumping -=M-g g= and =M-g r= allow you to jump to absolute and relative line numbers respectively. When used, the current buffer will temporarily have the desired line number type enabled. Pressing =C-g= before jumping to a line number will cause the displayed line number type to change permanently for that buffer. - -** Extension -Theurgy can be extended by placing any arbitrary Emacs Lisp files in =./workflows= (to use for specific mode customisations), =./userland= (to use for application replacements), and =./screens= (to use for specific GUIs and layouts). +Theurgy is very opinionated, but easy to modify. diff --git a/ui.el b/ui.el index 27569ac..94098d6 100644 --- a/ui.el +++ b/ui.el @@ -174,11 +174,6 @@ (use-package flycheck :hook ((after-init . global-flycheck-mode))) -;; Emacs-everywhere -(use-package emacs-everywhere - :config - (setq emacs-everywhere-frame-parameters '((name . "emacs-everywhere") (height . 18) (width . 80) (tab-bar-lines . 0)))) - (provide 'ui) ;;; ui.el ends here diff --git a/userland/dired-custom.el b/userland/dired-custom.el index 6b91725..f684798 100644 --- a/userland/dired-custom.el +++ b/userland/dired-custom.el @@ -50,27 +50,14 @@ :config (add-hook 'dired-mode-hook 'all-the-icons-dired-mode)) -(defcustom theurgy-enable-pdf-tools-windows nil - "Whether `pdf-tools' should be enabled on Windows sytems." - :type 'boolean - :group 'theurgy - :group 'theurgy-compat) - -(defcustom theurgy-enable-ready-player-windows nil - "Whether `ready-player' should be enabled on Windows sytems." - :type 'boolean - :group 'theurgy - :group 'theurgy-compat) - ;; Multimedia and PDF viewing -(when (or (not (equal system-type 'windows-nt)) theurgy-enable-ready-player-windows) +(when (not (equal system-type 'windows-nt)) (use-package ready-player :ensure t :config (setq ready-player-autoplay nil) - (ready-player-mode 1))) + (ready-player-mode 1)) -(when (or (not (equal system-type 'windows-nt)) theurgy-enable-pdf-tools-windows) (use-package pdf-tools :config (pdf-loader-install))) diff --git a/userland/projects.el b/userland/projects.el index 189b159..f2a4d52 100644 --- a/userland/projects.el +++ b/userland/projects.el @@ -50,23 +50,13 @@ (find-file (get-project-default-file dir)) (tab-rename (file-name-nondirectory (string-remove-suffix "/" dir))) (tab-bar-change-tab-group (concat "project: " dir)) ;; We use the tab group name to store the project working directory - (save-selected-window - (neotree-dir dir))))) + (neotree-dir dir)))) (defun theurgy-swap-to-tab-project () "Go to the project dir of the tab group." (let ((tab-group-name (tab-bar-tab-group-default (tab-bar--current-tab)))) - (when (and tab-group-name (string-match-p "^project:" tab-group-name)) - (save-selected-window - (neotree-dir (string-remove-prefix "project: " tab-group-name)))))) - -(defun theurgy-get-tab-project-dir () - "Get the directory of the project in the current tab. -This returns nil if no project is found." - (let ((tab-group-name (tab-bar-tab-group-default (tab-bar--current-tab)))) - (if (and tab-group-name (string-match-p "^project:" tab-group-name)) - (string-remove-prefix "project: " tab-group-name) - nil))) + (when (string-match-p "^project:" tab-group-name) + (neotree-dir (string-remove-prefix "project: " tab-group-name))))) (add-hook 'tab-bar-select-tab-hook #'theurgy-swap-to-tab-project) diff --git a/userland/terminal.el b/userland/terminal.el index c2d1377..d99ed8f 100644 --- a/userland/terminal.el +++ b/userland/terminal.el @@ -22,13 +22,7 @@ ;;; Code: -(defcustom theurgy-enable-vterm-windows nil - "Whether `vterm' should be enabled on Windows sytems." - :type 'boolean - :group 'theurgy - :group 'theurgy-compat) - -(when (or (not (equal system-type 'windows-nt)) theurgy-enable-vterm-windows) +(when (not (equal system-type 'windows-nt)) (use-package vterm :ensure t)) diff --git a/workflows/org-custom.el b/workflows/org-custom.el index 0d1b1fc..d7c4eff 100644 --- a/workflows/org-custom.el +++ b/workflows/org-custom.el @@ -75,13 +75,11 @@ ) (defun theurgy-refresh-org-files () - "Revert all agenda file buffers in the background." + "Alternative to revert-all-org-buffers, which is a bit more intelligent." (interactive) (dolist (f org-agenda-files) - (let ((buf (find-buffer-visiting f))) - (when buf - (with-current-buffer buf - (revert-buffer :ignore-auto :noconfirm)))))) + (with-current-buffer (find-file-noselect f t) + (revert-buffer t t)))) (theurgy-refresh-org-files) @@ -108,7 +106,7 @@ ;; Side tree (defun conditional-side-tree () - (when (not (string-match-p "\\*capture\\*\\|CAPTURE-\\|scratch\\*\\|\\[Preview\\]" (buffer-name))) + (when (not (string-match-p "\\*capture\\*\\|CAPTURE-\\|scratch\\*" (buffer-name))) (org-side-tree))) (use-package org-side-tree diff --git a/writing.el b/writing.el index 10840ef..04a2a04 100644 --- a/writing.el +++ b/writing.el @@ -34,12 +34,6 @@ ;; Enable narrowing (put 'narrow-to-region 'disabled nil) -(defcustom theurgy-hunspell-dict "en_AU.dict" - "The dictionary file to provide to hunspell." - :type 'string - :group 'theurgy - :group 'theurgy-writing) - ;;; Spell Checking ;; Use hunspell if available (if (file-exists-p "/usr/bin/hunspell")