/.emacs.d

⚙️ A personal Emacs configuration

Primary LanguageEmacs Lisp

.emacs.d

A personal Emacs configuration.

Installation

Clone the repository

git clone https://github.com/yilin-zhang/.emacs.d.git ~/.emacs.d
cd ~/.emacs.d
git submodule update --init

Install dependencies (macOS)

Global

brew tap homebrew/cask-fonts
brew install coreutils font-sarasa-gothic font-noto-serif-cjk-sc

Package

color-rg

brew install ripgrep

jinx (not used on Emacs 29)

  1. Install enchant and pkgconf
    brew install enchant pkgconf
        
  2. Override the configuration to use AppleSpell by default. Create or modify ~/.config/enchant/enchant.ordering:
    *:AppleSpell
    en_US:AppleSpell
        

nerd-icons

Install nerd fonts in Emacs: M-x nerd-icons-install-fonts

LSP

LanguageServer
Pythonpyright
JS/TStypescript-langauge-server
JSONvscode-json-languageserver
Vuevue-language-server
Lualua-language-server

ChatGPT

Put the OpenAI API key in a text file at ~/.emacs.d/custom/gptel-api-key.

Customization

Create file ~/.emacs.d/custom/custom-post.el. The configuration in the file will be loaded last.

Org

The most important configuration is to set org-agenda-files, so that Emacs knows where you agenda files are.

(use-package org
  :ensure nil
  :config
  (add-to-list 'org-agenda-files "~/info.org")
  (add-to-list 'org-agenda-files "~/inbox.org")
  ;; org-ref
  (setq reftex-default-bibliography '("~/references.bib"))
  ;; see org-ref for use of these variables
  (setq org-ref-bibliography-notes "~/bib-notes.org"
        org-ref-default-bibliography '("~/references.bib")
        org-ref-pdf-directory "~/bibtex-pdfs/")
  )

Elfeed (RSS)

Set the RSS feeds by setting elfeed-feeds. Example:

(setq elfeed-feeds '("https://protesilaos.com/books.xml"))

Denote

Set the denote bucket by setting denote-directory. Example:

(setq denote-directory "~/Documents/notebooks/denote")

Meow

Define some leader keys. Example:

(meow-leader-define-key
 '("t" . yilin/open-in-terminal)
 '("e" . yilin/open-in-finder))

GPTel

Add system prompts. Example:

(dolist (directive '((custom-role-a . "You are a large language model and ...")
                     (custom-role-b . "You are a large language model and ...")))
    (add-to-list 'gptel-directives directive))