Skip to content

rennsax/.emacs.d

Repository files navigation

Celeste Emacs

celeste strawberry

Simple, lightweight and bespoked Emacs configurations.


Installation

Emacs

You can get the source code for Emacs here. Either use curl -sSLO or wget.

macOS

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.

NixOS

Emacs is available on Nixpkgs.

Hard Dependencies

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).

ToolUsed byDescription
trash-clitrashLinux. Buggy on macOS.
macos-trashtrashmacOS.
man-dbmanmacOS. Most GNU/Linux distros have builtin.
ripgrepconsult, deadgrepAnother Rust winner!
fdconsultfind(1)’s alternative.
pandocorg-pandoc-importRequired.
pngpasteorg-downloadmacOS.
gimp*org-downloadUsed by org-download-edit.
libenchantjinxSpell checker.
libvtermvtermTerminal emulator in Emacs.
macismsismacOS.
LibreOffice*doc-view[fn:1]For previewing documents.
math-previewmath-previewPreview math formulas inline.
ghostscriptdoc-viewPDF -> PNG
emacs-lsp-boosteremacs-lsp-boosterWrapper executable for LSP client.
prettier*format-allFormatter for many languages.

[fn:1] For more dependencies of doc-view package, use M-x find-library doc-view.

macOS

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

NixOS

Check my personal dotfiles to see how I install external dependencies for Emacs: rennsax/dotfiles:modules/emacs/emacs-deps.nix.

Fonts

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 对齐问题。

Optional

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.

Misc.

Map CapsLock to Ctrl

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.

Choose LSP Servers

I need to manually choose and install the LSP server for each programming language.

Python

Choices:

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

Markdown

LSP: artempyanykh/marksman. Basic usage: create toc by code actions, rename headings, …

Copyright Notice

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.

About

My Emacs configuration. 🍓

Resources

License

Stars

Watchers

Forks

Packages

No packages published