Skip to content

Latest commit

 

History

History
137 lines (114 loc) · 4.51 KB

Setup.org

File metadata and controls

137 lines (114 loc) · 4.51 KB

Setup

Download Emacs

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"'

Common system dependencies

Programming environments

Python

Install python

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

Install python dependencies

Before anything, first upgrade the version of pip

python -m pip install -U pip

Now install the requirements

IPython

We need IPython because the python shell interpreter is configured to be “ipython”.

python -m pip install ipython
flake8

Flake8 is required as a backend for flycheck in python mode. Unless flake8 is installed, flycheck won’t work in python buffers. Once flake8 is installed, flycheck will start working automatically (no config is required).

python -m pip install flake8
jedi-language-server

This is used as lsp server

python -m pip install jedi-language-server
Virtualenv (optional)

Since Python 3.3, venv module is built into python so virtualenv is not required. But it may be installed for older versions of python if required.

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

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