Skip to content

Jousimies/.emacs.d

Repository files navigation

Jousimies’s Personal Emacs Configuration

Interface Show

src/interface.png 上面的图生成方式如下。如果你打算使用下面的命令,需要对相应的尺寸进行修改。

magick convert -size 2880x1800 xc:black -fill white -draw "path 'M 0,100 C 1000,200 800,1600 2880,1700 V 1800 H 2880 V 0 H 0'" mask.png
magick composite dark.png light.png mask.png -alpha Off shot.png
rm mask.png

Emacs is Swiss Army Knife

src/emacscando.png

Packages management

尝试过的 Emacs 配置方式有多种,有 package.el straight.el git submodule borg.el

2023-02-26 目前升级到 Emacs 29.0.60,使用 git submodule 和 use-package 相结合的方式管理 Packages。

git submodule 可以更好的管理 package 的版本,相比较直接使用 elpa 和 melpa 上面的包,可以追踪上游的状态。

use-package 则是 Emacs 内置包。能使用 Emacs 内置包则不使用第三方插件。合理使用 use-package 管理配置可以有效的提高 Emacs 的启动速度。

git clone --depth=1 https://github.com/Jousimies/.emacs.d.git -b master

git submodule update --init --recursive

git submodule foreach git reset --hard

git submodule foreach git checkout master

Emacs Configuration

显示启动时间

(defun my/packages-installed (load-path)
    (let ((my/packages 0))
      (dolist (path load-path)
        (when (not (string-prefix-p "/Applications/" path))
          (setq my/packages (1+ my/packages))))
      my/packages))

(add-hook 'window-setup-hook
            (lambda ()
              (garbage-collect)
              (let ((curtime (current-time)))
                (with-current-buffer "*scratch*"
                  (goto-char (point-max))
                  (insert
                   (concat "\n"
                           (format ";; Emacs Startup Times: init:%.03f total:%.03f gc-done:%d"
                                   (float-time (time-subtract after-init-time before-init-time))
                                   (float-time (time-subtract curtime before-init-time))
                                   gcs-done)
                           "\n"
                           (format ";; Total Packages Required: %d" (my/packages-installed load-path))
                           "\n\n"))
                  90))))

Keybindings

./src/keybinding.png

此图片通过 Tex 生成,该文件的模版来自 bbatsov/prelude: Prelude is an enhanced Emacs 25.1+ distribution that should make your experience with Emacs both more pleasant and more powerful.

ELISP learning

使用 Emacs 有必要学习一些 elisp 知识。

Acknowledgment

If I have seen further, it is by standing on the shoulders of giants. ---- Sir Isaac Newton