This is a basic config file we’ve created to make it easy to start with emacs. It’s actually a little more than just “basic”. It should have most of the immediate needs for usage. It uses elpaca for package management. I decided on elpaca after much thought and trials with package.el , quelpa, straight.el, and combinations thereof.
- Ensure you have the latest emacs installed. This config is tested with Emacs 29.1 on Ubuntu 23.10, and Emacs 30.2 on Ubuntu 25.10.
- Install some general utilities
# Almalinux yum install autoconf automake gcc libpng-devel make pkgconfig poppler-devel poppler-glib-devel zlib-devel clang cmake libtool libvterm-devel # Ubuntu apt install autoconf automake gcc libpng-dev make pkgconf libpoppler-dev libpoppler-glib-dev zlib1g-dev clang cmake libtool libvterm-dev libtree-sitter-dev python3-venv
- Create a directory called “org-roam” in your home.
mkdir ~/org-roam - Install python language servers with pip. pyenv setups are possible. You don’t need all of these, read more on what you need before doing this. If you’re not sure, start with
python3-lsp.pip install 'python-language-server[all]' python-lsp-server debugpy pyright sudo apt install python3-pylsp - I’d recommend installing Texlive for compiling latex documents. Also install latexmk for compilation “on the fly”.
The following is a recommended configuration for latexmk, which you can put in ~/.latexmkrc
$pdf_mode = 1; # For pdflatex $pdflatex = 'pdflatex -synctex=1 -halt-on-error %O --shell-escape %S'; # Custom dependency and function for nomencl package add_cus_dep( 'nlo', 'nls', 0, 'makenlo2nls' ); sub makenlo2nls { system( "makeindex -s nomencl.ist -o \"$_[0].nls\" \"$_[0].nlo\"" ); } $pdf_previewer = "cat > /dev/null";
- Clone the contents of this repository into your ~/.emacs.d folder.
cd ~ git clone git@github.com:Nidish96/emacstarter.git mv emacstarter .emacs.d
- Fire up emacs a couple times to ensure everything is installed properly.
The config uses treesit.el extensively for syntax highlighting and navigation. You might have to install some of these grammars manually with M-x treesit-install-language-grammar .
The following are the list of features enabled by the config in addition to emacs defaults.
- Packages:
- ~elpaca~ is used for package management.
- Utilities
helmis installed as the navigation engine throughout.magitis installed as the front-end for git.yasnippetis installed for snippet expansion. A basic set of snippets are also installed.ieditis installed for editing multiple occurrences of the same string.companyis installed as the completion framework.dired-subtreeis installed for directory navigation.
- Org-Mode Ecosystem
- A dev branch of org is installed. This provides live latex previews.
- The look and feel of org files is improved with fancy bullets and colors
- Org roam is installed as a personal knowledge management system
- Org tree slide is installed for presenting org files
- A useful “local” capture template for org-agenda is included
- Programming/Development IDEs
- A Latex IDE is setup using
AucTeXandpdf-tools - A MATLAB IDE is setup using
matlab-mode - A Python IDE is setup using the Language Server Protocol (LSP or eglot may be used).
- A Julia IDE is setup using
julia-snail. - A Typst IDE is setup using
typst-ts-mode.
- A Latex IDE is setup using
- Miscellanies
- The
openfoampackage is installed for editing openfoam input files. csv-modeis installed to work with csv files.- Etc.
- The
- The whole config is written in an org file that is automatically tangled into elisp code. This makes it easier to maintain the emacs config.
- Some files may not have extensions but you may still want them to open in a particular mode.
Add the following line at the beginning of the file for this
# -*- mode: <modename> -*-The first character(s) can be any appropriate comment character. Read the emacs documentation entry on this for more.
- To make tramp work with zsh shells, add the following to the beginning of you .zshrc file:
[[ $TERM == "dumb" ]] && unsetopt zle && PS1='$ ' && return
- You can bind the following shell script to a keybinding (I like using
Ctrl-Alt-e) to conditionally launch an emacs client with the daemon (or create a new daemon if it doesn’t already exist).#!/usr/bin/bash source ~/.profile emacsclient -ce '(lambda () (interactive) previous-buffer)' if [ $? -ne 0 ]; then emacs --daemon emacsclient -c fi
- Live plotting capabilities (possibly linked to some data files)? (Should be achievable with gnuplot)
