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.
Emacs (with wayland) is installed via apt
sudo apt-get install emacs-pgtkOn 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"'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
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:$PATHThen restart the machine. Or re-import environment to avoid restart
systemctl --user import-environment PATHVerify that the PATH was picked up by systemd environment
systemctl --user show-environment | grep PATHEven though python is installed using xcode command line tools, it
has complications. So we will first install python again using
homebrew
brew install pythonThis would install python3 executable in the /usr/local/bin
directory.
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/pythonuv is a much better way to work with Python. It’s all you need!
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-analyzerFor rust development, we’re using 3 emacs modes:
rust-mode: Provides indentation, syntax highlighting and integration with cargo, rustfmt (formatter) and clippy (lint)rusticmode: Builds on top of the rust-mode and provides missing features. One of the thing thatrusticdoes 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 isrusticbeing used for.cargo: To perform cargo tasks from emacsrust-playgroundmode: Minor mode for quickly running snippets of code from within emacs as an alternative to the online rust playground - https://play.rust-lang.org
- Rustfmt indentation not consistent with emacs indentation
- Install pgformatter for formatting sql buffers
brew install pgformatter
brew install llvmnpm install -g typescript-language-server typescript- https://github.com/clojure-emacs/cider-nrepl
- Required by the latest Cider release
- The easiest way to set it up is to add it as a leiningen plugin
either in your project’s
project.cljfile or in the:userprofile in ~~/.lein/profiles.clj~. - https://github.com/clojure-emacs/cider#cider-nrepl-middleware
- https://github.com/clj-kondo/clj-kondo
- For flycheck in clojure buffers
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 can be handy for visualizing org-roam graph although org-roam-ui is a much better interface.
brew install graphvizNote that graphviz is not required for org-roam-ui
Ledger needs to be installed
brew install ledgerRipgrep is required for search functionality in projectile mode
On windows, cygwin needs to be installed
choco install Cygwin