DEV Community

Ivan Guerreschi
Ivan Guerreschi

Posted on

1 1

Configure Emacs for Clojure

Basic configuration to start using Clojure with Emacs

Create the init.el configuration file

Open a terminal and create a directory: mkdir ~/emacs.d
Enter the newly created directory: cd emacs.d
Create file: touch init.el

Install MELPA repository

Editing file: emacs init.el

(require 'package)
(let* ((no-ssl (and (memq system-type '(windows-nt ms-dos))
                    (not (gnutls-available-p))))
       (proto (if no-ssl "http" "https")))
  (when no-ssl (warn "\
Your version of Emacs does not support SSL connections,
which is unsafe because it allows man-in-the-middle attacks.
There are two things you can do about this warning:
1. Install an Emacs version that does support SSL and be safe.
2. Remove this warning from your init file so you won't see it again."))
(add-to-list 'package-archives (cons "melpa" (concat proto ://melpa.org/packages/")) t)
  ;; Comment/uncomment this line to enable MELPA Stable if  desired.  See `package-archive-priorities`
  ;; and `package-pinned-packages`. Most users will not need or want to do this.
  ;;(add-to-list 'package-archives (cons "melpa-stable" (concat proto "://stable.melpa.org/packages/")) t)
  )
(package-initialize)

With this code we have installed the MELPA repository, this repository contains many packages for expanding Emacs

Install CIDER

CIDER is the Clojure(Script) Interactive Development Environment that Rocks!

(use-package cider
  :ensure t)

Save the file C-x C-s close C-x C-c and restart Emacs

This is a basic configuration for using Clojure with Emacs

AWS Q Developer image

Your AI Code Assistant

Automate your code reviews. Catch bugs before your coworkers. Fix security issues in your code. Built to handle large projects, Amazon Q Developer works alongside you from idea to production code.

Get started free in your IDE

Top comments (0)

Billboard image

Create up to 10 Postgres Databases on Neon's free plan.

If you're starting a new project, Neon has got your databases covered. No credit cards. No trials. No getting in your way.

Try Neon for Free →

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay