a Clojure, Python, JavaScript and TypeScript friendly emacs config
This repo was originally forked from the emacs for clojure repo.
- Menu bar is turned off
- Show line numbers
- Graphical toolbar is removed
- Dark theme (on first run, you probably have to confirm that Emacs should be allowed to load the theme)
- Custom window size and position (customized for the machine I am using - a Dell XPS 13)
- Navigation up & down smoothly, without the annoying buffer centering
- Disabled the Emacs startup message
... and more. Have a look at the ui.el file and the other config files in the customizations folder.
- Comment and uncomment a line or section with
C-;
- Enable special chars in the editor, like ~ and ^.
- Move text up and down with
control shift up
andcontrol shift down
- Multiple select, "mark next like this" with
C->
- Disabled the "suspend-frame" command, too easy to press
C-z
by mistake - Disabled the Emacs startup message
- A buffer is auto saved when losing focus (using the package
super-save
)
... and more. Have a look at the files in the customizations folder.
To enable flake8, mypy and black as soon as opening a Python file you will need to have those installed on your machine.
pip3 install flake8 flake8-bugbear mypy black ruff
Alternatively, you can manually enable these tools after have activated a virtual environment (containing the tools) within Emacs.
The shell is set to IPython
and Emacs will expect to find it installed on your machine.
pip3 install ipython
Or, change the shell setting in customizations/setup-python.el
, according to the elpy docs about interpreter setup.
I am evaluating (pun) ways to write code in a Clojure-like interactive way.
My current setup:
- IPython as the shell.
- Evaluating code (entire buffer, region or selection) with elpy commands.
- A custom IPython config to auto-reload changed.
How to create and edit IPython config files
My custom IPython
config (added/uncommented these rows and added values). This will enable auto-reload of modules in the shell.
c.InteractiveShellApp.extensions = ['autoreload']
c.InteractiveShellApp.exec_lines = ['%autoreload 2']
Make sure you have clj-kondo
installed on your machine according to the install instructions
Searches the current files parent directories for the node_modules/.bin/' directory and adds it to the buffer local
exec-path'. This allows Emacs to find project based installs of e.g. eslint.
Automatically activate python virtualenvs.
Blacken uses black to format a Python buffer. It can be called explicitly on a certain buffer, but more conveniently, a minor-mode 'blacken-mode' is provided that turns on automatically running black on a buffer before saving.
Provides a Clojure interactive development environment for Emacs, built on top of nREPL.
Provides refactoring support for Clojure projects. It complements the refactoring functionality you'd find in clojure-mode and CIDER.
Provides font-lock, indentation, navigation and basic refactoring for the Clojure programming language (http://clojure.org).
Provides additional font-locking for clojure-mode.
These five color themes are designed for use with Emacs' built-in theme support in Emacs 24. However, they also work with older Emacs versions, in which case color-theme.el is required.
Company is a modular completion framework. Modules for retrieving completion candidates are called backends, modules for displaying them are frontends.
company-mode completion back-end for Python JEDI.
(NOTE: I had to run jedi:install-server
from within emacs to make this backend work)
Major mode for editing Dockerfiles
Dumb Jump is an Emacs "jump to definition" package with support for 40+ programming languages that favors "just working" over speed or accuracy. Note: to be able to find and jump to re-agent events and subscriptions I have added Silversearcher according to the dumb-jump install instructions. The lecacy dumb-jump-go, however, do find those without the extra OS dependency.
EditorConfig helps developers define and maintain consistent coding styles between different editors and IDEs.
The Emacs Lisp Python Environment in Emacs.
Display emojis in Emacs.
Allows environment variables to be retrieved from the shell, so that Emacs will see the same values you get in a terminal.
On-the-fly syntax checking for GNU Emacs 24.
This package integrates clj-kondo with Emacs via flycheck. Make sure you also have clj-kondo installed globally on your machine according to the official install instructions.
Flymake plugin to run a linter for python buffers using ruff.
GPTel is a simple Large Language Model chat client for Emacs, with support for multiple models/backends.
graphql-mode is an emacs mode to edit GraphQL schema and queries.
If you use the excellent `ido-mode' for efficient completion of file names and buffers, you might wonder if you can get ido-style completion everywhere else too.
Provides commands, which use the external isort tool to tidy up the imports in the current buffer.
Note: Install isort on your machine pip install isort
.
Improved JavaScript editing mode.
Run a JavaScript interpreter in an inferior process window.
Major mode for editing JSON files. Extends the builtin js-mode to add better syntax highlighting for JSON and some nice editing keybindings.
Basic highlighting and indentation for justfiles.
Visualize your Python code while you type it in Emacs. Activate it with M-x live-py-mode
.
Magit is an interface to the version control system Git, implemented as an Emacs package.
Major mode for Markdown-formatted text, set to use the GitHub markdown format.
Note: the configuration uses pandoc
and it need to be installed on the machine when previewing or rendering to a different format.
For Mac OS X: brew install pandoc
.
Allows you to move the current line using M-up / M-down if a region is marked, it will move the region instead.
Multiple cursors for Emacs. This is some pretty crazy functionality, so yes, there are kinks. Don't be afraid though, I've been using it since 2011 with great success and much merriment.
Minor mode for interacting with Pandoc.
Minor mode for editing parentheses.
A Pipenv porcelain inside Emacs.
A framework for multiple major modes (MMM) inside a single Emacs buffer.
I use this mode to get syntax highlighting for inline SQL in Python files. Activate the mode with M-x poly-python-sql-mode.
js/ts prettier mode
Manage and navigate projects in Emacs easily
Add support for pyenv.
Rainbow-delimiters is a "rainbow parentheses"-like mode which highlights parentheses, brackets, and braces according to their depth. Each successive level is highlighted in a different color. This makes it easy to spot matching delimiters, orient yourself in the code, and tell which statements are at a given level.
Show informations on the side. This library provides the frontend UI to display information either on the left/right side of the buffer window.
Show flycheck errors with sideline.
M-x interface with Ido-style fuzzy matching.
super-save auto-saves your buffers, when certain events happen - e.g. you switch between buffers, an Emacs frame loses focus, etc. You can think of it as both something that augments and replaces the standard auto-save-mode.
A collection of paredit-like functions for editing in html-mode.
Major mode for terraform configuration files.
TypeScript interactive development environment for Emacs.
TypeScript specific mode, using it in combination with tide.
A tree layout file explorer for Emacs.
Major mode for editing web templates.
Minor mode for Emacs that displays the key bindings following your currently entered incomplete command (a prefix) in a popup.
Major mode for editing YAML files.