Skip to content

Latest commit

 

History

History
167 lines (147 loc) · 5.86 KB

File metadata and controls

167 lines (147 loc) · 5.86 KB

Setup

Currently I use emacs on Linux (Ubuntu) primarily. But at some point I have used emacs on Linux (ubuntu), MacOS as well as Windows. So this setup has different section for specific OS where applicable.

Download Emacs

Ubuntu 24.04

Emacs (with wayland) is installed via apt

sudo apt-get install emacs-pgtk

MacOS

On MacOS I install emacs using the homebrew-emacs-plus formula. To install follow the instructions in the README of the above git repo. For quick reference, you just need to run,

brew tap d12frosted/emacs-plus
brew install emacs-plug@29

# Create a link in Applications folder
osascript -e 'tell application "Finder" to make alias file to posix file "/usr/local/opt/emacs-plus@29/Emacs.app" at POSIX file "/Applications"'

Windows

System dependencies

This emacs setup depends on external tools and programs, so they need to be installed and ensured to be available in the PATH that emacs is started with

Configuring PATH

Ubuntu

GNOME uses PATH variable from the systemd environment. To modify the PATH, create a conf file at ~/.config/environment.d/path.conf as follows,

# Dirs to be added to PATH in the env of apps launched from GUI

PATH=$HOME/.local/bin:$HOME/.nvm/versions/node/v22.12.0/bin:$PATH

Then restart the machine. Or re-import environment to avoid restart

systemctl --user import-environment PATH

Verify that the PATH was picked up by systemd environment

systemctl --user show-environment | grep PATH

MacOS

Windows

Programming environments

Python

Install Python

MacOS

Even though python is installed using xcode command line tools, it has complications. So we will first install python again using homebrew

brew install python

This would install python3 executable in the /usr/local/bin directory.

Ensure that python executable is available on the machine

On later MacOS versions, python is not available as it was meant for python2 which is deprecated. However, many emacs modes assume python executable to be available. In that case, create a symlink to it

bin_dir=$(dirname $(which python3))
sudo ln -sv $bin_dir/python3 $bin_dir/python
Move to uv based installation on MacOS
Ubuntu

uv is a much better way to work with Python. It’s all you need!

Windows
Move to uv based installation on Windows

Rust

Follow the rust documentation to install rust on the machine.

The only external dependency for rust development is rust-analyzer. It can be installed using homebrew

rustup component add rust-analyzer

For rust development, we’re using 3 emacs modes:

  1. rust-mode: Provides indentation, syntax highlighting and integration with cargo, rustfmt (formatter) and clippy (lint)
  2. rustic mode: Builds on top of the rust-mode and provides missing features. One of the thing that rustic does is configure eglot but I have disabed that and doing it separately instead for more control. So at this point, I am not sure what exactly is rustic being used for.
  3. cargo: To perform cargo tasks from emacs
  4. rust-playground mode: Minor mode for quickly running snippets of code from within emacs as an alternative to the online rust playground - https://play.rust-lang.org

Known issues

SQL

  • Install pgformatter for formatting sql buffers
    brew install pgformatter
        

C langs i.e. C, C++

Install the clangd language server

brew install llvm

Javascript/Typescript

Install node and npm

Install the typescript and typescript-language-server

npm install -g typescript-language-server typescript

Clojure

Leiningen

nREPL middleware

clj-kondo

Org mode

Custom script for lower case UUIDs on MacOS

On macos, the default uuidgen script generates UUIDs in uppercase. For consistency, enforce lower case UUID generation by copying the uuidgen-lower provided in this repo

ln -sv bin/uuidgen-lower /usr/local/bin/

Graphviz for visualizing org roam graph

Graphviz can be handy for visualizing org-roam graph although org-roam-ui is a much better interface.

brew install graphviz

Note that graphviz is not required for org-roam-ui

org-ledger

Ledger needs to be installed

brew install ledger

Projectile

Ripgrep is required for search functionality in projectile mode

Cygwin on Windows

On windows, cygwin needs to be installed

choco install Cygwin