Skip to content

alexey-martynov/emacs-config

Repository files navigation

Emacs Configuration

Configuration

The configuration offered here is a matter of taste. It contains many customizations and some of them is a matter of discussions. The most important:

  • Smart Tabs mode.

    Turned for C and C++ mode.

  • C and C++ indentation styles.

  • Twilight color theme.

  • Windmove turned on to easily move between windows.

  • Auto-indent yanked code.

  • Mark and auto-delete trailing whitespace in programming modes.

  • SLIME Common Lisp configuration

The most of extra libraries/modes are loaded via submodule to have fixed working version.

Individual mode configuration is placed to modes directory.

The Makefile offers functionality to compile contents of customized libraries except modes content. The following targets exist:

  • compile

    Compile Lisp files.

  • autoload

    Generate auto load information from Lisp files.

  • all

    Runs autoload and compile.

  • clean

    Removes everything generated by targets above.

The Makefile automatically uses emacs command on all platforms except MacOS. On MacOS full path to possibly installed Emacs for MacOS used instead. In case when Emacs installed in non-default place the EMACS variable can be passed with name of Emacs executable.

Installation

  1. Checkout repository to a place where Emacs searches for configuration. The most used place is $HOME/.emacs.d

  2. Initialize and update submodules:

    $ git submodule --init
    $ git submodule --update
    
  3. Optionally compile Lisp source to speed up loading:

    $ make
    

General configuration structure

All configuration split into the following parts:

  • Infrastructure

    This part performs overall startup and initialization.

  • Libraries and common code

    This code lives in site-lisp subdirectory. Libraries are included as Git submodules if possible.

  • Mode related configuration

    All mode related configuration is placed to modes subdirectory. These files are never compiled.

  • Host related configuration

    These files placed to host subdirectory. Every file should have name matching current host name (without domain) to be loaded on startup. These files are never compiled too.

Due to historical reasons some mode configuration still lives in init.el. This configuration will move to separate files when it is possible.

Running Emacs server with systemd

It is possible to automatically start Emacs server on login. The following methods available:

  • Insert start to shell initialization scripts.

    Works on any system but depends on shell.

  • Invoke via systemd user service

    Works only on Linux with systemd.

To use systemd approach the following steps required:

  1. Install systemd unit for user (assuming repository in default location .emacs.d):

    $ ln -s "$HOME/.emacs.d/systemd/user/emacs-server.service" "$HOME/.config/systemd/user"
    

    There are 2 units provided: emacs-server.service to use Emacs from system and emacs-server-local.service to use user's local Emacs from $HOME/.local.

  2. Enable unit:

    $ systemctl --user enable emacs-server
    

The Bash editor customization can be done by sourcing file bashrc file in configuration.

SLIME Configuration

The SLIME mode file contains some customizations to allow per system configurations without affecting Emacs Lisp files.

To configure Lisp implementations the subdirectory modes/lisp.d is used. Every executable file in this directory is treated as name of symbol with Common Lisp implementation. This file should be a link to main binary or script which launches interpreter.

Please note that Clozure CL may need additional parameters to support UTF-8: -K utf-8.

About

My Emacs configuration

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages