Skip to content
Personal emacs configuration
Emacs Lisp YASnippet
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github/workflows
lisp
snippets
.ci.el
.gitignore
.mc-lists.el
LICENSE
README.md
init.el
screenshot.png

README.md

Emacs

Screenshot

My personal Emacs configuration with contribution from friends.

Hopefully others might find this helpful. I don't believe in "starter-packs" such as oh-my-zsh, prelude or Spacemacs. I feel like the "one size fits all" approach leads to bloat and means that users are not familiar with either the tool or the options the package configured for them.

I mostly assembled bits and pieces over time as the need grew, but some sources served as inspiration and deserve explicit credit:

Notes:

  • Emacs 26.1 is required, older version will not work.
  • For spell checking to work an ispell compatible program and dictionary need to be installed, e.g. aspell-en.
  • By default cmark is used to markdown export/preview so it needs to be installed.

Personal customizations

Users wishing to customize their configurations can use these files in ~/.emacs.site.d:

  1. init.el - loaded before any code is run but after use-package is available
  2. config.el - loaded after configuration has finished

For example if one would like to change the theme and font they could do so by placing the following in ~/.emacs.site.d/init.el:

(setq my/theme 'doom-solarized-light
      my/font-family "Consolas")

This directory can also be a git repository. For an example see https://github.com/drrlvn/.emacs.site.d.

Working with Python

It's highly recommended to develop Python projects in virtual environment. Once you have a virtual environment, use C-c p E to define the variable pyvenv-activate for the current project. Store the path of the virtual environment inside this variable. Remember to quote that path with double quotation marks.

It's also recommended to install the Python Language Server inside your virtual environment, as well as Pylint if you're interested.

If you follow these steps then when visiting a Python file, the modeline should indicate that the Python Language Server is running by showing LSP[pyls:pid].

Auto formatting

This configuration supports automatic Python formatting on save. Since there's no consensus about a Python formatting tool, or whether to use such at all, this feature is turned off and can be enabled on project basis.

Two buffer local variables were created for this - my/python-isort-on-save which runs isort and my/python-black-on-save which runs black.

These variables are local buffer and are nil by default. They can be set for a given project by using dir-local variables, just like pyvenv-activate. Use C-c p E to set them.

You can’t perform that action at this time.