Some useful emacs snippets.
Last tested on:
- Emacs 30.1 (GUI version) on Windows 11
- Emacs 27 & 28 (GUI version) on Ubuntu 22.04
- Install Emacs.
- Ubuntu
sudo apt-get install emacs - Windows
Download with PowerShell and run the installer:wget -O ~/Downloads/emacs-29.4-installer.exe http://mirror.twds.com.tw/gnu/emacs/windows/emacs-29/emacs-29.4-installer.exe
- Ubuntu
- Download the init file.
- Ubuntu
wget -O ~/.emacs https://github.com/j3soon/dot-emacs/raw/refs/heads/master/.emacs - Windows
wget -O ~/AppData/Roaming/.emacs https://github.com/j3soon/dot-emacs/raw/refs/heads/master/.emacs
- Ubuntu
- Set up
Dark Solarized Themeaccording to the instructions below. - Set up
Microsoft YaHei Mono Font 12ptaccording to the instructions below. - Open Emacs and wait for installation
- Open
.emacsand comment out the following for fast startup:If you're on Windows, uncomment the following:;; (package-refresh-contents)(set-frame-font "Microsoft YaHei Mono 12" nil t) - If you are using Emacs OrgMode clock-in/clock-out features, make sure to set operating system language to English.
You can locate your init file by:
M-x describe-variable RET user-init-file RET
Ref: https://www.emacswiki.org/emacs/InitFile
The following are description of individual files
The full init file that combines all snippets.
- Requires manually download Dark Solarized Theme.
- Comment out update package code after first launch
- (Optional) Requires download Microsoft YaHei Mono Font.
The extensible vi layer for Emacs. (https://github.com/emacs-evil/evil)
Fix TAB key conflict with OrgMode.
Ref: https://emacs.stackexchange.com/a/28224
Emacs highlighting using Ethan Schoonover’s Solarized color scheme. (https://github.com/sellout/emacs-color-theme-solarized)
You should download the theme beforehand:
cd ~/.emacs.d # or `%APPDATA%\.emacs.d` on Windows
mkdir -p themes && cd themes
git clone https://github.com/sellout/emacs-color-theme-solarizedYou should download and install the font beforehand:
https://www.onlinewebfonts.com/download/9798f64007ae3426b2336e57dae4149c
Ref: https://orgmode.org/manual/Activation.html
Ref: https://orgmode.org/manual/Org-Indent-Mode.html
Ref: https://orgmode.org/worg/org-tutorials/org-column-view-tutorial.html
Ref: https://orgmode.org/manual/Breaking-Down-Tasks.html
Ref: https://orgmode.org/manual/TODO-dependencies.html
Ref: https://lists.gnu.org/archive/html/emacs-orgmode/2018-10/msg00013.html
Ref: https://orgmode.org/manual/TODO-types.html
Ref: https://orgmode.org/manual/Fast-access-to-TODO-states.html
Ref: https://orgmode.org/manual/Faces-for-TODO-keywords.html
Ref: https://www.gnu.org/software/emacs/manual/html_node/org/Closing-items.html
Show TODO/NEXT tasks with deadline/schedule/timestamps (ascending order)
C-c a d: Deadline modeC-c a s: Schedule modeC-c a f: Effort modeC-c a c: Timestamp mode
Ref: https://orgmode.org/worg/org-tutorials/org-custom-agenda-commands.html
Ref: https://orgmode.org/manual/Matching-tags-and-properties.html
Ref: https://orgmode.org/worg/org-tutorials/org-column-view-tutorial.html
Potential Improvements (Single q to quit): https://www.mail-archive.com/emacs-orgmode@gnu.org/msg101093.html
emacs --debug-initOlder versions of Emacs may have performance issues when editing large files. Consider updating to the latest Emacs.
M-x profiler-start RET RET
# perform actions
M-x profiler-report