Skip to content

Xparx/emacs-init

Repository files navigation

Emacs init

Emacs init

My custom emacs-init

This is a personalized emacs initialisation file. To get it you can git it;
git clone https://github.com/xparx/emacs-init.git ~/src/emacs-init

To try it out use

emacs -q -l ~/src/emacs-init/init.el

It should be mostly self contained, meaning that all files it fetches, creates and need should be in this directory. No guaranties though.

Dependencies

emacs24-starter-kit?

This emacs setup is inspired by and in part copied from emacs24-starter-kit. The latest version can be found at github
git clone https://github.com/eschulte/emacs24-starter-kit.git ~/src/emacs24-starter-kit

If you want to keep your regular ~/.emacs.d in place and just launch a single instance, using the starter kit, try the following invocation:

emacs -q -l ~/src/emacs24-starter-kit/init.el

Structure

The init.el file is where everything begins. It is loaded automatically by Emacs on startup, its sole purpose is to load the elisp code embedded in emacs-init.org. The Customization below is a bit overkill but a leftover from the starter-kit that I don’t feel needs to be removed.

Customization

User specific config
Your personal configuration information can be stored in a user-specific-config file. This is the file named after your user with the extensions .el or .org [2]. If you’re unsure of your user name evaluate the following code block to find out.
echo $USER
    

If your configuration starts to feel cramped in a single file (although with the nested headlines of an Org-mode file, that could take a while) and you want to stretch your config’s legs, you can also create a directory named after your system user name. If a such a directory exists, it will be added to the load-path, and any elisp or org-mode w/embedded elisp files in it will be loaded.

System specific config
Finally, you may want to configure different settings for different machines. The Emacs Init will look for a file named after the current hostname ending in .el or .org which will allow host-specific configuration. If you’re unsure of your hostname the following can be executed to find out.
hostname
    
Installing more elisp libraries
The easiest way to install new libraries is through
El-get
(see El-get below).
Emacs Lisp Package Archive
(see Emacs Lisp Package Archive below). When a library is not available through ELPA you can grab it’s source and place it directly in the src directory. Any packages found there will automatically be added to your load-path when Emacs starts up. I also install packages through el-get.

El-get package manager

El-get is a (foxy el-mexicano, Arriba! Arriba!:) package manager using custome recipes for installing and initializing emacs packages from a wide range of different repositories. The source can be fetched here by doing:
git clone https://github.com/dimitri/el-get.git

This can be automated with a Lazy Install or Regular Install master branch, which is the default in this emacs-init. This is done in init.el for conveniance

El-get initialization

Lazy Install

To setup el-get the simple way one needs only to evaluate the following emacs lisp block
;; So the idea is that you copy/paste this code into your *scratch* buffer,
;; hit C-j, and you have a working el-get.
(url-retrieve
 "https://raw.github.com/dimitri/el-get/master/el-get-install.el"
 (lambda (s)
   (goto-char (point-max))
   (eval-print-last-sexp)))

Regular Install master branch

(setq el-get-dir (expand-file-name "el-get" emacs-init-dir))
(add-to-list 'load-path (concat emacs-init-dir "el-get/el-get"))

(unless (require 'el-get nil 'noerror)
  (with-current-buffer
      (url-retrieve-synchronously
       "https://raw.github.com/dimitri/el-get/master/el-get-install.el")
    (let (el-get-master-branch)
      (goto-char (point-max))
      (eval-print-last-sexp))))

(add-to-list 'el-get-recipe-path (concat emacs-init-dir "recipes"))
(el-get 'sync)

Emacs Lisp Package Archive

ELPA is now an official part of Emacs so no special configuration is required to download and install packages. Packages installed through ELPA will be stored in the elpa/ sub-directory of this directory.

About

My emacs init settings

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published