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.
- Ensure you have the latest emacs installed. This config is tested with Emacs 29.1 on Ubuntu 23.10.
- 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";
- Install some utilities for pdfs through
# Almalinux yum install autoconf automake gcc libpng-devel make pkgconfig poppler-devel poppler-glib-devel zlib-devel clang # Ubuntu apt install autoconf automake gcc libpng-dev make pkgconf libpoppler-dev libpoppler-glib-dev zlib1g-dev clang
- Create a directory called “org-roam” in your home.
mkdir ~/org-roam
- Install python language servers with pip. pyenv setups are possible.
pip install 'python-language-server[all]' python-lsp-server debugpy pyright sudo apt install python3-pylsp
- Clone the contents of this repository into your ~/.emacs.d folder.
- Fire up emacs a couple times to ensure everything is installed properly.
The following are the list of features enabled by the config in addition to emacs defaults.
- Packages:
- The GNU and MELPA repositories are loaded.
use-package
is used for package management.quelpa
andquelpa-use-package
are installed to directly install from web sources.
- Utilities
helm
is installed as the navigation engine throughout.magit
is installed as the front-end for git.yasnippet
is installed for snippet expansion. A basic set of snippets are also installed.iedit
is installed for editing multiple occurrences of the same string.company
is installed as the completion framework.dired-subtree
is installed for directory navigation.
- Org-Mode Ecosystem
- 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
AucTeX
andpdf-tools
- A MATLAB IDE is setup using
matlab-mode
- A Python IDE is setup using the Language Server Protocol (LSP).
- A Latex IDE is setup using
- Miscellanies
- The
openfoam
package is installed for editing openfoam input files. csv-mode
is installed to work with csv files.
- 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)