Nidish96 / emacstarter

A starter emacs config for my line of work

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

A Basic Emacs Configuration for Engineers

./ewokswemacs.png

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.

Instructions

  1. Ensure you have the latest emacs installed. This config is tested with Emacs 29.1 on Ubuntu 23.10.
  2. 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";
        
  3. Install some utilities for pdfs through
    # Almalinux
    yum install autoconf automake gcc libpng-devel make pkgconfig poppler-devel poppler-glib-devel zlib-devel
    
    # Ubuntu
    apt install autoconf automake gcc libpng-dev make pkgconf libpoppler-dev libpoppler-glib-dev zlib1g-dev
        
  4. Create a directory called “org-roam” in your home.
    mkdir ~/org-roam
        
  5. Install python language servers with pip. pyenv setups are possible.
    pip install 'python-language-server[all]' python-lsp-server debugpy
    
    sudo apt install python3-pylsp
        
  6. Clone the contents of this repository into your ~/.emacs.d folder.
  7. Fire up emacs 2-3 times to ensure everything is installed properly.

List of Features Included in Config

The following are the list of features enabled by the config in addition to emacs defaults.

  1. Packages:
    • The GNU and MELPA repositories are loaded.
    • use-package is used for package management.
    • quelpa and quelpa-use-package are installed to directly install from web sources.
  2. 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.
  3. 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
  4. Programming/Development IDEs
    • A Latex IDE is setup using AucTeX and pdf-tools
    • A MATLAB IDE is setup using matlab-mode
    • A Python IDE is setup using the Language Server Protocol (LSP).
  5. Miscellanies
    • The openfoam package is installed for editing openfoam input files.
    • csv-mode is installed to work with csv files.
  6. 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.

Usage Tips and Tricks

  1. 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.

  2. To make tramp work with zsh shells, add the following to the beginning of you .zshrc file:
    [[ $TERM == "dumb" ]] && unsetopt zle && PS1='$ ' && return
        
  3. 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/sh
    
    emacsclient -c
    if [ $? -ne 0 ]; then
        emacs --daemon
        emacsclient -c
    fi
        

More Packages to add

  1. Live plotting capabilities (possibly linked to some data files)? (Should be achievable with gnuplot)

About

A starter emacs config for my line of work


Languages

Language:Emacs Lisp 97.4%Language:Shell 2.6%