From 0de6b5dfb574ddf3293174ca52099fd567a35e96 Mon Sep 17 00:00:00 2001 From: Mountain Man <43313373+MountainMan1312@users.noreply.github.com> Date: Sun, 4 Jun 2023 23:18:13 -0400 Subject: Rename `xinitrc` to `.xinitrc` --- .xinitrc | 18 ++++++++++++++++++ xinitrc | 18 ------------------ 2 files changed, 18 insertions(+), 18 deletions(-) create mode 100644 .xinitrc delete mode 100644 xinitrc diff --git a/.xinitrc b/.xinitrc new file mode 100644 index 0000000..795714b --- /dev/null +++ b/.xinitrc @@ -0,0 +1,18 @@ +# .xinitrc for MMOSMacs +# This script is executed when running the `startx` command. + + +# Make Java applications aware this is a non-reparenting window manager +export _JAVA_AWT_WM_NONREPARENTING=1 + + +# Set default cursor +xsetroot -cursor_name left_ptr + + +# Set keyboard repeat rate +xset r rate 200 60 + + +# Start emacs +exec dbus-launch --exit-with-session emacs diff --git a/xinitrc b/xinitrc deleted file mode 100644 index 795714b..0000000 --- a/xinitrc +++ /dev/null @@ -1,18 +0,0 @@ -# .xinitrc for MMOSMacs -# This script is executed when running the `startx` command. - - -# Make Java applications aware this is a non-reparenting window manager -export _JAVA_AWT_WM_NONREPARENTING=1 - - -# Set default cursor -xsetroot -cursor_name left_ptr - - -# Set keyboard repeat rate -xset r rate 200 60 - - -# Start emacs -exec dbus-launch --exit-with-session emacs -- cgit v1.2.3 From ea88979731f4175b5ec505bc7fb20f779d21d7f5 Mon Sep 17 00:00:00 2001 From: Mountain Man <43313373+MountainMan1312@users.noreply.github.com> Date: Sun, 4 Jun 2023 23:58:15 -0400 Subject: Overhaul `README.md` --- README.md | 74 ++++++++++++++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 64 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 86c24d1..bf25387 100644 --- a/README.md +++ b/README.md @@ -1,34 +1,88 @@ # MMOSMacs -MMOSMacs is the Emacs configuration for MMOS, which is currently just an -idea I have for an Emacs-centric Linux distribution. MMOSMacs is the -core of my computing experience, and is designed to be a -jack-of-all-trades just like me. +MMOSMacs is my personal Emacs configuration, but it's also the precursor to a project I'm planning, ***Elder Linux***, which will be completely based around Emacs as a desktop environment. + +MMOSMacs is the core of my computing experience, and is meant to be a jack of all trades, just like me. As such, this is a "kitchen sink" configuration. I make no attempt to separate my personal preferences from the main functionality. ## Installation +### Get the files in place + First, clone this repository into your `~/.emacs.d` directory. + ```bash -cd -git clone https://github.com/MountainMan1312/MMOSMacs.git .emacs.d +git clone https://github.com/MountainMan1312/MMOSMacs.git ~/.emacs.d ``` -Next create symlinks to the `xinitrc` and `emacs.desktop` files so X +Next create symlinks to the `.xinitrc` and `emacs.desktop` files so X knows what to do: + ```bash # Backup your `.xinitrc` file if you feel like it. # Replace `.xinitrc.old` with whatever you want to name the backup. -mv .xinitrc .xinitrc.old +mv ~/.xinitrc ~/.xinitrc.old # Symlink your `.xinitrc` file -ln -s .emacs.d/xinitrc .xinitrc +ln -s ~/.emacs.d/.xinitrc ~/.xinitrc # Symlink `emacs.desktop` to add MMOSMacs as an entry to your Display # Manager / login screen. -sudo ln -s .emacs.d/emacs.desktop /usr/share/xsessions/emacs.desktop +sudo ln -s ~/.emacs.d/emacs.desktop /usr/share/xsessions/emacs.desktop +``` + +Optionally create a symlink to the `.sbclrc` file for SBCL: + +```bash +ln -s ~/.emacs.d/.sbclrc ~/.sbclrc +``` + +### Install necessary packages + +You'll also need the following packages installed on your system. Gentoo packages are listed, you'll have to find your distro's equivalent on your own: + +- app-admin/sudo +- app-dicts/aspell +- app-editors/emacs (USE="dynamic-loading gui jit libxml2 threads") +- app-emacs/emacs-common (USE="gui libxml2 X") +- app-emacs/emacs-daemon +- dev-lang/ghc +- dev-lang/rust +- dev-lang/sbcl +- dev-util/shellcheck +- dev-vcs/git +- media-fonts/jetbrains-mono +- media-fonts/noto +- net-libs/nodejs +- net-p2p/syncthing +- sys-devel/gcc (USE="jit") +- x11-apps/setxkbmap +- x11-base/xorg-server +- x11-misc/arandr + + +### Setup `~/kb` and Syncthing for `org-roam` knowledgebase + +Next you need to setup the `~/kb` directory, which will contain: + +- `org-roam-directory` +- `org-agenda-files` + +Follow [the Syncthing documentation](https://docs.syncthing.net/) and [the Gentoo Wiki entry for Syncthing](https://wiki.gentoo.org/wiki/Syncthing) to get Syncthing setup. + +If you need to access the Syncthing GUI from a different computer, you can allow this by modifying `~/.config/syncthing/config.xml`. Find the following in that file: + +```xml + +
127.0.0.1:40469
+ KoafJAnTpYxPSuywYmk9fNP2gpuVLFfb + black ``` +Change the `
127.0.0.1:40469
` part to `
0.0.0.0:40469
` to allow connections from other computers. Be sure to disable this once you've got Syncthing setup for security. + + + ## Plans -- cgit v1.2.3 From 3ee66e8222f387ec55002e3a77a493ea78d6f28a Mon Sep 17 00:00:00 2001 From: Mountain Man <43313373+MountainMan1312@users.noreply.github.com> Date: Mon, 5 Jun 2023 00:03:09 -0400 Subject: Fix formatting for Syncthing instructions in `README.md` --- README.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index bf25387..3c25ceb 100644 --- a/README.md +++ b/README.md @@ -75,12 +75,14 @@ If you need to access the Syncthing GUI from a different computer, you can allow ```xml
127.0.0.1:40469
- KoafJAnTpYxPSuywYmk9fNP2gpuVLFfb - black ``` -Change the `
127.0.0.1:40469
` part to `
0.0.0.0:40469
` to allow connections from other computers. Be sure to disable this once you've got Syncthing setup for security. +Change it to the following, but be sure to disable it later for security: +```xml + +
0.0.0.0:40469
+``` -- cgit v1.2.3 From 2b4d47ac6942a179eb8d93ad254bef35a5a0feda Mon Sep 17 00:00:00 2001 From: Mountain Man <43313373+MountainMan1312@users.noreply.github.com> Date: Mon, 5 Jun 2023 00:43:33 -0400 Subject: Fix `mc/cmds-to-run-for-all` --- init.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.el b/init.el index 76cc321..bea8f5c 100644 --- a/init.el +++ b/init.el @@ -532,7 +532,7 @@ :straight t :bind (("s-m" . mc/mark-more-like-this-extended)) :config - (setq mc/cmds + (setq mc/cmds-to-run-for-all '(electric-pair-delete-pair end-of-visual-line beginning-of-visual-line -- cgit v1.2.3 From c07558da3caaf436742d541be638b78396ea88d5 Mon Sep 17 00:00:00 2001 From: Mountain Man <43313373+MountainMan1312@users.noreply.github.com> Date: Mon, 5 Jun 2023 21:58:58 -0400 Subject: Rewrite `CONTRIBUTING.md` --- CONTRIBUTING.md | 73 +++++++++++++++++---------------------------------------- 1 file changed, 21 insertions(+), 52 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index c331bf9..e7a3942 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,69 +1,55 @@ # Contributing to MMOSMacs -Howdy, and welcome to the MMOSMacs git repository. This document -outlines the conventions and standards for the project. +Howdy, and welcome to the MMOSMacs git repository. This document outlines the conventions and standards for contributing to the project. ## This is personal -Please understand that this is my personal Emacs configuration. MMOSMacs -is designed to meet my personal needs. I welcome any and all -contributions, and I will do my best to make MMOSMacs accessible to -others, but my needs and preferences ultimately take priority. +Please understand that this is my personal Emacs configuration. MMOSMacs is designed to meet my personal needs. I welcome any and all contributions, and I will do my best to make MMOSMacs accessible to others, but my needs and preferences ultimately take priority. -All contributors are listed at the end of this document. If you have -contributed and your name does not appear here, submit a PR or RFC Issue -for it to be added. +All contributors are listed at the end of this document. If you have contributed and your name does not appear here, submit a PR or RFC Issue for it to be added. ## Code of Conduct I will reject all contributions from: -- people who abuse other contributors. +- people who abuse me or other contributors. - people I know to be affiliated with any state agency. Furthermore, individual items will be rejected because of: - exceptionally vulgar language. -- ignorance or disregard of the `STYLE_GUIDE.md` or Issue templates. +- ignorance or disregard of `STYLE_GUIDE.md`. ## How to Contribute There are several ways you can contribute. -The easiest way you can contribute is by taking part in the discussions -on the [GitHub Issues page](https://github.com/MountainMan1312/MMOSMacs/issues). -You can comment on topics that already have an existing Issue, or you -can submit your own if it does not already exist. Issues can take the -form of: +The easiest way you can contribute is by taking part in the discussions on the [GitHub Issues page](https://github.com/MountainMan1312/MMOSMacs/issues). You can comment on topics that already have an existing Issue, or you can submit your own if it does not already exist. Issues can take the form of: + - **RFC**: discussion about making a change to MMOSMacs. - **Bug Report**: discusion about a problem with the MMOSMacs code. - **Feedback**: share your thoughts about MMOSMacs. -Before submitting a new issue, search for existing duplicate issues. If -it already exists, comment on the existing Issue instead of making a new -one. Duplicate issues will be removed and you will be asked to move your -post to the comment section of the existing post. It's not to be rude, -it's just for organization's sake. +Before submitting a new issue, search for existing duplicate issues. If it already exists, comment on the existing Issue instead of making a new one. Duplicate issues will be removed and you will be asked to move your post to the comment section of the existing post. It's not to be rude, it's just for organization's sake. To contribute code: + 1. Make an RFC or find an existing one 2. Discuss your proposed changes 3. Create a branch 4. Make your changes 5. Submit a Pull Request +6. Wait for feedback ### RFC Issues, branches, commits, & Pull Requests #### Writing an RFC -RFCs are the main form of project management for this repository. All -major changes to MMOSMacs should have an associated RFC. RFC Issues -should be named in the format `RFC: TITLE`, where title is a short -description of the proposed changes. For example, the RFC to modify a -few default Emacs things as a starting point for MMOSMacs is called -`RFC: Start with sensible defaults`. +RFCs are the main way contributors can request or suggest changes. I do not use RFCs as project management, so there may be plans that haven't been discussed anywhere. + +RFC Issues should be named in the format `RFC: TITLE`, where title is a short description of the proposed changes. For example, the RFC to modify a few default Emacs things as a starting point for MMOSMacs is called `RFC: Start with sensible defaults`. The following template should be used when writing an RFC. @@ -75,21 +61,17 @@ Provide a one-paragraph summary of the proposed changes # Rationale and motivation -Explain why this change is necessary or desirable. Relate to any other -relevant RFCs, Bug Reports, or Feedback. Feel free to link to Issues -from other repositories as well. +Explain why this change is necessary or desirable. Relate to any other relevant RFCs, Bug Reports, or Feedback. Feel free to link to Issues from other repositories as well. # Details -Provide an in-depth description of your proposed changes. This should -get into specifics and corner-cases. +Provide an in-depth description of your proposed changes. This should get into specifics and corner-cases. # Drawbacks and Alternatives (optional) -Why should these changes NOT be implemented? What other options are -there, and why are these changes better than the alternatives? +Why should these changes NOT be implemented? What other options are there, and why are these changes better than the alternatives? # Additional resources (optional) @@ -105,27 +87,14 @@ Ask any further questions you have. #### Creating branches & committing changes -All changes made as part of an RFC should be made in an associated -branch. The branch should be named in the format `TYPE/#/TITLE`, where -TYPE is one of `RFC, BUG`, X is the Issue number, and TITLE is a short -summary of the RFC title. For example the branch for -`RFC: Start with sensible defaults` is named `RFC/2/sensible-defaults`. -Branch names should be short, with an absolute maximum of 72 characters -(preferrably shorter). +All changes made as part of an RFC should be made in an associated branch. The branch should be named in the format `TYPE/#/TITLE`, where TYPE is one of `RFC, BUG`, X is the Issue number, and TITLE is a short summary of the RFC title. For example the branch for +`RFC: Start with sensible defaults` is named `RFC/2/sensible-defaults`. Branch names should be short, with an absolute maximum of 72 characters (preferrably shorter). -Commits should be small and nuclear. They should each do "one thing". -That said, multiple files could theoretically be affected by a single -commit. Commit messages should be brief, but not omit any necessary -detail. +Commits should be small and nuclear. They should each do "one thing". That said, multiple files could theoretically be affected by a single commit. Commit messages should be brief, but not omit any necessary detail. #### Writing a Pull Request -Like RFCs, all major changes to MMOSMacs must have an associated Pull -Reqest, which explains in detail the changes that were made. Pull -Requests are reviewed before the changes are accepted into the stable -branch, and it is likely that the reviewer will reject your changes with -notes on what needs to be fixed. +Like RFCs, all major changes to MMOSMacs must have an associated Pull Reqest, which explains in detail the changes that were made. Pull Requests are reviewed before the changes are accepted into the stable branch, and it is likely that the reviewer will reject your changes with notes on what needs to be fixed. -Pull Requests should explain the specifics and nuances of the changes -contained therein. +Pull Requests should explain the specifics and nuances of the changes contained therein. -- cgit v1.2.3 From 92a8c0e8bd0d7fb0b2a4676f73bbb57eae6776e4 Mon Sep 17 00:00:00 2001 From: Mountain Man <43313373+MountainMan1312@users.noreply.github.com> Date: Mon, 5 Jun 2023 21:59:35 -0400 Subject: Rewrite `STYLE_GUIDE.md` --- STYLE_GUIDE.md | 44 ++++++++++++++++---------------------------- 1 file changed, 16 insertions(+), 28 deletions(-) diff --git a/STYLE_GUIDE.md b/STYLE_GUIDE.md index d1e4e6b..568f63e 100644 --- a/STYLE_GUIDE.md +++ b/STYLE_GUIDE.md @@ -13,40 +13,27 @@ Much of this Style Guide was taken from ## Organization -Emacs Lisp files should begin with a header. The first line of the -header should include the filename, a very brief comment (2-5 words), -and the `-*- lexical-binding: t; -*-` thing. The next line(s) should be -a more detailed description of the file and it's purpose. +Emacs Lisp files should begin with a header. The first line of the header should include the filename, a very brief comment (2-5 words), and the `-*- lexical-binding: t; -*-` thing. The next line should be `;;`, and the next should be `;;; Commentary:`, below which should be a more detailed description of the file and it's purpose, as well as any important notes or warnings. ```elisp -;;; -*- lexical-binding: t; -*- -;;; init.el +;;; init.el --- Init file for MMOSMacs -*- lexical-binding: t; -*- ;; -;; Main config file for MMOSMacs; the glue that binds the modules -;; together. Provides package management, performance tweaks, and -;; integrates all the other MMOSMacs modules. +;;; Commentary: +;; Main config file for MMOSMacs. ``` -All Emacs Lisp files are organized into Sections and Subsections using -comment decorations. Section titles begin with `;;;`, are ALL CAPS, and -their decorations extend up to 72 chars. Subsections begin with `;;` -and their decorations extend up to 36 chars. Titles should be underlined -with dashes on the proceeding line. Explanatory comments go below the -title underline, and an additional 36-or-72-char line goes at the bottom -of the header. +All Emacs Lisp files are organized into Sections and Subsections using comment decorations. Section titles begin with `;;;` and their decorations extend up to 72 chars. Subsections begin with `;;` and their decorations extend up to 36 chars. Titles should be underlined with dashes on the proceeding line. Explanatory comments go below the +title underline, and an additional 36-or-72-char line goes at the bottom of the header. -Each subsection should have 2 blank lines between the top line of the -header and the bottom line of code from the previous subsection. Only -one line goes between the Section header and the first Subsection, as -well as between portions of code within the same subsection. 4 lines go -between a new Section header and the previous bit of code. +Each subsection should have 2 blank lines between the top line of the header and the bottom line of code from the previous subsection. Only one line goes between the Section header and the first Subsection, as well as between portions of code within the same subsection. 4 lines go between a new Section header and the previous bit of code. ```elisp -;; integrates all the other MMOSMacs modules. +;;; Commentary: +;; Main configuration file for MMOSMacs. ;; --------------------------------------------------------------------- -;;; FIRST SECTION TITLE +;;; First Section Title ;; -------------------- ;; Comments about the purpose of the section go here. ;; It should be concise. Don't go into too much detail. @@ -72,7 +59,8 @@ between a new Section header and the previous bit of code. (setq some-crap nil)) ;; `something-else` is a little less -;; likely to be a package +;; likely to be a package, but it +;; wouldn't surprise me (use-package something-else :straight t) @@ -87,7 +75,7 @@ between a new Section header and the previous bit of code. ;; I really don't know what to write ;; in these example comments. (use-package some-other-thing - :straight + :straight t :init (other-thing-mode)) @@ -107,8 +95,8 @@ between a new Section header and the previous bit of code. - Write heading comments with 3 semicolons, and regular comments with 2. - Write margin comments with 1 semicolon. -- Leave 1 space between the semicolons and the comment text. -- Comments longer than 1 word are capitalized and use punctuation. +- Put a space between the semicolon and the text for heading and regular comments. +- Do not put a space between the semicolon and the text for margin comments. ```elisp ;;; This is a heading comment @@ -116,7 +104,7 @@ between a new Section header and the previous bit of code. ;; Something something something. (defun foo (bar) (something something - something-else)) ; for some other reason + something-else)) ;this is a margin comment ``` -- cgit v1.2.3 From 218aec949728c959ee01ba1d5147ab3d1fa1e786 Mon Sep 17 00:00:00 2001 From: Mountain Man <43313373+MountainMan1312@users.noreply.github.com> Date: Mon, 5 Jun 2023 22:06:32 -0400 Subject: Add first-time-running-emacs setup instructions --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index 3c25ceb..acb8cd0 100644 --- a/README.md +++ b/README.md @@ -84,6 +84,14 @@ Change it to the following, but be sure to disable it later for security:
0.0.0.0:40469
``` +### Run MMOSMacs for the first time + +`cd` into your home directory and run `startx` to launch MMOSMacs for the first time. There might be some weird stuff that happens and some warnings, so `M-x kill-emacs` and `startx` again. + +Then, run the first-time-setup commands for the following packages: + +- `M-x all-the-icons-install-fonts RET y` +- `M-x lsp-install-server RET bash-ls RET` ## Plans -- cgit v1.2.3 From fa2f2cb4b0c7546770f0e334192dc681f64042e5 Mon Sep 17 00:00:00 2001 From: Mountain Man <43313373+MountainMan1312@users.noreply.github.com> Date: Mon, 5 Jun 2023 22:07:46 -0400 Subject: Mass cleanup of mistakes, bad idea but fuck it --- init.el | 127 ++++++++++++++++++++++++++++++++-------------------------------- 1 file changed, 64 insertions(+), 63 deletions(-) diff --git a/init.el b/init.el index bea8f5c..d92ff6f 100644 --- a/init.el +++ b/init.el @@ -1,21 +1,24 @@ -;;; -*- lexical-binding: t; -*- -;;; init.el +;;; init.el --- Init file for MMOSMacs -*- lexical-binding: t; -*- ;; +;;; Commentary: ;; Main configuration file for MMOSMacs. +;;; Code: ;; --------------------------------------------------------------------- ;;; Startup ;; -------- -;; These items need to be done first +;; These items need to be done first. ;; --------------------------------------------------------------------- ;; -------------------------------- -;; Produce backtraces when errors -;; occur. Can be helpful to -;; diagnose startup issues. +;; Debug on error +;; -------------- +;; Can be helpful to diagnose +;; startup issues. ;; --------------------------------- +;; Produce backtraces when errors occur (setq debug-on-error t) @@ -53,7 +56,7 @@ ;; --------------------------------- ;; `use-package' ;; ------------- -;; This makes sure `use-package' is +;; Makes sure `use-package' is ;; installed and loaded. ;; --------------------------------- @@ -63,10 +66,10 @@ ;; --------------------------------- ;; Don't load outdated code ;; ------------------------ -;; MMOSMacs is under highly active +;; MMOSMacs is under active ;; development and undergoes ;; freuqent changes. The newest code -;; should always be loaded +;; should always be loaded. ;; --------------------------------- ;; if a `.el' file is newer than its corresponding `.elc', load the `.el' @@ -102,6 +105,7 @@ ;; Garbage Collector Magic Hack ;; --------------------------------- +;; Configure GCMH (use-package gcmh :straight t :defer t @@ -109,7 +113,9 @@ :init (setq gcmh-idle-delay 15 gcmh-idle-delay-factor 10 - gcmh-high-cons-threshold (* 16 1024))) ;16kb + gcmh-high-cons-threshold (* 16 1024))) ;16kb + +;; Start GCMH after init is complete (add-hook 'after-init-hook 'gcmh-mode) @@ -119,11 +125,12 @@ ;; Asynchronous processing of things ;; --------------------------------- -;; Async package +;; Configure Async package (use-package async :straight t :config - (setq async-bytecomp-package-mode t)) + (setq async-bytecomp-package-mode t ;Enable byte-compiled Emacs Lisp + warning-suppress-types '((comp)))) ;Don't steal focus while doing Async compilation @@ -182,15 +189,13 @@ ([?\s-d] . windmove-down) ([?\s-s] . windmove-left) ([?\s-f] . windmove-right) - ;; Launch applications via shell command + ;; Launch applications via shell command with `s-x' ([?\s-x] . (lambda (command) (interactive (list (read-shell-command "$ "))) (start-process-shell-command command nil command))) - ;; Switch workspace - ([?\s-w] . exwm-workspace-switch) - ([?\s-`] . (lambda () (interactive) - (exwm-workspace-switch-create 0))))) + ;; Switch workspace with `s-w' + ([?\s-w] . exwm-workspace-switch))) (exwm-enable)) @@ -203,7 +208,9 @@ ;; look at Emacs. ;; --------------------------------- -;; Jazz Theme +;; Jazz Theme is the nicest-looking +;; theme I've found so far. Really +;; easy on the eyes. (use-package jazz-theme :straight t) (load-theme 'jazz t) @@ -244,7 +251,8 @@ ;; --------------------------------- ;; Fonts ;; ----- -;; For now I use Iosevka and Exo +;; For now I use JetBrains Mono and +;; Noto Sans. ;; --------------------------------- (set-face-attribute 'default nil :font "JetBrains Mono" :height 100) @@ -389,10 +397,10 @@ :straight (:type built-in) :config (setq isearch-lazy-count t - lazy-count-prefix-format nil - lazy-count-suffix-format " (%s/%S)" + lazy-count-prefix-format nil ;don't show match count before search + lazy-count-suffix-format " (%s/%S)" ;show match count at end of search search-whitespace-regexp ".*" - isearch-lax-whitespace t + isearch-lax-whitespace t ;match any number of spaces isearch-regexp-lax-whitespace t)) @@ -512,7 +520,6 @@ ;; the selected text (delete-selection-mode t) - ;; Expand region by semantic units (use-package expand-region :straight t @@ -665,7 +672,7 @@ (use-package diff-hl :straight t :config - (set-fringe-mode '(10 . 0)) + (set-fringe-mode '(10 . 0)) ;fringe width :hook (prog-mode . diff-hl-mode) (diff-hl-mode . diff-hl-flydiff-mode)) @@ -698,14 +705,17 @@ (visual-line-mode) (variable-pitch-mode)) - ;; Org font stuff (defun mm/org-font-setup () ;; Replace hyphens in lists with dots (font-lock-add-keywords 'org-mode '(("^ *\\([-]\\) " - (0 (prog1 () (compose-region (match-beginning 1) (match-end 1) "•")))))) - ;; Set font sizes + (0 (prog1 () + (compose-region + (match-beginning 1) + (match-end 1) + "•")))))) + ;; Set font sizes for org headings (dolist (face '((org-level-1 . 1.1) (org-level-2 . 1.1) (org-level-3 . 1.1) @@ -737,7 +747,6 @@ (set-face-attribute 'org-agenda-current-time nil :inherit 'fixed-pitch) (set-face-attribute 'org-agenda-calendar-event nil :inherit 'fixed-pitch))) - ;; `org' configuration (use-package org :straight t @@ -755,7 +764,6 @@ ("C-c n l t" . org-toggle-link-display) ("C-c t" . org-agenda-todo)) - ;; Make org heading bullets look nicer (use-package org-bullets :straight t @@ -763,8 +771,7 @@ :custom (org-bullets-bullet-list '("•"))) - -;; Auto-show emphasis markers on hover +;; Auto-show emphasis markers and links on hover (use-package org-appear :straight t :hook (org-mode . org-appear-mode) @@ -773,8 +780,7 @@ org-appear-autolinks t org-appear-autosubmarkers t)) - -;; Show link hints to make following links easier +;; Define keybinds to follow org links (use-package link-hint :straight t :bind @@ -790,24 +796,24 @@ ;; Define function to insert a link to a node without opening it (defun mm/org-roam-node-insert-immediate (arg &rest args) - "This version of `org-roam-node-insert' inserts a node without opening it." + "Insert `org-roam' node without opening it." (interactive "P") (let ((args (cons arg args)) - (org-roam-capture-templates (list (append (car org-roam-capture-templates) - '(:immediate-finish))))) + (org-roam-capture-templates + (list (append (car org-roam-capture-templates) + '(:immediate-finish))))) (apply #'org-roam-node-insert args))) - ;; Add Dendron-like note refactoring functionality ;; This was taken from https://github.com/vicrdguez/dendroam (cl-defmethod mm/org-roam-node-current-file (node) (file-name-base (org-roam-node-file node))) (cl-defmethod mm/org-roam-node-hierarchy-title (node) - (capitalize (car (last (split-string (org-roam-node-title node) - "\\."))))) + (capitalize (car (last (split-string (org-roam-node-title node) "\\."))))) (defun mm/org-roam-refactor-file () + "Refactor current `org-roam' node/file." (interactive) (let* ((initial-file (buffer-file-name)) (initial-slug (file-name-base initial-file)) @@ -826,13 +832,14 @@ (file-name-base (buffer-file-name))) (defun mm/org-roam-get-same-hierarchy-files (hierarchy) - "Gets all the nodes that share the same HIERARCHY totally or partially" + "Get all the nodes that share the same HIERARCHY totally or partially." (let ((files (mapcar #'car (org-roam-db-query [:select [file] :from nodes :where (like file $r1)] (concat "%" hierarchy "%"))))) files)) (defun mm/org-roam-refactor-hierarchy (&optional current) + "Refactor all `org-roam' nodes/files under CURRENT hierarchy." (interactive) (let* ((initial-file (file-name-nondirectory (buffer-file-name))) @@ -857,9 +864,12 @@ (use-package org-roam :straight t :custom + ;; Keep all notes in `~/kb', which should be synced between all computers (org-roam-directory (file-truename "~/kb")) (make-directory org-roam-directory 'parents) + ;; Do not sync `org-roam.db', it is ephemeral. (org-roam-db-location (concat user-emacs-directory "/org-roam.db")) + ;; Customize results display when running `org-roam-node-find' (org-roam-node-display-template (concat (propertize "${title:48} " 'face 'org-document-title) (propertize "${file:*}" 'face 'org-roam-dim))) @@ -889,7 +899,7 @@ ("C-c n r h" . mm/org-roam-refactor-hierarchy) ("C-c n r f" . mm/org-roam-refactor-file))) -;; Graph UI for org-roam. +;; Web-served graph UI for org-roam. (use-package org-roam-ui :straight t :config @@ -916,13 +926,14 @@ :config (setq org-agenda-start-with-log-mode t org-agenda-files '("~/kb/agenda.org") - org-todo-keywords'((sequence "TODO(t)" "IN-PROGRESS(i)" "WAITING(w)" "HOLD(h)" - "REVIEW(re)" "|" "DONE(d)" "CANCELED(ca)") - (sequence "EVENT(e)" "|" "MISSED_EVENT(me)" "ATTENDED_EVENT(ae)") - (sequence "APPT(ap)" "|" "MISSED_APPT(ma)" "ATTENDED_APPT(aa)") - (sequence "CLASS(cl)" "|" "ATTENDED_CLASS(ac)" - "MISSED_CLASS(mc)" "CANCELED_CLASS(cc)") - (sequence "REMINDER(rm)")) + org-todo-keywords + '((sequence "TODO(t)" "IN-PROGRESS(i)" "WAITING(w)" "HOLD(h)" + "REVIEW(re)" "|" "DONE(d)" "CANCELED(ca)") + (sequence "EVENT(e)" "|" "MISSED_EVENT(me)" "ATTENDED_EVENT(ae)") + (sequence "APPT(ap)" "|" "MISSED_APPT(ma)" "ATTENDED_APPT(aa)") + (sequence "CLASS(cl)" "|" "ATTENDED_CLASS(ac)" + "MISSED_CLASS(mc)" "CANCELED_CLASS(cc)") + (sequence "REMINDER(rm)")) org-agenda-span 7 org-agenda-start-day "0d" org-agenda-start-on-weekday nil @@ -957,7 +968,7 @@ ;; This was taken from https://emacs.stackexchange.com/a/68767/38877 (defvar mm/refresh-agenda-time-seconds 15) (defvar mm/refresh-agenda-timer nil - "Timer for `mm/refresh-agenda-timer-function' to reschedule itself, or NIL") + "Timer for `mm/refresh-agenda-timer-function' to reschedule itself, or NIL.") (defun mm/refresh-agenda-timer-function () "If the user types a command while `mm/refresh-agenda-timer' is active, the next time this function is called from it's main idle timer, deactivate `mm/refresh-agenda-timer'." (when mm/refresh-agenda-timer @@ -990,7 +1001,7 @@ (use-package vterm :straight t :config - (setq vterm-always-compile-module t)) + (setq vterm-always-compile-module t)) ;don't ask about compiling module on startup ;; --------------------------------- @@ -1003,8 +1014,7 @@ ;; Eldoc shows function definition hints in the echo area (use-package eldoc :straight (:type built-in) - :delight - :config) + :delight) ;; Flycheck is activated by specific language modes. ;; See `:hook's in language modes below to see which ones use it. @@ -1173,17 +1183,6 @@ (defalias 'yes-or-no-p 'y-or-n-p) -;; --------------------------------- -;; Improved HOME key behavior -;; -------------------------- -;; Something bugs me about HOME -;; moving POINT to the actual -;; beginning of the line. I want it -;; to go to the beginning of the -;; text (i.e. follow indentation) -;; --------------------------------- - - ;; --------------------------------- ;; Movement ;; -------- @@ -1250,6 +1249,8 @@ ;; Fix "IK" M-arrow movement for org-mode (define-key org-mode-map (kbd "s-M-i") (kbd "M-")) (define-key org-mode-map (kbd "s-M-k") (kbd "M-")) +(define-key org-mode-map (kbd "s-M-j") (kbd "M-")) +(define-key org-mode-map (kbd "s-M-l") (kbd "M-")) ;; --------------------------------- -- cgit v1.2.3