Merge branch 'main' of github.com:iamtoaster/emacs-dotfiles

This commit is contained in:
2026-01-09 21:47:29 +09:00
7 changed files with 114 additions and 69 deletions

View File

@@ -17,7 +17,8 @@
(which-key-mode))
;; Pixel perfect scrolling
(pixel-scroll-precision-mode)
(unless (version< emacs-version "29.0")
(pixel-scroll-precision-mode))
;; Display time
(display-time-mode)
@@ -116,7 +117,9 @@
;; stopped loading it automatically. So, to remedy that, we load it if it was
;; not already loaded.
(unless (memq 'vterm features)
(load "vterm" nil t))
(load "vterm" t)
(unless (memq 'vterm features)
(message "Failed to load vterm. It is probably not installed.")))
;;
(add-to-list 'load-path (expand-file-name (concat minimal-emacs-user-directory "load")))

View File

@@ -48,7 +48,9 @@
(setq org-roam-directory (file-truename "~/data2/Notes"))
;; This tells org-roam to sync notes with its index in the background.
(org-roam-db-autosync-mode)
(if (file-directory-p org-roam-directory)
(org-roam-db-autosync-mode)
(message "Org Roam directory (%s) does not exist. Autosync disabled." org-roam-directory))
(setq global-roam-map (make-sparse-keymap "Roam Keys"))
(global-set-key "\C-cr" global-roam-map)
@@ -76,18 +78,4 @@
"~/data2/Notes/inbox.org" "Words")
#'tatoeba-get-capture-template)))
;; This package adds flashcard functionality to org files.
(use-package org-fc
:straight (org-fc
:type git
:host nil
:repo "https://git.sr.ht/~l3kn/org-fc"
:branch "main"
:files (:defaults "awk" "demo.org"))
:after org
:ensure t
:defer nil
:custom
(org-fc-directories '("~/data2/Notes/")))
;;; 07-org.el ends here

View File

@@ -7,6 +7,23 @@
;;; Code:
;; This package provides syntax highlighting and some utilities for
;; working with rust code.
(use-package rust-mode
:ensure t
:defer t
:commands (rust-mode))
(add-hook 'rust-mode-hook #'eglot-ensure)
;; Clippy backend for flymake so we get propa error reporting in Rust
(use-package flymake-clippy
:hook (rust-mode . flymake-clippy-setup-backend))
(defun manually-activate-flymake ()
(add-hook 'flymake-diagnostic-functions #'eglot-flymake-backend nil t)
(flymake-mode 1))
;; Eglot is the built-in LSP client.
(use-package eglot
:ensure nil
@@ -17,15 +34,21 @@
eglot-rename
eglot-format-buffer)
:hook ((eglot-managed-mode . manually-activate-flymake))
:custom
(eglot-report-progress nil) ; Prevent minibuffer spam
(eglot-report-progress nil) ; Prevent minibuffer spam
:config
(add-to-list 'eglot-server-programs '((rust-mode) . ("rust-analyzer")))
(add-to-list 'eglot-server-programs '((rust-mode) . ("rust-analyzer" :initializationOptions
( :procMacro (:enable t)
:cargo ( :buildScripts (:enable t) )))))
(add-to-list 'eglot-server-programs '(nix-mode . ("nil")))
(add-to-list 'eglot-stay-out-of 'flymake)
;; Optimizations
(fset #'jsonrpc--log-event #'ignore)
(setq jsonrpc-event-hook nil))
(setq jsonrpc-event-hook nil)
)
;; This function raises the window to the front using KDE KWin.
(defun my-raise-window ()
@@ -47,28 +70,19 @@ Won't work if the script is not there."
(add-hook 'gdscript-mode-hook #'eglot-ensure)
;; This package provides syntax highlighting and some utilities for
;; working with rust code.
(use-package rust-mode
:ensure t
:defer t
:commands (rust-mode))
(add-hook 'rust-mode-hook #'eglot-ensure)
;; This package provides integration with Prolog (SWI).
(use-package sweeprolog
:straight (sweeprolog :type git
:host nil
:repo "https://git.sr.ht/~eshel/sweep"
:branch "main"
:files ("*.el" "sweep.pl" "sweep.texi")) ; Custom recipe because
; the normal one did not
; build properly.
:host nil
:repo "https://git.sr.ht/~eshel/sweep"
:branch "main"
:files ("*.el" "sweep.pl" "sweep.texi")) ; Custom recipe because
; the normal one did not
; build properly.
:ensure t
:defer t
:commands (sweeprolog-mode
sweeprolog-top-level)
sweeprolog-top-level)
:init
(setq sweeprolog-swipl-path "swipl"))
@@ -125,10 +139,10 @@ control codes are not supported."
;; Lispy provides structural editing to lisp modes.
(use-package lispy
:ensure t
:defer t)
(add-hook 'emacs-lisp-mode-hook (lambda () (lispy-mode 1)))
(if (memq 'lispy-autoloads features)
(add-hook 'emacs-lisp-mode-hook (lambda () (lispy-mode 1))))
;; This package adds indent bars. Currently only configured for rust and python.
(use-package indent-bars
@@ -154,4 +168,17 @@ control codes are not supported."
(indent-bars-treesit-wrap '((rust arguments parameters)))
:hook ((python-base-mode yaml-mode rust-mode) . indent-bars-mode))
;;; 15-lsp.el ends here
;; Ellama allows using LLMs from emacs.
(use-package ellama
:ensure nil
:defer t
:bind ("C-c e" . ellama)
:init (setopt ellama-auto-scroll t)
:commands (ellama)
:config
;; show ellama context in header line in all buffers
(ellama-context-header-line-global-mode +1)
;; show ellama session id in header line in all buffers
(ellama-session-header-line-global-mode +1))
;;; 15-lsp.el end here

View File

@@ -16,7 +16,7 @@ The original repository contains a lot of useful info, so do check it out.
**Here are the instructions for installing minimal-emacs.d:** [Install minimal-emacs.d](#install-minimal-emacsd).
## Looking for the ideal starter kit to customize Emacs? You have found it.
### Looking for the ideal starter kit to customize Emacs? You have found it.
The *minimal-emacs.d* project is:
- **Minimal yet effective:** A solid starting point.
@@ -50,13 +50,36 @@ As such, post-init.el file only contains the minimal setup code, and at the end
In addition to *minimal-emacs.d*, startup speed is influenced by your computer's processing power and disk speed. To establish a baseline, start Emacs with only *minimal-emacs.d* and no additional configurations, then run `M-x emacs-init-time`. Incrementally modify your init files and observe the impact on startup time. For consistent comparisons, always test on the same computer and Emacs version. It's also important to ensure that all packages are deferred using `:defer t` and `:commands`, which makes Emacs load them only when needed (see additional examples in this README.md). While startup time is important, other factors, like native compilation, are even more important. Although native compilation may introduce some brief initial and negligible initial delay, it is beneficial in the long run as it significantly speeds up Emacs.
## Comments from minimal-emacs.d users
- [gnudoc on Reddit](https://www.reddit.com/r/emacs/comments/1feaf37/comment/lmn1hoo/): "That's a great learning resource. Thank you for your work on it and for sharing it!"
- [dewyke on Reddit](https://www.reddit.com/r/emacs/comments/1feaf37/comment/lmq53an/): "Lots of good stuff in there, even for people who already have established ways of organising their configs."
- [JamesBrickley (Shout out to this starter-kit: Minimal-Emacs )](https://www.reddit.com/r/emacs/comments/1epz7qn/shout_out_to_this_starterkit_minimalemacs/) appreciates that *minimal-emacs.d* provides an optimized *early-init.el* and *init.el* for fast startup times and sensible default settings. He highlights that the project includes all the essential configurations needed for a well-tuned Emacs setup, eliminating the need to sift through conflicting advice on topics like garbage collection optimization. While he has encountered similar settings before, he also discovered new optimizations he had not seen elsewhere.
- [Brandon Schneider (skarekrow)](https://github.com/jamescherti/compile-angel.el/issues/5#issuecomment-3186187000): "...the minimal-emacs project is incredible. I love how documented it is as a beginner to learn from. Thank you for all the effort you've put into that and the other packages you maintain. It's a huge boon to new users."
- [Leading_Ad6415 commented on Reddit](https://www.reddit.com/r/emacs/comments/1feaf37/comment/lmw7ijd/) that after switching to *minimal-emacs.d*, their configuration execution time decreased from 3 seconds to just 1 second by simply replacing their `init.el` and `early-init.el` files with those from the project.
- [Another user commented on Reddit](https://www.reddit.com/r/emacs/comments/1feaf37/comment/lrsfd64/), highlighting how a minimal-emacs.d significantly enhanced their Emacs performance. They reported substantial startup time reductions on both their main machine (from ~2.25 to ~0.95 seconds) and an older laptop (from ~2.95 to ~1.27 seconds) while also experiencing a generally snappier performance within Emacs. The user expressed gratitude for the project, calling it fantastic.
- [Cyneox commented on Reddit](https://www.reddit.com/r/emacs/comments/1gh687a/comment/lwdv18t/), expressing gratitude for the resource and sharing their experience. They mentioned it was their fourth attempt to set up a vanilla configuration and highlighted that they had been using the repository as a foundation for their customizations over the past few days. They appreciated the absence of unexplained behavior and the clear instructions on where to place files. The user reported successful testing on both Linux and macOS, noting that everything functioned smoothly, including in the terminal.
- [Sebagabones on GitHub](https://github.com/jamescherti/minimal-emacs.d/issues/77): "...let me say that I am loving minimal-emacs.d, it has been brilliant so far! :)"
- [Mlepnos1984 on Reddit](https://www.reddit.com/r/emacs/comments/1lz181i/comment/n2yjj17/): "I give you an A+ on documentation, the readme is great!"
- [rrajath on Reddit](https://www.reddit.com/r/emacs/comments/1ihn2tv/comment/mb0ja8k/) has been using the minimal-emacs.d config for the past several months and loves it. His previous setup used to take around 4 seconds to load, but with minimal-emacs.d, it now loads in just 1 second.
- [LionyxML on Reddit](https://www.reddit.com/r/emacs/comments/1ihn2tv/comment/mb35t9y/) considers that *minimal-emacs.d* contains one of the best README files he has ever read. The author of *minimal-emacs.d* found his comment encouraging. Reading this README.md is highly recommended for anyone looking to start customizing their *minimal-emacs.d* configuration.
- [cyneox on Reddit](https://www.reddit.com/r/emacs/comments/1ihn2tv/comment/mdnzgqx/): "Still using it and loving it! Thanks for the regular updates."
- [panchoh on GitHub](https://github.com/jamescherti/minimal-emacs.d/pull/62#issuecomment-2869865979): "...thank you, @jamescherti! Keep up the fantastic work you are doing!"
- [xzway on Reddit](https://www.reddit.com/r/emacs/comments/1p9y8h4/comment/nrh8dye/): "The minimal-emacs.d configuration is very well-designed and non-intrusive. I'm also using it to refactor my configuration."
- [jeenajeena on Reddit](https://www.reddit.com/r/emacs/comments/1p9y8h4/comment/nrfk13i/): "Thank you. Plenty of inspiring settings. Worth to be read line by line."
- [uutangohotel on Reddit](https://www.reddit.com/r/emacs/comments/1p9y8h4/comment/nrg5kja/): "I get a lot out of minimal-emacs.d — thank you! I use stow to manage my dotfiles in a git repo. I created a submodule in one dir for minimal-emacs.d and another for my “overrides”, e.g. post-init.el. Easy and works great."
- [sunng on Reddit](https://www.reddit.com/r/emacs/comments/1p9y8h4/comment/ns1nehi/): "Nice work! I just created a nix flake to using it on my dev servers https://codeberg.org/sunng/minimal-emacs.d-nix-hm "
Please share your configuration. It could serve as inspiration for other users.
<!-- markdown-toc start - Don't edit this section. Run M-x markdown-toc-refresh-toc -->
## Table of Contents
- [*minimal-emacs.d* - A Customizable Emacs `init.el` and `early-init.el` that Provides Better Defaults and Faster Startup](#minimal-emacsd---a-customizable-emacs-initel-and-early-initel-that-provides-better-defaults-and-faster-startup)
- [Introduction](#introduction)
- [Looking for the ideal starter kit to customize Emacs? You have found it.](#looking-for-the-ideal-starter-kit-to-customize-emacs-you-have-found-it)
- [Looking for the ideal starter kit to customize Emacs? You have found it.](#looking-for-the-ideal-starter-kit-to-customize-emacs-you-have-found-it)
- [Startup](#startup)
- [Comments from minimal-emacs.d users](#comments-from-minimal-emacsd-users)
- [Install minimal-emacs.d](#install-minimal-emacsd)
- [Install minimal-emacs.d into `~/.emacs.d`](#install-minimal-emacsd-into-emacsd)
- [Alternative: Install minimal-emacs.d into `~/.minimal-emacs.d`](#alternative-install-minimal-emacsd-into-minimal-emacsd)
@@ -118,7 +141,6 @@ In addition to *minimal-emacs.d*, startup speed is influenced by your computer's
- [Why did the author develop minimal-emacs.d?](#why-did-the-author-develop-minimal-emacsd)
- [How to keep minimal-emacs.d pre-\*.el and post-\*.el files in a separate directory?](#how-to-keep-minimal-emacsd-pre-el-and-post-el-files-in-a-separate-directory)
- [How to make *minimal-emacs.d* install packages in the early-init phase instead of the init phase?](#how-to-make-minimal-emacsd-install-packages-in-the-early-init-phase-instead-of-the-init-phase)
- [Testimonials from users](#testimonials-from-users)
- [Minimal-emacs.d configurations from users](#minimal-emacsd-configurations-from-users)
- [Features](#features)
- [Author and license](#author-and-license)
@@ -136,7 +158,7 @@ In addition to *minimal-emacs.d*, startup speed is influenced by your computer's
Execute the following command install this repository into `~/.emacs.d`:
```
git clone https://github.com/jamescherti/minimal-emacs.d ~/.emacs.d
git clone --depth 1 https://github.com/jamescherti/minimal-emacs.d ~/.emacs.d
```
### Alternative: Install minimal-emacs.d into `~/.minimal-emacs.d`
@@ -145,7 +167,7 @@ To install *minimal-emacs.d* in a non-default directory, use the `--init-directo
1. Clone the repository into `~/.minimal-emacs.d/` using:
```
git clone https://github.com/jamescherti/minimal-emacs.d ~/.minimal-emacs.d
git clone --depth 1 https://github.com/jamescherti/minimal-emacs.d ~/.minimal-emacs.d
```
2. Start Emacs with the new configuration directory:
@@ -1064,7 +1086,7 @@ To enable Tree-sitter, add the following to your `~/.emacs.d/post-init.el`:
### Auto upgrade Emacs packages
The `auto-package-update` package that automates the process of updating installed packages managed by *package.el*. Instead of requiring users to manually invoke `package-list-packages` and update each package, `auto-package-update` can check for available updates at regular intervals, perform updates in the background, and optionally hide the results buffer or prompt before applying changes.
The [auto-package-update](https://github.com/rranelli/auto-package-update.el) automates the process of updating installed packages managed by *package.el*. Instead of requiring users to manually invoke `package-list-packages` and update each package, `auto-package-update` can check for available updates at regular intervals, perform updates in the background, and optionally hide the results buffer or prompt before applying changes.
To configure **auto-package-update**, add the following to `~/.emacs.d/post-init.el`:
@@ -1989,10 +2011,13 @@ If you prefer MELPA Stable over MELPA, you can add MELPA Stable and prioritize i
;; This change increases MELPA Stable priority to 70, above MELPA,
;; ensuring that MELPA is preferred for package installations
;; over MELPA Stable.
(setq package-archive-priorities '(("gnu" . 90)
("nongnu" . 80)
("melpa-stable" . 70)
("melpa" . 60)))
;; (Note: The minimal-emacs.d author does not assign higher priority to MELPA
;; Stable than to MELPA.)
;;
;; (setq package-archive-priorities '(("gnu" . 90)
;; ("nongnu" . 80)
;; ("melpa-stable" . 70)
;; ("melpa" . 60)))
```
### How to load a local lisp file for machine-specific configurations?
@@ -2137,20 +2162,6 @@ To install and load packages during the early-init phase, add the following to `
A drawback of using the early-init phase instead of init is that if a package fails (e.g, due to a network issue), no output will be displayed in the Emacs GUI. You will need to open a terminal to view Emacs's stdout for error messages.
### Testimonials from users
- [JamesBrickley (Shout out to this starter-kit: Minimal-Emacs )](https://www.reddit.com/r/emacs/comments/1epz7qn/shout_out_to_this_starterkit_minimalemacs/) appreciates that *minimal-emacs.d* provides an optimized *early-init.el* and *init.el* for fast startup times and sensible default settings. He highlights that the project includes all the essential configurations needed for a well-tuned Emacs setup, eliminating the need to sift through conflicting advice on topics like garbage collection optimization. While he has encountered similar settings before, he also discovered new optimizations he had not seen elsewhere.
- [Brandon Schneider (skarekrow)](https://github.com/jamescherti/compile-angel.el/issues/5#issuecomment-3186187000): "...the minimal-emacs project is incredible. I love how documented it is as a beginner to learn from. Thank you for all the effort you've put into that and the other packages you maintain. It's a huge boon to new users."
- [Leading_Ad6415 commented on Reddit](https://www.reddit.com/r/emacs/comments/1feaf37/comment/lmw7ijd/) that after switching to *minimal-emacs.d*, their configuration execution time decreased from 3 seconds to just 1 second by simply replacing their `init.el` and `early-init.el` files with those from the project.
- [Another user commented on Reddit](https://www.reddit.com/r/emacs/comments/1feaf37/comment/lrsfd64/), highlighting how a minimal-emacs.d significantly enhanced their Emacs performance. They reported substantial startup time reductions on both their main machine (from ~2.25 to ~0.95 seconds) and an older laptop (from ~2.95 to ~1.27 seconds) while also experiencing a generally snappier performance within Emacs. The user expressed gratitude for the project, calling it fantastic.
- [Cyneox commented on Reddit](https://www.reddit.com/r/emacs/comments/1gh687a/comment/lwdv18t/), expressing gratitude for the resource and sharing their experience. They mentioned it was their fourth attempt to set up a vanilla configuration and highlighted that they had been using the repository as a foundation for their customizations over the past few days. They appreciated the absence of unexplained behavior and the clear instructions on where to place files. The user reported successful testing on both Linux and macOS, noting that everything functioned smoothly, including in the terminal.
- [Sebagabones](https://github.com/jamescherti/minimal-emacs.d/issues/77): "...let me say that I am loving minimal-emacs.d, it has been brilliant so far! :)"
- [Mlepnos1984](https://www.reddit.com/r/emacs/comments/1lz181i/comment/n2yjj17/): "I give you an A+ on documentation, the readme is great!"
- [rrajath](https://www.reddit.com/r/emacs/comments/1ihn2tv/comment/mb0ja8k/) has been using the minimal-emacs.d config for the past several months and loves it. His previous setup used to take around 4 seconds to load, but with minimal-emacs.d, it now loads in just 1 second.
- [LionyxML](https://www.reddit.com/r/emacs/comments/1ihn2tv/comment/mb35t9y/) considers that *minimal-emacs.d* contains one of the best README files he has ever read. The author of *minimal-emacs.d* found his comment encouraging. Reading this README.md is highly recommended for anyone looking to start customizing their *minimal-emacs.d* configuration.
- [cyneox](https://www.reddit.com/r/emacs/comments/1ihn2tv/comment/mdnzgqx/): "Still using it and loving it! Thanks for the regular updates."
- [panchoh](https://github.com/jamescherti/minimal-emacs.d/pull/62#issuecomment-2869865979): "...thank you, @jamescherti! Keep up the fantastic work you are doing!"
### Minimal-emacs.d configurations from users
- [Victor Dorneanu's minimal-emacs.d configuration](https://github.com/dorneanu/dotfiles/blob/master/minimal-emacs/config.org)
@@ -2163,7 +2174,7 @@ A drawback of using the early-init phase instead of init is that if a package fa
- [smahm006 minimal-emacs.d configuration](https://github.com/smahm006/minimal-emacs.d)
Please share your configuration. It could serve as inspiration for other users.
- [zendo: Emacs literate configuration](https://github.com/zendo/nsworld/blob/main/dotfiles/org/all-emacs.org)
## Features
@@ -2227,6 +2238,9 @@ You should have received a copy of the GNU General Public License along with thi
- [minimal-emacs.d @GitHub](https://github.com/jamescherti/minimal-emacs.d)
Contribution from the minimal-emacs.d community:
- [Sunng's minimal-emacs.d Nix flake](https://codeberg.org/sunng/minimal-emacs.d-nix-hm): A Nix flake that enables reproducible deployment of minimal-emacs.d, allowing the Emacs configuration to be pinned, built, and installed through Nix.
Other Emacs packages by the same author:
- [compile-angel.el](https://github.com/jamescherti/compile-angel.el): **Speed up Emacs!** This package guarantees that all .el files are both byte-compiled and native-compiled, which significantly speeds up Emacs.
- [outline-indent.el](https://github.com/jamescherti/outline-indent.el): An Emacs package that provides a minor mode that enables code folding and outlining based on indentation levels for various indentation-based text files, such as YAML, Python, and other indented text files.

View File

@@ -4,7 +4,7 @@
;; URL: https://github.com/jamescherti/minimal-emacs.d
;; Package-Requires: ((emacs "29.1"))
;; Keywords: maint
;; Version: 1.3.0
;; Version: 1.3.1
;; SPDX-License-Identifier: GPL-3.0-or-later
;;; Commentary:
@@ -472,6 +472,8 @@ this stage of initialization."
;; that emphasizes performance over clarity.
(setq use-package-expand-minimally (not minimal-emacs-debug))
(setq package-quickstart-file
(expand-file-name "package-quickstart.el" user-emacs-directory))
(setq use-package-minimum-reported-time (if minimal-emacs-debug 0 0.1))
(setq use-package-verbose minimal-emacs-debug)
(setq package-enable-at-startup nil) ; Let the init.el file handle this

16
init.el
View File

@@ -4,7 +4,7 @@
;; URL: https://github.com/jamescherti/minimal-emacs.d
;; Package-Requires: ((emacs "29.1"))
;; Keywords: maint
;; Version: 1.3.0
;; Version: 1.3.1
;; SPDX-License-Identifier: GPL-3.0-or-later
;;; Commentary:
@@ -106,8 +106,6 @@
;; Position underlines at the descent line instead of the baseline.
(setq x-underline-at-descent-line t)
(setq tramp-verbose 1)
(setq tramp-completion-reread-directory-timeout 50)
(setq remote-file-name-inhibit-cache 50)
;; Automatically rescan the buffer for Imenu entries when `imenu' is invoked
@@ -120,6 +118,15 @@
;; Disable auto-adding a new line at the bottom when scrolling.
(setq next-line-add-newlines nil)
;; This setting forces Emacs to save bookmarks immediately after each change.
;; Benefit: you never lose bookmarks if Emacs crashes.
(setq bookmark-save-flag 1)
;;; tramp
(setq tramp-verbose 1)
(setq tramp-completion-reread-directory-timeout 50)
;;; Files
;; Delete by moving to trash in interactive mode
@@ -539,7 +546,8 @@
;;; Remove warnings from narrow-to-region, upcase-region...
(dolist (cmd '(list-timers narrow-to-region upcase-region downcase-region
(dolist (cmd '(list-timers narrow-to-region narrow-to-page
upcase-region downcase-region
list-threads erase-buffer scroll-left
dired-find-alternate-file set-goal-column))
(put cmd 'disabled nil))

View File

@@ -19,6 +19,9 @@
(eval-print-last-sexp)))
(load bootstrap-file nil 'nomessage))
(unless (memq 'use-package-autoloads features)
(straight-use-package 'use-package))
;; The compile-angel package automatically byte-compiles and
;; native-compiles Emacs Lisp libraries. It should be loaded before
;; any other package.