aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.xinitrc (renamed from xinitrc)0
-rw-r--r--CONTRIBUTING.md73
-rw-r--r--README.md84
-rw-r--r--STYLE_GUIDE.md44
-rw-r--r--init.el129
5 files changed, 176 insertions, 154 deletions
diff --git a/xinitrc b/.xinitrc
index 795714b..795714b 100644
--- a/xinitrc
+++ b/.xinitrc
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index c331bf9..e7a3942 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -1,69 +1,55 @@
1# Contributing to MMOSMacs 1# Contributing to MMOSMacs
2 2
3Howdy, and welcome to the MMOSMacs git repository. This document 3Howdy, and welcome to the MMOSMacs git repository. This document outlines the conventions and standards for contributing to the project.
4outlines the conventions and standards for the project.
5 4
6 5
7## This is personal 6## This is personal
8 7
9Please understand that this is my personal Emacs configuration. MMOSMacs 8Please 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.
10is designed to meet my personal needs. I welcome any and all
11contributions, and I will do my best to make MMOSMacs accessible to
12others, but my needs and preferences ultimately take priority.
13 9
14All contributors are listed at the end of this document. If you have 10All 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.
15contributed and your name does not appear here, submit a PR or RFC Issue
16for it to be added.
17 11
18 12
19## Code of Conduct 13## Code of Conduct
20 14
21I will reject all contributions from: 15I will reject all contributions from:
22- people who abuse other contributors. 16- people who abuse me or other contributors.
23- people I know to be affiliated with any state agency. 17- people I know to be affiliated with any state agency.
24 18
25Furthermore, individual items will be rejected because of: 19Furthermore, individual items will be rejected because of:
26- exceptionally vulgar language. 20- exceptionally vulgar language.
27- ignorance or disregard of the `STYLE_GUIDE.md` or Issue templates. 21- ignorance or disregard of `STYLE_GUIDE.md`.
28 22
29 23
30## How to Contribute 24## How to Contribute
31 25
32There are several ways you can contribute. 26There are several ways you can contribute.
33 27
34The easiest way you can contribute is by taking part in the discussions 28The 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:
35on the [GitHub Issues page](https://github.com/MountainMan1312/MMOSMacs/issues). 29
36You can comment on topics that already have an existing Issue, or you
37can submit your own if it does not already exist. Issues can take the
38form of:
39- **RFC**: discussion about making a change to MMOSMacs. 30- **RFC**: discussion about making a change to MMOSMacs.
40- **Bug Report**: discusion about a problem with the MMOSMacs code. 31- **Bug Report**: discusion about a problem with the MMOSMacs code.
41- **Feedback**: share your thoughts about MMOSMacs. 32- **Feedback**: share your thoughts about MMOSMacs.
42 33
43Before submitting a new issue, search for existing duplicate issues. If 34Before 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.
44it already exists, comment on the existing Issue instead of making a new
45one. Duplicate issues will be removed and you will be asked to move your
46post to the comment section of the existing post. It's not to be rude,
47it's just for organization's sake.
48 35
49To contribute code: 36To contribute code:
37
501. Make an RFC or find an existing one 381. Make an RFC or find an existing one
512. Discuss your proposed changes 392. Discuss your proposed changes
523. Create a branch 403. Create a branch
534. Make your changes 414. Make your changes
545. Submit a Pull Request 425. Submit a Pull Request
436. Wait for feedback
55 44
56 45
57### RFC Issues, branches, commits, & Pull Requests 46### RFC Issues, branches, commits, & Pull Requests
58 47
59#### Writing an RFC 48#### Writing an RFC
60 49
61RFCs are the main form of project management for this repository. All 50RFCs 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.
62major changes to MMOSMacs should have an associated RFC. RFC Issues 51
63should be named in the format `RFC: TITLE`, where title is a short 52RFC 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`.
64description of the proposed changes. For example, the RFC to modify a
65few default Emacs things as a starting point for MMOSMacs is called
66`RFC: Start with sensible defaults`.
67 53
68The following template should be used when writing an RFC. 54The following template should be used when writing an RFC.
69 55
@@ -75,21 +61,17 @@ Provide a one-paragraph summary of the proposed changes
75 61
76# Rationale and motivation 62# Rationale and motivation
77 63
78Explain why this change is necessary or desirable. Relate to any other 64Explain 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.
79relevant RFCs, Bug Reports, or Feedback. Feel free to link to Issues
80from other repositories as well.
81 65
82 66
83# Details 67# Details
84 68
85Provide an in-depth description of your proposed changes. This should 69Provide an in-depth description of your proposed changes. This should get into specifics and corner-cases.
86get into specifics and corner-cases.
87 70
88 71
89# Drawbacks and Alternatives (optional) 72# Drawbacks and Alternatives (optional)
90 73
91Why should these changes NOT be implemented? What other options are 74Why should these changes NOT be implemented? What other options are there, and why are these changes better than the alternatives?
92there, and why are these changes better than the alternatives?
93 75
94 76
95# Additional resources (optional) 77# Additional resources (optional)
@@ -105,27 +87,14 @@ Ask any further questions you have.
105 87
106#### Creating branches & committing changes 88#### Creating branches & committing changes
107 89
108All changes made as part of an RFC should be made in an associated 90All 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
109branch. The branch should be named in the format `TYPE/#/TITLE`, where 91`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).
110TYPE is one of `RFC, BUG`, X is the Issue number, and TITLE is a short
111summary of the RFC title. For example the branch for
112`RFC: Start with sensible defaults` is named `RFC/2/sensible-defaults`.
113Branch names should be short, with an absolute maximum of 72 characters
114(preferrably shorter).
115 92
116Commits should be small and nuclear. They should each do "one thing". 93Commits 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.
117That said, multiple files could theoretically be affected by a single
118commit. Commit messages should be brief, but not omit any necessary
119detail.
120 94
121 95
122#### Writing a Pull Request 96#### Writing a Pull Request
123 97
124Like RFCs, all major changes to MMOSMacs must have an associated Pull 98Like 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.
125Reqest, which explains in detail the changes that were made. Pull
126Requests are reviewed before the changes are accepted into the stable
127branch, and it is likely that the reviewer will reject your changes with
128notes on what needs to be fixed.
129 99
130Pull Requests should explain the specifics and nuances of the changes 100Pull Requests should explain the specifics and nuances of the changes contained therein.
131contained therein.
diff --git a/README.md b/README.md
index 86c24d1..acb8cd0 100644
--- a/README.md
+++ b/README.md
@@ -1,34 +1,98 @@
1# MMOSMacs 1# MMOSMacs
2 2
3MMOSMacs is the Emacs configuration for MMOS, which is currently just an 3MMOSMacs 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.
4idea I have for an Emacs-centric Linux distribution. MMOSMacs is the 4
5core of my computing experience, and is designed to be a 5MMOSMacs 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.
6jack-of-all-trades just like me.
7 6
8 7
9## Installation 8## Installation
10 9
10### Get the files in place
11
11First, clone this repository into your `~/.emacs.d` directory. 12First, clone this repository into your `~/.emacs.d` directory.
13
12```bash 14```bash
13cd 15git clone https://github.com/MountainMan1312/MMOSMacs.git ~/.emacs.d
14git clone https://github.com/MountainMan1312/MMOSMacs.git .emacs.d
15``` 16```
16 17
17Next create symlinks to the `xinitrc` and `emacs.desktop` files so X 18Next create symlinks to the `.xinitrc` and `emacs.desktop` files so X
18knows what to do: 19knows what to do:
20
19```bash 21```bash
20# Backup your `.xinitrc` file if you feel like it. 22# Backup your `.xinitrc` file if you feel like it.
21# Replace `.xinitrc.old` with whatever you want to name the backup. 23# Replace `.xinitrc.old` with whatever you want to name the backup.
22mv .xinitrc .xinitrc.old 24mv ~/.xinitrc ~/.xinitrc.old
23 25
24# Symlink your `.xinitrc` file 26# Symlink your `.xinitrc` file
25ln -s .emacs.d/xinitrc .xinitrc 27ln -s ~/.emacs.d/.xinitrc ~/.xinitrc
26 28
27# Symlink `emacs.desktop` to add MMOSMacs as an entry to your Display 29# Symlink `emacs.desktop` to add MMOSMacs as an entry to your Display
28# Manager / login screen. 30# Manager / login screen.
29sudo ln -s .emacs.d/emacs.desktop /usr/share/xsessions/emacs.desktop 31sudo ln -s ~/.emacs.d/emacs.desktop /usr/share/xsessions/emacs.desktop
32```
33
34Optionally create a symlink to the `.sbclrc` file for SBCL:
35
36```bash
37ln -s ~/.emacs.d/.sbclrc ~/.sbclrc
38```
39
40### Install necessary packages
41
42You'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:
43
44- app-admin/sudo
45- app-dicts/aspell
46- app-editors/emacs (USE="dynamic-loading gui jit libxml2 threads")
47- app-emacs/emacs-common (USE="gui libxml2 X")
48- app-emacs/emacs-daemon
49- dev-lang/ghc
50- dev-lang/rust
51- dev-lang/sbcl
52- dev-util/shellcheck
53- dev-vcs/git
54- media-fonts/jetbrains-mono
55- media-fonts/noto
56- net-libs/nodejs
57- net-p2p/syncthing
58- sys-devel/gcc (USE="jit")
59- x11-apps/setxkbmap
60- x11-base/xorg-server
61- x11-misc/arandr
62
63
64### Setup `~/kb` and Syncthing for `org-roam` knowledgebase
65
66Next you need to setup the `~/kb` directory, which will contain:
67
68- `org-roam-directory`
69- `org-agenda-files`
70
71Follow [the Syncthing documentation](https://docs.syncthing.net/) and [the Gentoo Wiki entry for Syncthing](https://wiki.gentoo.org/wiki/Syncthing) to get Syncthing setup.
72
73If 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:
74
75```xml
76<gui enabled="true" tls="false" debugging="false">
77 <address>127.0.0.1:40469</address>
30``` 78```
31 79
80Change it to the following, but be sure to disable it later for security:
81
82```xml
83<gui enabled="true" tls="false" debugging="false">
84 <address>0.0.0.0:40469</address>
85```
86
87### Run MMOSMacs for the first time
88
89`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.
90
91Then, run the first-time-setup commands for the following packages:
92
93- `M-x all-the-icons-install-fonts RET y`
94- `M-x lsp-install-server RET bash-ls RET`
95
32 96
33## Plans 97## Plans
34 98
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
13 13
14## Organization 14## Organization
15 15
16Emacs Lisp files should begin with a header. The first line of the 16Emacs 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.
17header should include the filename, a very brief comment (2-5 words),
18and the `-*- lexical-binding: t; -*-` thing. The next line(s) should be
19a more detailed description of the file and it's purpose.
20 17
21```elisp 18```elisp
22;;; -*- lexical-binding: t; -*- 19;;; init.el --- Init file for MMOSMacs -*- lexical-binding: t; -*-
23;;; init.el
24;; 20;;
25;; Main config file for MMOSMacs; the glue that binds the modules 21;;; Commentary:
26;; together. Provides package management, performance tweaks, and 22;; Main config file for MMOSMacs.
27;; integrates all the other MMOSMacs modules.
28``` 23```
29 24
30All Emacs Lisp files are organized into Sections and Subsections using 25All 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
31comment decorations. Section titles begin with `;;;`, are ALL CAPS, and 26title underline, and an additional 36-or-72-char line goes at the bottom of the header.
32their decorations extend up to 72 chars. Subsections begin with `;;`
33and their decorations extend up to 36 chars. Titles should be underlined
34with dashes on the proceeding line. Explanatory comments go below the
35title underline, and an additional 36-or-72-char line goes at the bottom
36of the header.
37 27
38Each subsection should have 2 blank lines between the top line of the 28Each 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.
39header and the bottom line of code from the previous subsection. Only
40one line goes between the Section header and the first Subsection, as
41well as between portions of code within the same subsection. 4 lines go
42between a new Section header and the previous bit of code.
43 29
44```elisp 30```elisp
45;; integrates all the other MMOSMacs modules. 31;;; Commentary:
32;; Main configuration file for MMOSMacs.
46 33
47 34
48;; --------------------------------------------------------------------- 35;; ---------------------------------------------------------------------
49;;; FIRST SECTION TITLE 36;;; First Section Title
50;; -------------------- 37;; --------------------
51;; Comments about the purpose of the section go here. 38;; Comments about the purpose of the section go here.
52;; It should be concise. Don't go into too much detail. 39;; 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.
72 (setq some-crap nil)) 59 (setq some-crap nil))
73 60
74;; `something-else` is a little less 61;; `something-else` is a little less
75;; likely to be a package 62;; likely to be a package, but it
63;; wouldn't surprise me
76(use-package something-else 64(use-package something-else
77 :straight t) 65 :straight t)
78 66
@@ -87,7 +75,7 @@ between a new Section header and the previous bit of code.
87;; I really don't know what to write 75;; I really don't know what to write
88;; in these example comments. 76;; in these example comments.
89(use-package some-other-thing 77(use-package some-other-thing
90 :straight 78 :straight t
91 :init 79 :init
92 (other-thing-mode)) 80 (other-thing-mode))
93 81
@@ -107,8 +95,8 @@ between a new Section header and the previous bit of code.
107 95
108- Write heading comments with 3 semicolons, and regular comments with 2. 96- Write heading comments with 3 semicolons, and regular comments with 2.
109- Write margin comments with 1 semicolon. 97- Write margin comments with 1 semicolon.
110- Leave 1 space between the semicolons and the comment text. 98- Put a space between the semicolon and the text for heading and regular comments.
111- Comments longer than 1 word are capitalized and use punctuation. 99- Do not put a space between the semicolon and the text for margin comments.
112 100
113```elisp 101```elisp
114;;; This is a heading comment 102;;; This is a heading comment
@@ -116,7 +104,7 @@ between a new Section header and the previous bit of code.
116;; Something something something. 104;; Something something something.
117(defun foo (bar) 105(defun foo (bar)
118 (something something 106 (something something
119 something-else)) ; for some other reason 107 something-else)) ;this is a margin comment
120``` 108```
121 109
122 110
diff --git a/init.el b/init.el
index 76cc321..d92ff6f 100644
--- a/init.el
+++ b/init.el
@@ -1,21 +1,24 @@
1;;; -*- lexical-binding: t; -*- 1;;; init.el --- Init file for MMOSMacs -*- lexical-binding: t; -*-
2;;; init.el
3;; 2;;
3;;; Commentary:
4;; Main configuration file for MMOSMacs. 4;; Main configuration file for MMOSMacs.
5 5
6;;; Code:
6 7
7;; --------------------------------------------------------------------- 8;; ---------------------------------------------------------------------
8;;; Startup 9;;; Startup
9;; -------- 10;; --------
10;; These items need to be done first 11;; These items need to be done first.
11;; --------------------------------------------------------------------- 12;; ---------------------------------------------------------------------
12 13
13;; -------------------------------- 14;; --------------------------------
14;; Produce backtraces when errors 15;; Debug on error
15;; occur. Can be helpful to 16;; --------------
16;; diagnose startup issues. 17;; Can be helpful to diagnose
18;; startup issues.
17;; --------------------------------- 19;; ---------------------------------
18 20
21;; Produce backtraces when errors occur
19(setq debug-on-error t) 22(setq debug-on-error t)
20 23
21 24
@@ -53,7 +56,7 @@
53;; --------------------------------- 56;; ---------------------------------
54;; `use-package' 57;; `use-package'
55;; ------------- 58;; -------------
56;; This makes sure `use-package' is 59;; Makes sure `use-package' is
57;; installed and loaded. 60;; installed and loaded.
58;; --------------------------------- 61;; ---------------------------------
59 62
@@ -63,10 +66,10 @@
63;; --------------------------------- 66;; ---------------------------------
64;; Don't load outdated code 67;; Don't load outdated code
65;; ------------------------ 68;; ------------------------
66;; MMOSMacs is under highly active 69;; MMOSMacs is under active
67;; development and undergoes 70;; development and undergoes
68;; freuqent changes. The newest code 71;; freuqent changes. The newest code
69;; should always be loaded 72;; should always be loaded.
70;; --------------------------------- 73;; ---------------------------------
71 74
72;; if a `.el' file is newer than its corresponding `.elc', load the `.el' 75;; if a `.el' file is newer than its corresponding `.elc', load the `.el'
@@ -102,6 +105,7 @@
102;; Garbage Collector Magic Hack 105;; Garbage Collector Magic Hack
103;; --------------------------------- 106;; ---------------------------------
104 107
108;; Configure GCMH
105(use-package gcmh 109(use-package gcmh
106 :straight t 110 :straight t
107 :defer t 111 :defer t
@@ -109,7 +113,9 @@
109 :init 113 :init
110 (setq gcmh-idle-delay 15 114 (setq gcmh-idle-delay 15
111 gcmh-idle-delay-factor 10 115 gcmh-idle-delay-factor 10
112 gcmh-high-cons-threshold (* 16 1024))) ;16kb 116 gcmh-high-cons-threshold (* 16 1024))) ;16kb
117
118;; Start GCMH after init is complete
113(add-hook 'after-init-hook 'gcmh-mode) 119(add-hook 'after-init-hook 'gcmh-mode)
114 120
115 121
@@ -119,11 +125,12 @@
119;; Asynchronous processing of things 125;; Asynchronous processing of things
120;; --------------------------------- 126;; ---------------------------------
121 127
122;; Async package 128;; Configure Async package
123(use-package async 129(use-package async
124 :straight t 130 :straight t
125 :config 131 :config
126 (setq async-bytecomp-package-mode t)) 132 (setq async-bytecomp-package-mode t ;Enable byte-compiled Emacs Lisp
133 warning-suppress-types '((comp)))) ;Don't steal focus while doing Async compilation
127 134
128 135
129 136
@@ -182,15 +189,13 @@
182 ([?\s-d] . windmove-down) 189 ([?\s-d] . windmove-down)
183 ([?\s-s] . windmove-left) 190 ([?\s-s] . windmove-left)
184 ([?\s-f] . windmove-right) 191 ([?\s-f] . windmove-right)
185 ;; Launch applications via shell command 192 ;; Launch applications via shell command with `s-x'
186 ([?\s-x] . (lambda (command) 193 ([?\s-x] . (lambda (command)
187 (interactive (list (read-shell-command "$ "))) 194 (interactive (list (read-shell-command "$ ")))
188 (start-process-shell-command 195 (start-process-shell-command
189 command nil command))) 196 command nil command)))
190 ;; Switch workspace 197 ;; Switch workspace with `s-w'
191 ([?\s-w] . exwm-workspace-switch) 198 ([?\s-w] . exwm-workspace-switch)))
192 ([?\s-`] . (lambda () (interactive)
193 (exwm-workspace-switch-create 0)))))
194 (exwm-enable)) 199 (exwm-enable))
195 200
196 201
@@ -203,7 +208,9 @@
203;; look at Emacs. 208;; look at Emacs.
204;; --------------------------------- 209;; ---------------------------------
205 210
206;; Jazz Theme 211;; Jazz Theme is the nicest-looking
212;; theme I've found so far. Really
213;; easy on the eyes.
207(use-package jazz-theme 214(use-package jazz-theme
208 :straight t) 215 :straight t)
209(load-theme 'jazz t) 216(load-theme 'jazz t)
@@ -244,7 +251,8 @@
244;; --------------------------------- 251;; ---------------------------------
245;; Fonts 252;; Fonts
246;; ----- 253;; -----
247;; For now I use Iosevka and Exo 254;; For now I use JetBrains Mono and
255;; Noto Sans.
248;; --------------------------------- 256;; ---------------------------------
249 257
250(set-face-attribute 'default nil :font "JetBrains Mono" :height 100) 258(set-face-attribute 'default nil :font "JetBrains Mono" :height 100)
@@ -389,10 +397,10 @@
389 :straight (:type built-in) 397 :straight (:type built-in)
390 :config 398 :config
391 (setq isearch-lazy-count t 399 (setq isearch-lazy-count t
392 lazy-count-prefix-format nil 400 lazy-count-prefix-format nil ;don't show match count before search
393 lazy-count-suffix-format " (%s/%S)" 401 lazy-count-suffix-format " (%s/%S)" ;show match count at end of search
394 search-whitespace-regexp ".*" 402 search-whitespace-regexp ".*"
395 isearch-lax-whitespace t 403 isearch-lax-whitespace t ;match any number of spaces
396 isearch-regexp-lax-whitespace t)) 404 isearch-regexp-lax-whitespace t))
397 405
398 406
@@ -512,7 +520,6 @@
512;; the selected text 520;; the selected text
513(delete-selection-mode t) 521(delete-selection-mode t)
514 522
515
516;; Expand region by semantic units 523;; Expand region by semantic units
517(use-package expand-region 524(use-package expand-region
518 :straight t 525 :straight t
@@ -532,7 +539,7 @@
532 :straight t 539 :straight t
533 :bind (("s-m" . mc/mark-more-like-this-extended)) 540 :bind (("s-m" . mc/mark-more-like-this-extended))
534 :config 541 :config
535 (setq mc/cmds 542 (setq mc/cmds-to-run-for-all
536 '(electric-pair-delete-pair 543 '(electric-pair-delete-pair
537 end-of-visual-line 544 end-of-visual-line
538 beginning-of-visual-line 545 beginning-of-visual-line
@@ -665,7 +672,7 @@
665(use-package diff-hl 672(use-package diff-hl
666 :straight t 673 :straight t
667 :config 674 :config
668 (set-fringe-mode '(10 . 0)) 675 (set-fringe-mode '(10 . 0)) ;fringe width
669 :hook 676 :hook
670 (prog-mode . diff-hl-mode) 677 (prog-mode . diff-hl-mode)
671 (diff-hl-mode . diff-hl-flydiff-mode)) 678 (diff-hl-mode . diff-hl-flydiff-mode))
@@ -698,14 +705,17 @@
698 (visual-line-mode) 705 (visual-line-mode)
699 (variable-pitch-mode)) 706 (variable-pitch-mode))
700 707
701
702;; Org font stuff 708;; Org font stuff
703(defun mm/org-font-setup () 709(defun mm/org-font-setup ()
704 ;; Replace hyphens in lists with dots 710 ;; Replace hyphens in lists with dots
705 (font-lock-add-keywords 'org-mode 711 (font-lock-add-keywords 'org-mode
706 '(("^ *\\([-]\\) " 712 '(("^ *\\([-]\\) "
707 (0 (prog1 () (compose-region (match-beginning 1) (match-end 1) "•")))))) 713 (0 (prog1 ()
708 ;; Set font sizes 714 (compose-region
715 (match-beginning 1)
716 (match-end 1)
717 "•"))))))
718 ;; Set font sizes for org headings
709 (dolist (face '((org-level-1 . 1.1) 719 (dolist (face '((org-level-1 . 1.1)
710 (org-level-2 . 1.1) 720 (org-level-2 . 1.1)
711 (org-level-3 . 1.1) 721 (org-level-3 . 1.1)
@@ -737,7 +747,6 @@
737 (set-face-attribute 'org-agenda-current-time nil :inherit 'fixed-pitch) 747 (set-face-attribute 'org-agenda-current-time nil :inherit 'fixed-pitch)
738 (set-face-attribute 'org-agenda-calendar-event nil :inherit 'fixed-pitch))) 748 (set-face-attribute 'org-agenda-calendar-event nil :inherit 'fixed-pitch)))
739 749
740
741;; `org' configuration 750;; `org' configuration
742(use-package org 751(use-package org
743 :straight t 752 :straight t
@@ -755,7 +764,6 @@
755 ("C-c n l t" . org-toggle-link-display) 764 ("C-c n l t" . org-toggle-link-display)
756 ("C-c t" . org-agenda-todo)) 765 ("C-c t" . org-agenda-todo))
757 766
758
759;; Make org heading bullets look nicer 767;; Make org heading bullets look nicer
760(use-package org-bullets 768(use-package org-bullets
761 :straight t 769 :straight t
@@ -763,8 +771,7 @@
763 :custom 771 :custom
764 (org-bullets-bullet-list '("•"))) 772 (org-bullets-bullet-list '("•")))
765 773
766 774;; Auto-show emphasis markers and links on hover
767;; Auto-show emphasis markers on hover
768(use-package org-appear 775(use-package org-appear
769 :straight t 776 :straight t
770 :hook (org-mode . org-appear-mode) 777 :hook (org-mode . org-appear-mode)
@@ -773,8 +780,7 @@
773 org-appear-autolinks t 780 org-appear-autolinks t
774 org-appear-autosubmarkers t)) 781 org-appear-autosubmarkers t))
775 782
776 783;; Define keybinds to follow org links
777;; Show link hints to make following links easier
778(use-package link-hint 784(use-package link-hint
779 :straight t 785 :straight t
780 :bind 786 :bind
@@ -790,24 +796,24 @@
790 796
791;; Define function to insert a link to a node without opening it 797;; Define function to insert a link to a node without opening it
792(defun mm/org-roam-node-insert-immediate (arg &rest args) 798(defun mm/org-roam-node-insert-immediate (arg &rest args)
793 "This version of `org-roam-node-insert' inserts a node without opening it." 799 "Insert `org-roam' node without opening it."
794 (interactive "P") 800 (interactive "P")
795 (let ((args (cons arg args)) 801 (let ((args (cons arg args))
796 (org-roam-capture-templates (list (append (car org-roam-capture-templates) 802 (org-roam-capture-templates
797 '(:immediate-finish))))) 803 (list (append (car org-roam-capture-templates)
804 '(:immediate-finish)))))
798 (apply #'org-roam-node-insert args))) 805 (apply #'org-roam-node-insert args)))
799 806
800
801;; Add Dendron-like note refactoring functionality 807;; Add Dendron-like note refactoring functionality
802;; This was taken from https://github.com/vicrdguez/dendroam 808;; This was taken from https://github.com/vicrdguez/dendroam
803(cl-defmethod mm/org-roam-node-current-file (node) 809(cl-defmethod mm/org-roam-node-current-file (node)
804 (file-name-base (org-roam-node-file node))) 810 (file-name-base (org-roam-node-file node)))
805 811
806(cl-defmethod mm/org-roam-node-hierarchy-title (node) 812(cl-defmethod mm/org-roam-node-hierarchy-title (node)
807 (capitalize (car (last (split-string (org-roam-node-title node) 813 (capitalize (car (last (split-string (org-roam-node-title node) "\\.")))))
808 "\\.")))))
809 814
810(defun mm/org-roam-refactor-file () 815(defun mm/org-roam-refactor-file ()
816 "Refactor current `org-roam' node/file."
811 (interactive) 817 (interactive)
812 (let* ((initial-file (buffer-file-name)) 818 (let* ((initial-file (buffer-file-name))
813 (initial-slug (file-name-base initial-file)) 819 (initial-slug (file-name-base initial-file))
@@ -826,13 +832,14 @@
826 (file-name-base (buffer-file-name))) 832 (file-name-base (buffer-file-name)))
827 833
828(defun mm/org-roam-get-same-hierarchy-files (hierarchy) 834(defun mm/org-roam-get-same-hierarchy-files (hierarchy)
829 "Gets all the nodes that share the same HIERARCHY totally or partially" 835 "Get all the nodes that share the same HIERARCHY totally or partially."
830 (let ((files (mapcar #'car (org-roam-db-query [:select [file] 836 (let ((files (mapcar #'car (org-roam-db-query [:select [file]
831 :from nodes 837 :from nodes
832 :where (like file $r1)] 838 :where (like file $r1)]
833 (concat "%" hierarchy "%"))))) files)) 839 (concat "%" hierarchy "%"))))) files))
834 840
835(defun mm/org-roam-refactor-hierarchy (&optional current) 841(defun mm/org-roam-refactor-hierarchy (&optional current)
842 "Refactor all `org-roam' nodes/files under CURRENT hierarchy."
836 (interactive) 843 (interactive)
837 (let* 844 (let*
838 ((initial-file (file-name-nondirectory (buffer-file-name))) 845 ((initial-file (file-name-nondirectory (buffer-file-name)))
@@ -857,9 +864,12 @@
857(use-package org-roam 864(use-package org-roam
858 :straight t 865 :straight t
859 :custom 866 :custom
867 ;; Keep all notes in `~/kb', which should be synced between all computers
860 (org-roam-directory (file-truename "~/kb")) 868 (org-roam-directory (file-truename "~/kb"))
861 (make-directory org-roam-directory 'parents) 869 (make-directory org-roam-directory 'parents)
870 ;; Do not sync `org-roam.db', it is ephemeral.
862 (org-roam-db-location (concat user-emacs-directory "/org-roam.db")) 871 (org-roam-db-location (concat user-emacs-directory "/org-roam.db"))
872 ;; Customize results display when running `org-roam-node-find'
863 (org-roam-node-display-template (concat 873 (org-roam-node-display-template (concat
864 (propertize "${title:48} " 'face 'org-document-title) 874 (propertize "${title:48} " 'face 'org-document-title)
865 (propertize "${file:*}" 'face 'org-roam-dim))) 875 (propertize "${file:*}" 'face 'org-roam-dim)))
@@ -889,7 +899,7 @@
889 ("C-c n r h" . mm/org-roam-refactor-hierarchy) 899 ("C-c n r h" . mm/org-roam-refactor-hierarchy)
890 ("C-c n r f" . mm/org-roam-refactor-file))) 900 ("C-c n r f" . mm/org-roam-refactor-file)))
891 901
892;; Graph UI for org-roam. 902;; Web-served graph UI for org-roam.
893(use-package org-roam-ui 903(use-package org-roam-ui
894 :straight t 904 :straight t
895 :config 905 :config
@@ -916,13 +926,14 @@
916 :config 926 :config
917 (setq org-agenda-start-with-log-mode t 927 (setq org-agenda-start-with-log-mode t
918 org-agenda-files '("~/kb/agenda.org") 928 org-agenda-files '("~/kb/agenda.org")
919 org-todo-keywords'((sequence "TODO(t)" "IN-PROGRESS(i)" "WAITING(w)" "HOLD(h)" 929 org-todo-keywords
920 "REVIEW(re)" "|" "DONE(d)" "CANCELED(ca)") 930 '((sequence "TODO(t)" "IN-PROGRESS(i)" "WAITING(w)" "HOLD(h)"
921 (sequence "EVENT(e)" "|" "MISSED_EVENT(me)" "ATTENDED_EVENT(ae)") 931 "REVIEW(re)" "|" "DONE(d)" "CANCELED(ca)")
922 (sequence "APPT(ap)" "|" "MISSED_APPT(ma)" "ATTENDED_APPT(aa)") 932 (sequence "EVENT(e)" "|" "MISSED_EVENT(me)" "ATTENDED_EVENT(ae)")
923 (sequence "CLASS(cl)" "|" "ATTENDED_CLASS(ac)" 933 (sequence "APPT(ap)" "|" "MISSED_APPT(ma)" "ATTENDED_APPT(aa)")
924 "MISSED_CLASS(mc)" "CANCELED_CLASS(cc)") 934 (sequence "CLASS(cl)" "|" "ATTENDED_CLASS(ac)"
925 (sequence "REMINDER(rm)")) 935 "MISSED_CLASS(mc)" "CANCELED_CLASS(cc)")
936 (sequence "REMINDER(rm)"))
926 org-agenda-span 7 937 org-agenda-span 7
927 org-agenda-start-day "0d" 938 org-agenda-start-day "0d"
928 org-agenda-start-on-weekday nil 939 org-agenda-start-on-weekday nil
@@ -957,7 +968,7 @@
957;; This was taken from https://emacs.stackexchange.com/a/68767/38877 968;; This was taken from https://emacs.stackexchange.com/a/68767/38877
958(defvar mm/refresh-agenda-time-seconds 15) 969(defvar mm/refresh-agenda-time-seconds 15)
959(defvar mm/refresh-agenda-timer nil 970(defvar mm/refresh-agenda-timer nil
960 "Timer for `mm/refresh-agenda-timer-function' to reschedule itself, or NIL") 971 "Timer for `mm/refresh-agenda-timer-function' to reschedule itself, or NIL.")
961(defun mm/refresh-agenda-timer-function () 972(defun mm/refresh-agenda-timer-function ()
962 "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'." 973 "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'."
963 (when mm/refresh-agenda-timer 974 (when mm/refresh-agenda-timer
@@ -990,7 +1001,7 @@
990(use-package vterm 1001(use-package vterm
991 :straight t 1002 :straight t
992 :config 1003 :config
993 (setq vterm-always-compile-module t)) 1004 (setq vterm-always-compile-module t)) ;don't ask about compiling module on startup
994 1005
995 1006
996;; --------------------------------- 1007;; ---------------------------------
@@ -1003,8 +1014,7 @@
1003;; Eldoc shows function definition hints in the echo area 1014;; Eldoc shows function definition hints in the echo area
1004(use-package eldoc 1015(use-package eldoc
1005 :straight (:type built-in) 1016 :straight (:type built-in)
1006 :delight 1017 :delight)
1007 :config)
1008 1018
1009;; Flycheck is activated by specific language modes. 1019;; Flycheck is activated by specific language modes.
1010;; See `:hook's in language modes below to see which ones use it. 1020;; See `:hook's in language modes below to see which ones use it.
@@ -1174,17 +1184,6 @@
1174 1184
1175 1185
1176;; --------------------------------- 1186;; ---------------------------------
1177;; Improved HOME key behavior
1178;; --------------------------
1179;; Something bugs me about HOME
1180;; moving POINT to the actual
1181;; beginning of the line. I want it
1182;; to go to the beginning of the
1183;; text (i.e. follow indentation)
1184;; ---------------------------------
1185
1186
1187;; ---------------------------------
1188;; Movement 1187;; Movement
1189;; -------- 1188;; --------
1190;; MMOSMacs uses s-IJKLUO keybinds 1189;; MMOSMacs uses s-IJKLUO keybinds
@@ -1250,6 +1249,8 @@
1250;; Fix "IK" M-arrow movement for org-mode 1249;; Fix "IK" M-arrow movement for org-mode
1251(define-key org-mode-map (kbd "s-M-i") (kbd "M-<up>")) 1250(define-key org-mode-map (kbd "s-M-i") (kbd "M-<up>"))
1252(define-key org-mode-map (kbd "s-M-k") (kbd "M-<down>")) 1251(define-key org-mode-map (kbd "s-M-k") (kbd "M-<down>"))
1252(define-key org-mode-map (kbd "s-M-j") (kbd "M-<left>"))
1253(define-key org-mode-map (kbd "s-M-l") (kbd "M-<right>"))
1253 1254
1254 1255
1255;; --------------------------------- 1256;; ---------------------------------