.emacs in org mode

less than 1 minute read

Usually, when you are using Emacs, all your favourite shortcut and others Emacs characteristic are in the .emacs file. However, to have a better .emacs organisation, I suggest you to use the org-mode with your .emacs. Like this, you can organise very easily your .emacs and put categories

To doing so you will needed to put in your .emacs file a simple link to the org file with every Emacs customisation. Thus, the .emacs should be like this:

(package-initialize)
(require 'org)
(org-babel-load-file
 (expand-file-name "emacs-init.org"
                   "~/."))

And then you will have another file here name emacs-init.org which should start like this for example:

* Init
** Packages & others
#+BEGIN_SRC emacs-lisp
(require 'package)
(add-to-list 'package-archives
           '("melpa-stable" . "https://stable.melpa.org/packages/") t)
;(add-to-list 'package-archives
 ;            '("marmalade" . "http://marmalade-repo.org/packages/") t)
(add-to-list 'package-archives
	     '("melpa" . "http://melpa.org/packages/") t)
(add-to-list 'package-archives '("org" . "http://orgmode.org/elpa/") t)
(package-initialize)
#+END_SRC

** LaTeX
#+BEGIN_SRC emacs-lisp
(load "auctex.el" nil t t)
;(load "preview-latex.el" nil t t)
(pdf-tools-install)

...
#+END_SRC

As you can see, you simply need to put your emacs-lisp code using the #+BEGIN_SRC and #+END_SRC tags.