You can get the source code for Emacs here. Either use curl -sSLO
or wget
.
Directly installed from Homebrew’s default formulae is OK, but you may get an Emacs without some essential new features, such as native compilation. I recommend installing a third-party distributed Emacs bundles such as d12frosted/homebrew-emacs-plus.
brew install make cmake
# Additional arguments are passed to ./configure
brew install emacs-plus@29 \
--with-native-comp --with-imagemagick
You can also pick your favorite icon here.
Emacs is available on Nixpkgs.
Hard dependencies are external tools that are required by some Emacs packages.
To use these packages, you need first install the corresponding tools with your
favorite package manager on your platform (such as homebrew
on macOS, apt
on
Ubuntu).
Hard dependencies are listed here. An asterisk symbol indicates that the tool is optional for the package(s).
Tool | Used by | Description |
---|---|---|
trash-cli | trash | Linux. Buggy on macOS. |
macos-trash | trash | macOS. |
man-db | man | macOS. Most GNU/Linux distros have builtin. |
ripgrep | consult, deadgrep | Another Rust winner! |
fd | consult | find(1) ’s alternative. |
pandoc | org-pandoc-import | Required. |
pngpaste | org-download | macOS. |
gimp* | org-download | Used by org-download-edit . |
libenchant | jinx | Spell checker. |
libvterm | vterm | Terminal emulator in Emacs. |
macism | sis | macOS. |
LibreOffice* | doc-view[fn:1] | For previewing documents. |
math-preview | math-preview | Preview math formulas inline. |
ghostscript | doc-view | PDF -> PNG |
emacs-lsp-booster | emacs-lsp-booster | Wrapper executable for LSP client. |
prettier* | format-all | Formatter for many languages. |
[fn:1] For more dependencies of doc-view package, use M-x find-library doc-view
.
A rough tutorial (not maintained since 2024-06-20).
# Basic dependencies.
brew install man-db ripgrep fd pandoc
# LaTeX.
brew install --cask mactex # or, of course, mactex-no-gui
# Extra dependencies for various packages.
brew install enchant libvterm
# For emacs-smart-input-source.
brew tap laishulu/macism && brew install macism
# For doc-view
brew install --cask libreoffice
Check my personal dotfiles to see how I install external dependencies for Emacs: rennsax/dotfiles:modules/emacs/emacs-deps.nix.
Here lists the fonts that I personally use.
- Monaspice: An innovative superfamily of fonts for code.
- FiraCode: Free monospaced font with programming ligatures.
- 更纱黑体: 极少数中英文宽度严格 2:1 的字体,适用于解决 org-table 对齐问题。
Install org-mode manually, for those who are interested in the newest features.
cd ~/.config/emacs/pacakges
git clone https://git.savannah.gnu.org/git/emacs/org-mode.git
cd org-mode/
make autoloads # This is mandatory.
make compile # Highly recommended, since org-mode contains a lot of functions.
It’s known that Emacs users (who respect vanilla key bindings) usually suffer from RIP after enjoying their Emacs journey for many years. The core leader of FSF, Richard Stallman, almost lost his ability to type because of RIP. See this interesting post. For those who rely on their typing skills to make a living, it’s rather important to take care of the finger health.
There are many suggestions for protecting your fingers from RIP. The most famous, or simplest suggestion, is to map CapsLock key to Ctrl. Emacs key bindings heavily reply on the Ctrl key, but the key is so far from our fingers while typing.
On macOS, we can easily set this: System Settings > Keyboard > Keyboard Shortcuts > Modifier Keys. You can also use the powerful Karabiner-Elements to configure your keyboard completely, which is my choice.
On Windows, you may find a lot of people teaching you to modify the Registry. It’s too complicated for me, though. I prefer to use Microsoft PowerToys to customize the keyboard.
On Linux, the routines vary from distros.
- Ubuntu: Gnome Tweaks (
gnome-tweaks
from the cmd) -> Additional Layout Options -> Ctrl position -> Caps Lock as Ctrl.
I need to manually choose and install the LSP server for each programming language.
Choices:
- Popular microsoft/pyright, a good LSP. But it has been discussed “isn’t good”.
- pylsp, if you hate Microsoft or NodeJS.
Other tools:
- ruff, linter and formatter, a neo-challenger, written in Rust.
- black, the uncompromising Python code formatter.
- isort, A Python utility / library to sort imports.
pylsp + ruff + isort, installed with pipx:
pipx install python-lsp-server
pipx inject python-lsp-server python-lsp-ruff
pipx inject python-lsp-server python-lsp-isort
LSP: artempyanykh/marksman. Basic usage: create toc by code actions, rename headings, …
The banner under the project name is a work from Celeste game asset, borrowed from Celeste Wiki, and licensed under CC BY-NC-SA 4.0 License. You may not use the material for commercial purposes.
I use this banner just because I’m a huge fan of Celeste game. If my actions infringe on any copyrights, please contact me and I will remove it. Thank a lot.